Browse all practice questions for the HashiCorp Terraform Infrastructure as Code (IaC) Practice Test. Search by topic, open any question and review its full explanation, then test yourself in the practice quiz.

HashiCorp Terraform IaC Practice Test 2026 – Comprehensive Exam Prep course image
More practice questions

These questions are part of the practice quiz. Start practicing

  • What does the term "Partial configuration" refer to in Terraform?
  • Which of the following tasks is NOT the responsibility of a Terraform provider?
  • What does the 'terraform state' command do?
  • How do you define dependencies between resources in Terraform?
  • What keyword is used to declare a new module in a Terraform configuration file?
  • Which command is used to show a resource in the Terraform state?
  • What is the use-case for terraform output?
  • What is the primary function of the 'terraform login' command?
  • Which command lists the workspaces in Terraform?
  • How does Terraform determine changes needed for the infrastructure?
  • What is the default state file for Terraform?
  • What type of resources can Terraform manage?
  • What is a Terraform module?
  • What command initializes a Terraform configuration?
  • What block structure correctly defines a remote backend to Amazon S3?
  • What is the purpose of Terraform modules?
  • What file is typically used to specify multiple environments in Terraform?
  • Why is it important to use remote state storage?
  • How does Terraform determine the correct provider version to use?
  • What is the purpose of the 'terraform validate' command?
  • How do you declare a variable in a Terraform configuration?
  • How do you define dependencies manually if Terraform cannot automatically resolve them?
  • Which of the following is considered an IaC file?
  • How can you prevent certain resources from being destroyed in Terraform?
  • What is Terraform primarily used for?
  • How can outputs be utilized in Terraform?
  • Is it mandatory to include a provider configuration block in every Terraform configuration?
  • Which Terraform command is used to initialize a working directory?
  • Which command would you use to check for discrepancies between the actual infrastructure and your Terraform configuration?
  • In Terraform, what does the 'terraform init' command do?
  • What command is used to apply changes required to reach the desired state of the configuration?
  • Which provider would you configure to manage AWS resources in Terraform?
  • How can you override a variable value during execution?
  • What does the command 'terraform resource list aws_instance.server' do?
  • What does the command 'terraform refresh' do?
  • What does the command 'terraform workspace show' do?
  • What does the 'terraform refresh' command do?
  • In the provided dynamic block, what is the issue that causes it to result in an error?
  • Which of the following tasks does terraform init perform?
  • Which of the following is a valid way to refer to a module in Terraform?
  • What is the primary purpose of 'terraform import' command?
  • How can you prevent sensitive data from being exposed in state files?
  • What concept allows Terraform to integrate variables and resource attributes together?
  • What command would you run to switch to a different workspace in Terraform?
  • Which of the following resources can be created using Terraform?
  • Which argument must be included in the module block?
  • What are provisioners primarily used for in Terraform?
  • Where can an API Token for Terraform Cloud or Terraform Enterprise be stored?
  • What language is used to write Terraform configuration files?
  • What file format does Terraform primarily use for its configuration files?
  • Which Terraform command is used to validate configurations?
  • What does the 'terraform apply' command do?
  • What is a "tainted" resource in Terraform?
  • How does Terraform handle resource dependencies?
  • What types of search terms can the Terraform Registry use?
  • Which command should you use to view the Terraform state?
  • How can a DevOps Engineer expose values from a child module that defines AWS VPC resources to the CLI?
  • Which command should you use to ensure a null resource in Terraform re-runs a backup process after script changes?
  • What command is used to enable a new workspace in Terraform?
  • What file type does Terraform use for configuration files?
  • What does the coalesce built-in function in Terraform return?
  • What does the Terraform lifecycle block define?
  • What type of configuration does Terraform primarily manage?
  • When would it be appropriate to use a null_resource in Terraform?
  • What is the role of 'depends_on' in Terraform modules?
  • Can a Terraform local value reference other local values?
  • What is the safest way to include sensitive variables in a CI/CD pipeline for Terraform?
  • What is the primary language used to write Terraform configurations?
  • In Terraform, what is a workspace?
  • What functionality does Terraform's `output` variable provide?
  • What does the terraform plan command do?
  • Which of the following types in Terraform is considered a complex type?
  • Which variable type is most suitable for storing both a server name (string) and memory size (number) in Terraform?
  • Which of these Terraform commands is used to clean or remove all associated resources of the current directory?
  • Does the command 'terraform refresh' modify the existing infrastructure?
  • What is the purpose of the triggers block in a null_resource?
  • What does setting the TF_LOG environment variable to DEBUG impact?
  • Which expression is used to apply the splat operator to return multiple EBS volume IDs?
  • How do you specify the provider you want to use in Terraform?
  • What is a workspace in Terraform?
  • In Terraform, what is an output value?
  • How would you define a variable in a Terraform configuration file?
  • In Terraform, what does the 'terraform apply' command do?
  • What command is used to initialize a new Terraform configuration?
  • What is the effect of the 'terraform taint' command?
  • How are variables passed into Terraform configurations?
  • What is a remote backend in Terraform?
  • Which file extension is commonly used for Terraform configuration files?
  • Can you write a Terraform configuration that includes both AWS and Azure providers?
  • What benefit does Terraform Cloud provide for team collaboration?
  • What command is used to initialize the backend configuration in Terraform?
  • What attribute would you use to specify the default value for a variable in Terraform?
  • How can you change the behavior of a resource during lifecycle events?
  • Which method is NOT suitable for keeping secrets out of Terraform configuration files?
  • What is a data source in Terraform?
  • In Terraform, what does the 'output' block do?
  • What method can be employed to ensure infrastructure changes are reviewed before being applied?
  • What does the 'terraform output' command provide?
  • What is a data source in Terraform?
  • What type of values can variables in Terraform hold?
  • What are the common attributes of a Terraform resource block?
  • Which command is used to apply changes required to reach the desired state?
  • What is the primary benefit of using Terraform Cloud?
  • In regards to backend configuration, what is the default behavior of specifying a remote backend?
  • How do you set a custom path for Terraform Logging via environment variable?
  • What is the function of a remote backend in Terraform?
  • What is a workspace in Terraform?
  • Which command is used to view the changes that will be made by applying a Terraform configuration?
  • When running a terraform refresh command, which of the following is NOT processed?
  • What is the difference between 'terraform apply' and 'terraform plan'?
  • Which command applies changes to the infrastructure as specified in the Terraform configuration files?
  • What is the primary function of a remote backend in Terraform?
  • What file extension do Terraform configuration files use?
  • How do you target a specific resource when applying changes?
  • Which file type is used to define the resources and configurations for Terraform?
  • Which command would you use to test your Terraform configuration without applying it?
  • What command is primarily used to create or update infrastructure in Terraform?
  • Which Terraform command assists in detecting and managing drift?
  • How can you maintain idempotency in Terraform configurations?
  • What is the function of the 'terraform destroy' command?
  • What file extension is typically used for Terraform configuration files?
  • Which of the following is a key feature of Terraform's infrastructure as code?
  • What is the purpose of the 'terraform validate' command?
  • What does the 'terraform validate' command do?
  • Which command is used to remove Terraform-managed infrastructure?
  • What is a resource in Terraform?
  • Which of the following is a valid terraform import command?
  • Describe the concept of 'resource' in Terraform.
  • What are variables used for in Terraform?
  • What is the primary purpose of a Terraform state file?
  • Which two languages are typically used in Terraform configurations?
  • What does the 'terraform refresh' command do?
  • Which of the following is NOT a valid string function in Terraform?
  • In Terraform, what does a module represent?
  • What is the best way to protect sensitive data in Terraform projects?
  • What is the purpose of the `terraform state` command?
  • How can developers inject secrets via Vault at the time of terraform apply within their configuration file?
  • What feature in Terraform allows for setting default values for input variables?
  • Which command is used to manually mark a resource as tainted in Terraform?
  • How is versioning handled in Terraform?
  • Which two components can a connection block be nested within?
  • What can you do with Terraform Cloud Run Triggers?
  • What does IaC stand for in the context of HashiCorp Terraform?
  • Which Terraform feature allows for finding and managing resource dependencies?
  • What is the purpose of a Terraform module?
  • What is the recommended approach to protect sensitive data identified by the security team in Terraform state files?
  • What is the benefit of using 'terraform plan -out'?
  • How does Terraform manage state?
  • To return all the IDs of attached EBS volumes for an AWS virtual machine, which expression should be used?
  • What is the purpose of the 'terraform apply' command?
  • How can outputs be exported in Terraform?
  • What is the function of the 'terraform import' command?
  • Is Terraform considered open-source software (OSS)?
  • Which command allows you to see anytime your infrastructure will change?
  • What is the purpose of the .terraform.lock.hcl file?
  • Which command initializes a Terraform configuration?
  • What is the scope of local values defined in child modules in Terraform?
  • Can Terraform be used to manage resources outside of cloud providers?
  • What command is used to apply changes in Terraform?
  • What distinguishes a map from a list type in Terraform?
  • What is the primary purpose of Terraform?
  • Which command would you use to see the resources currently being managed in a Terraform state file?
  • Is it mandatory to include a provisioner within a resource block when configuring resources in Terraform?
  • What command can you use to create an execution plan in Terraform?
  • How can you protect sensitive information in Terraform variables?
  • What does the state locking mechanism in Terraform do?
  • What is the best practice to protect sensitive values in Terraform state files?
  • What action does 'terraform state mv' perform?
  • Which command saves the execution plan to a file?
  • What is the main purpose of the 'terraform graph' command?
  • What does the Terraform command 'terraform apply -refresh-only' do?
  • Which Terraform Workflow involves a backend configured to use Terraform Cloud and pull requests for changes?
  • In Terraform, which file format is typically used for defining infrastructure resources and configurations?
  • What is the correct command to delete a workspace in Terraform?
  • Which command outputs the current state of the managed infrastructure?
  • In Terraform, what is the purpose of `count`?
  • What is the purpose of the 'terraform plan' command?
  • What does the command 'terraform state list' do?
  • What is the benefit of implementing Terraform workspaces?
  • What is a provider in Terraform?
  • Which feature is NOT available in the free tier of Terraform Cloud?
  • What is the name of the dependency lock file created by Terraform when it locks its state?
  • In Terraform, what command would you use to export the state to a JSON file?
  • What command do you use to initialize a Terraform configuration?
  • How can variables be set in a Terraform configuration?
  • What does the command 'terraform state rm' do?
  • What does the 'terraform plan' command do?
  • What is the primary purpose of Terraform?
  • Which file type is primarily used for writing Terraform configurations?
  • When Terraform crashes because Golang results in a panic, where will it log the results?
  • Which file extension is commonly used for Terraform files?
  • What does the command 'terraform state show' do?
  • What is a primary benefit of using modules in Terraform?
  • What is the purpose of the 'terraform fmt' command?
  • How do you extract a list of IDs from a variable named var.list containing a list of objects?
  • What does the `terraform plan` command do?
  • What command will get the latest version of plugins in Terraform that complies with the configuration's version constraints?
  • How does Terraform handle sensitive variables?
  • In Terraform, what does the term 'state' refer to?
  • Which command is used to create or update infrastructure in Terraform?
  • Which file extensions are associated with Terraform configuration files?
  • How do you set up a Terraform backend?
  • What subcommand would you use to list all resources in the Terraform state?
  • How can you ensure consistent environments when using Terraform?
  • Which command is used to initialize a Terraform configuration?
  • Which command initializes a directory containing Terraform configuration files?
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy