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 Infrastructure as Code (IaC) Practice Test 2026 - Free Terraform Exam Questions and Study Guide course image
More practice questions

These questions are part of the practice quiz. Start practicing

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

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy