Browse all practice questions for the Terraform Associate Practice Exam. Search by topic, open any question and review its full explanation, then test yourself in the practice quiz.

Ace the Terraform Associate Exam 2026 – Build Your Cloud Dream Team! course image
Can You Use terraform init to Install Third-Party Plugins?Is it possible to install third-party plugins using terraform init?Discovering the Advantages of Terraform OutputsWhat is the main advantage of using Terraform outputs?Exploring the Free Options in Terraform CloudIs Terraform Cloud available for free?How does Terraform Enterprise ensure AWS S3 bucket security?How can Terraform Enterprise enforce security controls for new AWS S3 buckets to be private and encrypted at rest?How to Replace a Virtual Machine in Terraform Without Affecting Your DatabaseIf you've deployed a virtual machine and a database and want to replace the VM without affecting the database, what should you do?Learn the Essential Role of Resource Blocks in TerraformIn Terraform, what is the purpose of resource blocks?Understanding Actions Forbidden During Terraform State File LockingWhich of the following actions are forbidden when the Terraform state file is locked? (Choose three)Understanding AWS Region Configuration in TerraformWhat meta-argument must be configured to deploy a resource to the `us-west-2` AWS region?Understanding how Terraform backends influence state management with commandsA Terraform backend determines how Terraform loads state and stores updates when you execute which commands?Understanding How Terraform Manages InfrastructureWhich of the following statements describes the behavior of Terraform when managing infrastructure?Understanding How Terraform Plan Enhances Your Development ProcessHow does terraform plan assist in the development process?Understanding How the Terraform Validate Command Ensures Code CompatibilityWhich of the following commands will check the overall compatibility of code with existing infrastructure?Understanding how to manage existing virtual machines with TerraformTo manage existing virtual machines (VMs) using Terraform after provisioning them via gcloud, which actions are required?Understanding How to Reference Volume IDs for EBS Block Devices in TerraformHow do you reference the Volume IDs associated with ebs_block_device blocks?Understanding Module Inheritance in TerraformDo modules inherit variables from their parent module?Understanding State Locking in Terraform: What You Need to KnowWhat does state locking accomplish in Terraform?Understanding Terraform Provisioners and Resource BlocksTerraform provisioners can be added to any resource block. True or False?Understanding Terraform Resource Indexing with aws_instanceHow would you reference the "name" value of the second instance of this fictitious resource?Understanding Terraform's Compatibility Across Operating SystemsIs it true that Terraform can run on both Windows and Linux without requiring a specific Server version?Understanding the Connection Block for Terraform ProvisionersTerraform provisioners that require authentication can use which of the following blocks?Understanding the Outputs Section in Terraform ModulesWhat section of a Terraform module produces outputs that can be consumed by other modules?Understanding the Power of the Remote-Exec Provisioner in TerraformWhich provisioner runs a process on the created resource?Understanding the Relationship Between Your Terraform State File and Your InfrastructureDoes the 'terraform.tfstate' file always match your currently built infrastructure?Understanding the Right Backends for Terraform ConfigurationsYour DevOps team is currently using the local backend for your Terraform configuration. Which of the following backends would not work?Understanding the Role of Backend in TerraformIn Terraform, what does the term 'backend' refer to?Understanding the Role of Sensitive Variables in TerraformWhat is the impact of marking a variable as sensitive in Terraform?Understanding the Role of the Remote-Exec Provisioner in TerraformWhat is the purpose of the remote-exec provisioner in Terraform?Understanding the Role of Version Control in TerraformWhat is the significance of using version control with Terraform?Understanding the Taint Command for Rerunning Scripts in TerraformWhat command should be executed to rerun a script in a local-exec provisioner?Understanding the Terraform State List CommandWhich of the following is a valid command to view the current configuration values in Terraform?Understanding the Terraform State Show CommandWhat does the 'terraform state show' command do?Understanding Version Constraints in Terraform for GitHub ProviderYou need to constrain the GitHub provider to version 2.1 or greater. What should you include in the Terraform 0.12 configuration's provider block?Understanding What Happens When You Run Terraform Apply After Deleting Cloud InstancesWhat does Terraform do when you run terraform apply after accidentally deleting cloud instances?Understanding When Terraform Installs Its ProvidersDuring which phase does Terraform install its providers?Understanding where Terraform's local backend stores its stateWhere does the Terraform local backend store its state?Why Does Your Terraform Apply Fail? Understanding Key IssuesYou write a new Terraform configuration and immediately run terraform apply in the CLI using the local backend. Why will the apply fail?Why Storing Secrets in Terraform Repositories Is a Bad IdeaIs it advisable to store secret data in the same version control repository as your Terraform configuration?Why Understanding the 'terraform plan' Command is CrucialWhat is the purpose of the 'terraform plan' command?
More practice questions

These questions are part of the practice quiz. Start practicing

  • What command is used to initialize a Terraform working directory?
  • Which environment variable must be configured to make Terraform's logging more verbose?
  • Which command generates DOT formatted data for visualizing dependencies in Terraform?
  • Can you reference a resource created with for_each using a Splat (*) expression?
  • When defining variables in Terraform, which of the following options allows for a default value?
  • How can you ensure that a resource is recreated during the next apply?
  • Which built-in Terraform function can you use to read the contents of a local file called id_rsa.pub?
  • A terraform apply can not _________ infrastructure.
  • What value does the Terraform Cloud/Terraform Enterprise private module registry provide?
  • What does the `terraform apply` command do?
  • Terraform validate reports syntax check errors from which of the following scenarios?
  • What challenge might a DevOps team face if they adopt AWS CloudFormation for provisioning resources?
  • How can a ticket-based system impact infrastructure provisioning?
  • If you have created a VM with Terraform and want to delete it, what should you execute?
  • In Terraform, what is the primary purpose of the init command?
  • What is the use of the terraform output command?
  • What is a common use of the `terraform output` command?
  • Is it true that Terraform requires the Go runtime as a prerequisite for installation?
  • What happens when you run the terraform taint command on a managed resource?
  • What does Terraform require for managing module dependencies effectively?
  • Setting the TF_LOG environment variable to DEBUG logs debug messages into syslog. Is this statement true?
  • What will occur if you run terraform plan without any configuration changes?
  • How do you specify a tag of v1.0.0 when referencing a Git module?
  • In Terraform, what is a 'resource'?
  • What is the purpose of the terraform apply command?
  • What is the safest command to see all resources that will be deleted by Terraform before applying changes?
  • What is the benefit of using remote state in Terraform?
  • Is it true that only the user who generated a Terraform plan may apply it?
  • Why should secrets not be hard coded into Terraform code?
  • What is a safe way to inject sensitive variables into a Terraform run in a CI/CD pipeline?
  • What does terraform apply change after you have approved the execution plan?
  • When you run 'terraform destroy', what happens before the approval prompt?
  • Will terraform apply fail if terraform plan was not executed first?
  • What is the purpose of the terraform taint command?
  • What does the default "local" Terraform backend store?
  • What is the outcome of running terraform validate?
  • Which of the following is allowed as a valid Terraform variable name?
  • What is the purpose of the terraform plan command?
  • Which aspect is crucial to consider when scaling infrastructure with a ticket-based system?
  • What does the 'terraform init' command do?
  • Which file extension is typically associated with Terraform configuration files?
  • What happens by default if a Terraform creation-time provisioner fails?
  • True or False: Module variable assignments are inherited from the parent module and do not need to be explicitly set.
  • When using a remote backend that requires authentication, what does HashiCorp recommend?
  • Does the terraform validate command check the syntax of Terraform files?
  • What is the purpose of the .terraform.lock.hcl file in Terraform?
  • Which of the following statements about Terraform plans is accurate?
  • Which command is used to show the changes that will be made to the infrastructure?
  • When using a module block to reference a module stored on the public Terraform Module Registry, how do you specify version 1.0.0?
  • Which are examples of infrastructure as code? (Choose two.)
  • Which option cannot be used to keep secrets out of Terraform configuration files?
  • What would happen if a resource is missing from the state file?
  • In Terraform, which data type can be used to define a list of values?
  • Which command is used to validate the configuration files in Terraform?
  • How does the Terraform remote backend differ from backends like S3 or Consul?
  • If a teammate modifies an infrastructure component you are working on after you ran terraform plan, will the apply plan remain the same?
  • Which of the following best describes the term 'resource' in Terraform?
  • What occurs if a VM created by Terraform is deleted via the cloud provider console and terraform apply is executed again?
  • What is the purpose of the terraform plan command?
  • Which of the following is responsible for managing the locking of the state file?
  • What is true about Terraform Cloud tiers regarding team management?
  • What feature stops multiple admins from changing the Terraform state at the same time?
  • How can you format Terraform HCL code according to standard Terraform style convention?
  • When should Terraform configuration files be written when running terraform import on existing infrastructure?
  • When using Terraform, what does the command terraform destroy do?
  • What outcome occurs when the resource definition of a virtual machine is removed after it has been created and 'terraform apply' is run again?
  • Which backend does the Terraform CLI use by default?
  • What should a user do if they want to check what changes will be made by their Terraform code?
  • What command is required the first time you run Terraform in a configuration directory?
  • What is the result of running `terraform validate`?
  • What does the terraform init command do in a Terraform project?
  • How should you correctly pass the value of variable num_servers into a module with the input servers?
  • How do you specify a module's version when publishing it to the public Terraform Module Registry?
  • Are Terraform providers always installed from the Internet?
  • In Terraform, which command is used to view the execution plan without making changes?
  • To safely view all resources that will be deleted by Terraform, which command should you use?
  • Which command checks if all Terraform configuration code is properly formatted without making changes?
  • True or False: HashiCorp Configuration Language (HCL) supports user-defined functions.
  • What must you include in a module to reference output values from a child module?
  • Which command would you use to check the current provider version being used in Terraform?
  • Is it necessary to initialize a Terraform backend before it can be configured?
  • Is changing the Terraform backend to a different one after the first terraform apply mandatory?
  • When does Sentinel enforce policy logic in a Terraform Enterprise run?
  • What does the command 'terraform fmt' do when executed without flags in a directory with configuration files?
  • When deploying resources to Azure using Terraform, which statement about state files is correct?
  • Which command is not typically associated with starting a Terraform workflow?
  • Where is Terraform unable to load a provider from?
  • Is it true that Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument?
  • In Terraform HCL, what does the object type of object({ name=string, age=number }) match?
  • What does 'terraform apply' primarily do?
  • What method can you use to trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
  • In a Terraform configuration using a networking module named my_network, how should you handle the attribute vnet_id?
  • When you initialize Terraform, where does it cache modules from the public Terraform Module Registry?
  • Which provider authentication method avoids storing credentials in the state file?
  • What is a requirement for version constraints in Terraform 0.13 and later configurations?
  • If no outputs were created, what is the quickest way to find a deployed resource's public IP?
  • What steps are essential for provisioning new infrastructure in Terraform?
  • How does Terraform determine dependencies between resources?
  • Which of the following is not a method to trigger a Terraform destroy?
  • Which Terraform command is used to create an execution plan?
  • What type of information can Terraform variables store?
  • A Terraform local value can reference other Terraform local values. True or False?
  • Which Terraform collection type is best for storing key/value pairs?
  • What is the primary purpose of the terraform state file?
  • Which command lets you experiment with Terraform's built-in functions?
  • You just scaled your VM infrastructure and realized you set the count variable to the wrong value. You correct the value and save your change. What do you do next to make your infrastructure match your configuration?
  • What command should be used to validate the syntax of a Terraform configuration file?
  • Which resource meta-parameter can you use to specify a dependency manually in Terraform?
  • When does terraform apply reflect changes in the cloud environment?
  • Which command is used to initialize a working directory containing Terraform configuration files?
  • Which command is primarily used to create a new resource in Terraform?
  • Which of the following can you do with terraform plan? (Choose two.)
  • What is a primary goal of infrastructure as code?
  • What type of block is used to construct a collection of nested configuration blocks in Terraform?
  • Which of the following is a benefit of using Terraform modules?
  • What command would you use to ensure that changes made in your configuration are reflected in Terraform's state?
  • What will happen when you run terraform destroy without any flags after successfully creating resources including a load balancer?
  • What happens if a resource attribute is not referenced in a proper format in HCL?
  • What is a state file in Terraform?
  • Do all standard backend types support state storage, locking, and remote operations?
  • What is the primary function of the terraform init command?
  • What type of backend does Terraform use to manage state?
  • How can you find out the paths from which Terraform is loading providers referenced in your configuration files?
  • A Terraform provider is not responsible for:
  • Which Terraform command should be used to remove resources from infrastructure?
  • After upgrading the version of a provider in Terraform, what is the next step?
  • When developing a new Terraform configuration for virtual machines, which command should you run first to create the infrastructure?
  • What is one disadvantage of using dynamic blocks in Terraform?
  • Where in your Terraform configuration would you specify a state backend?
  • What does terraform import allow you to do?
  • Can one remote backend configuration map to multiple workspaces?
  • If an output variable doesn't have a specified description, what happens?
  • When would you typically use the terraform import command?
  • What file extension is used for Terraform configuration files?
  • What argument is required when declaring a Terraform output?
  • You need to migrate a workspace to use a remote backend. After updating your configuration, what command do you run to perform the migration?
  • If a module uses local values, what feature can be used to expose those values?
  • What is the purpose of the terraform init command?
  • How would you reference the module output vpc_id?
  • What is the purpose of the terraform plan command?
  • When using a data source for an AWS AMI, what value should you enter for the ami argument in the AWS instance resource?
  • What advantage does an operations team gain by using infrastructure as code?
  • What happens if you run terraform apply immediately after a successful application without any changes?
  • What does the terraform destroy command do?
  • What command is used to initialize a Terraform working directory?
  • What command would you run to update the ID in state after fixing a typo in your Terraform configuration?
  • Which of the following is not considered a key principle of infrastructure as code?
  • What command is used to evaluate the changes before applying them in Terraform?
  • Which errors does 'terraform validate' report related to configuration consistency?
  • Which option helps to keep secrets out of Terraform configuration files?
  • Which type of block is utilized to fetch or compute information for use within a Terraform configuration?
  • Which command would you use to manage different state files for development and production environments?
  • Which flag would you add to terraform plan to save the execution plan to a file?
  • What is terraform refresh intended to detect?
  • How can inconsistent configurations of manually deployed compute instances be addressed?
  • Which command can be used to inspect the current state of your infrastructure in Terraform?
  • What argument(s) is (are) required when declaring a Terraform variable?
  • Which command ensures compliance with Terraform configuration styles?
  • What happens when you run terraform destroy?
  • Which file format does Terraform primarily use to define infrastructure?
  • True or False: A Terraform provisioner must be nested inside a resource configuration block.
  • What component is not processed during a 'terraform refresh' operation?
  • Can open source Terraform import publicly-accessible and open-source modules?
  • In Terraform 0.13 and above, do configurations always refer to providers by their local names outside of the required_providers block?
  • How does Terraform know the order to create resources?
  • What command should you run to display all workspaces for the current configuration?
  • What is not an advantage of using infrastructure as code operations?
  • What is the purpose of a Terraform workspace?
  • What is the best practice to reflect infrastructure changes in Terraform after manually destroying resources?
  • As a member of the operations team, which provision is best to run a script on a virtual machine created by Terraform?
  • When encountering an error: "Access Denied: status code: 403," what step should be taken to find out more about the problem?
  • Which command would typically be used to initialize a Terraform configuration?
  • Which Terraform command prompts Terraform to check and familiarize itself with the environment before making any changes?
  • What does the command terraform init do?
  • Which of the following locations can Terraform use as a private source for modules?
  • Which feature helps in managing sensitive data in Terraform?
  • A fellow developer wants to keep a specific AWS instance while refactoring Terraform code. What command should be used to tell Terraform to no longer manage the resource?
  • If a module declares a variable with a default, what is true about that variable?
  • Which command should you run to perform teardown of all infrastructure without immediate execution?
  • How do you access the attribute 'name' of a resource called 'example' in HCL?
  • How can you protect sensitive data stored in Terraform state files?
  • What initiates the terraform import command?
  • Which of the following is not a valid Terraform collection type?
  • Which statement is true about Terraform and Terraform providers concerning version numbers?
  • Does the Terraform plan command update your state file?
  • Are all modules on the official Terraform Module Registry verified by HashiCorp?
  • When should the force-unlock command be used in Terraform?
  • What is the name of the default file where Terraform stores the state?
  • What happens if you modify a resource and run terraform apply?
  • What does "Terraform apply" command do?
  • Which of the following statements is true about Terraform variable names and the state file?
  • How should you pass the value of an input variable called environment from a parent module to a child module?
  • Which task does terraform init not perform?
  • If writing Terraform code that adheres to style conventions, how would you properly indent each nesting level compared to the one above it?
  • What command is used to remove a resource from the Terraform state?
  • What will happen to a Terraform output marked as sensitive?
  • What is the workflow for deploying new infrastructure using Terraform?
  • Which file typically contains the configuration for Terraform providers?
  • Which command is used to apply changes and create resources defined in your configuration?
  • Which of these options is the most secure place to store secrets for connecting to a Terraform remote backend?
  • Which of the following is not an action performed by terraform init?
  • When working with Terraform Enterprise and Cloud Workspaces, how are they conceptually viewed?
  • What is the purpose of the 'terraform plan' command?
  • Which function is not valid in Terraform's string functions?
  • Which of these is the best practice to protect sensitive values in state files?
  • In which situation will Terraform not apply changes made directly on the cloud console?
  • Do Terraform variables and outputs store the "description" argument in the state file?
  • What information does the public Terraform Module Registry expose about published modules?
  • What is the IaC best practice for modifying an infrastructure stack in a public cloud?
  • Which feature is available only in Terraform Enterprise or Cloud workspaces?
  • Which of the following is not a valid source from which Terraform can import modules?
  • What do most Terraform providers interact with?
  • What command would you use to create an execution plan for Terraform?
  • What are providers used for in Terraform?
  • How can you check the current state of your Terraform-managed infrastructure?
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy