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.

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

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy