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

HashiCorp Terraform Associate Practice Exam 2026 - Free Terraform Associate Exam Practice Questions and Study Guide course image
All questions

These questions are part of the practice quiz. Start practicing

  • How would you reference the id attribute of a data source named 'dc' of type vsphere_datacenter when supplying the datacenter_id argument to a resource?
  • Which command is used to reauthenticate with the provider when credentials may be invalid?
  • When using a remote backend that requires authentication, HashiCorp recommends that you:
  • If a module uses local values, you can expose that value with a Terraform output.
  • A junior admin accidentally deleted some cloud instances. What does Terraform do when you run terraform apply?
  • Where are versioning signals for a module published when using the public Terraform Module Registry?
  • You can access state stored with the local backend by using the terraform_remote_state data source.
  • If you manually destroy infrastructure, what is the best practice reflecting this change in Terraform?
  • When you modify a resource in Azure Portal that is managed by Terraform, when does Terraform reflect that change in its state?
  • Which statement about the terraform plan output is true?
  • Which of the following is not a way to trigger terraform destroy?
  • You have created a new Terraform configuration for two virtual machines and would like to create the infrastructure for the first time. Which command should you run first?
  • Which Terraform command would you use to delete resources managed by your configuration?
  • Which statement about provider configurations is true?
  • Which of the following is not a benefit of remote state?
  • How would you reference the Volume IDs associated with the ebs_block_device blocks on an AWS instance named example?
  • Which statement about Terraform state management is accurate?
  • Which statement best describes how Terraform interprets a value assigned to a variable declared as an object type?
  • If you manually destroy infrastructure, what is the best practice to reflect this change in Terraform?
  • Which of the following correctly references a variable named num_instances in Terraform?
  • Which provision is best to use to run a script on a virtual machine created by Terraform?
  • Which of these commands makes your code more human readable?
  • Which command should you use to tell Terraform to no longer manage the resource?
  • When you initialize Terraform, where does it cache modules from the public Terraform Module Registry?
  • To increase Terraform's logging verbosity for debugging, which environment variable should be configured?
  • Which construct can be used to avoid writing 42 nested ingress blocks by hand?
  • You have deployed a new webapp with a public IP address on a cloud provider. However, you did not create any outputs for your code. What is the best method to quickly find the IP address of the resource you deployed?
  • Terraform plan updates your state file.
  • Which statement about Terraform state file security is true?
  • How does Terraform manage most dependencies between resources?
  • Where can Terraform load a provider from?
  • Which statement describes the timing of state updates in Terraform when planning or applying changes?
  • Which step in the provisioning workflow actually applies changes?
  • Which open source Terraform feature allows you to manage multiple state files for different environments while keeping them linked to the same configuration?
  • In Terraform deployments to Azure, which statement about state files is true?
  • In Terraform, which form of the required_providers block correctly specifies a minimum version?
  • Which option cannot be used to keep secrets out of Terraform configuration files?
  • Which argument is required when declaring a Terraform variable?
  • Which of the following is allowed as a Terraform variable name?
  • During a terraform apply -refresh-only run, which element is not consulted by Terraform?
  • What is the purpose of a data source in Terraform?
  • In a child Terraform module that provisions an AWS instance named main, which is the correct way to define an output for the instance's IP address to the root module?
  • Which action brings external resources under Terraform management by creating an entry in the state file?
  • If a DevOps team adopts AWS CloudFormation as their standardized method for provisioning public cloud resources, which scenario poses a challenge?
  • You are reading contents of a local file in a Terraform configuration. Which built-in function should you use to import the file's contents as a string?
  • Terraform variables and outputs that set the 'description' argument will store that description in the state file.
  • What is terraform refresh intended to detect?
  • Which of the following is a best practice for backend configuration in Terraform?
  • What is the best way to specify a tag of v1.0.0 when referencing a module stored in Git (for example git::https://example.com/vpc.git)?
  • What is the primary purpose of terraform init?
  • Any user can publish modules to the public Terraform Module Registry.
  • Which statement is true about the plan output when applying Terraform?
  • If you remove a resource from configuration after applying, what happens on next apply?
  • Which provisioner executes a command on the machine running Terraform?
  • What is the name of the default file where Terraform stores the state?
  • Which Terraform command validates the syntax and configuration before planning or applying?
  • Which file stores the Terraform state locally?
  • Which of the following is a local module source path?
  • What is the primary purpose of the Terraform state file?
  • Which command initializes the working directory and installs required providers for a project?
  • Data sources fetch information about existing resources.
  • Which statement about Terraform state is true?
  • If you are using Terraform Enterprise or Cloud Workspaces, how should you think of their working directories relative to Open Source?
  • If a Terraform creation-time provisioner fails, what will occur by default?
  • Which command applies the changes described in the configuration after initialization?
  • When writing Terraform code, how should you indent each nesting level relative to the level above it?
  • To move a resource name in the state from htp to http without destroying the resource, which command would you use?
  • What type of block is used to construct a collection of nested configuration blocks?
  • What does terraform destroy do?
  • You are retrieving the value vnet_id from a networking module named my_network. Which step must you perform?
  • What does terraform import allow you to do?
  • During which Terraform phase are providers installed?
  • Which command would you run to automatically format Terraform configuration files to meet standard style guidelines?
  • True or False: Terraform automatically reconciles manually destroyed resources on the next plan?
  • Which statement best describes the role of a Terraform provider?
  • What does the .terraform.lock.hcl file track?
  • Which operation would bring an existing resource under Terraform management?
  • When does terraform apply reflect changes in the cloud environment?
  • Which of the following steps is required to initialize Terraform before provisioning?
  • Which of the following is available only in Terraform Enterprise or Cloud workspaces and not in Terraform CLI?
  • You can develop a custom provider to manage its resources using Terraform.
  • Which statement about Terraform modules is true?
  • Terraform validates the syntax of Terraform files.
  • Which AWS provider version constraint is specified by the example configuration?
  • Which statement best describes the terraform validate command?
  • What is the purpose of the destroy command in Terraform?
  • HashiCorp verifies every module on the Terraform Registry.
  • One remote backend configuration always maps to a single remote workspace.
  • In Terraform, a resource is uniquely identified in the state by which of the following?
  • Which statement about Terraform Enterprise workspaces is false?
  • If you suspect credentials are causing a state access error, which command should you run?
  • Which command lists resources in the Terraform state?
  • You should store secret data in the same version control repository as your Terraform configuration.
  • In a Terraform configuration, where do you specify the state backend?
  • Which of the following is a benefit of using Sentinel with Terraform Cloud/Terraform Enterprise?
  • To enable Terraform to show which paths provider binaries are loaded from, which setting enables debug messages?
  • What file records the exact provider versions used in a Terraform configuration to ensure reproducible builds?
  • What is a common disadvantage of using dynamic blocks in Terraform?
  • Terraform destroy is the only way to remove infrastructure.
  • If you add a new resource using the same provider and do not update the version constraint, and a lock file exists, which version will Terraform use?
  • Which option cannot be used to keep secrets out of Terraform configuration files?
  • Your organization requires that new AWS S3 buckets be private and encrypted at rest. How can Terraform Enterprise automatically enforce this security control before changes are applied?
  • What is the purpose of terraform init?
  • Which feature of the Terraform Cloud hosted service helps store Terraform state remotely?
  • In Terraform HCL, how do you reference the indexing attribute of the AWS instance resource named 'web'?
  • To stop Terraform from managing a specific resource while leaving the resource in place, which command would you use?
  • Which backends support state locking?
  • What is the primary purpose of the required_providers block in a Terraform configuration?
  • Which syntax correctly references an output named vnet_id from a module named my_network?
  • Backends in Terraform are responsible for storing and retrieving state data.
  • Terraform provisioners that require authentication can use which block?
  • In a module block for a registry module, what does the source attribute specify?
  • Which statement about dependencies in Terraform is true?
  • Which statement about private module sources is true?
  • In Terraform, is it true that only the user who generated a plan may apply it?
  • Which command shows the planned changes without applying them?
  • Which statement about the -out option used with terraform plan is true?
  • Which of the following is not a key principle of infrastructure as code?
  • If a Terraform run creates a VM in a shared cloud account and the state contains only that VM, what is the correct way to delete it with Terraform?
  • Which backend option provides remote state with locking and is commonly used with Terraform Cloud?
  • Which of the following statements about Terraform Cloud connected workspaces is true?
  • What resource meta-parameter can you use to enforce a specific dependency between resources?
  • When using a remote backend or Terraform Cloud integration, where is resource state stored?
  • Which command would you use to preview changes before applying a Terraform configuration?
  • Which Terraform function could you use to select the largest number from a list?
  • To automatically enforce Terraform code conventions in a CI/CD workflow, which command should be run?
  • Which statement describes a goal of infrastructure as code?
  • To enable team-based cost tracking, which approach for a billing_dept tag is appropriate?
  • In Terraform, a provisioner must be placed inside which block?
  • In the Terraform provisioning workflow, which statement is correct?
  • What happens if you remove a resource from the configuration and apply again?
  • Which statement about local modules is incorrect?
  • Which action brings existing external resources under Terraform management by creating an entry in the state file?
  • What is the correct syntax to define an output in a Terraform module to expose the public IP of an aws_instance named 'web'?
  • Which information does the public Terraform Module Registry automatically expose about published modules?
  • Which practice helps maintain safe concurrent work with Terraform state in a team?
  • Which statement about the .terraform.lock.hcl file is true?
  • Once a new Terraform backend is configured with a Terraform code block, which command(s) is (are) used to migrate the state file?
  • Which is the correct way to pass the value in the variable num_servers into a module with the input servers?
  • A module can always refer to all variables declared in its parent module.
  • To constrain the GitHub provider to version 2.1 or greater in Terraform 0.12 configuration's provider block, which option would you use?
  • To apply changes only to a subset of resources, which approach is appropriate?
  • Open source Terraform can only import publicly-accessible and open-source modules.
  • Terraform requires the Go runtime as a prerequisite for installation.
  • Terraform validate validates that your infrastructure matches the Terraform state file.
  • Which configuration approach allows Terraform to manage resources across more than one provider?
  • During a Terraform apply, what happens to the state file?
  • What is the name assigned by Terraform to reference this resource in the provided example?
  • Terraform providers are always installed from the Internet.
  • Which of the following can you do with terraform plan?
  • Which operation is used to bring an existing resource under Terraform management?
  • The terraform.tfstate file always matches your currently built infrastructure.
  • You cannot install third party plugins using terraform init.
  • In Terraform, module variable assignments are inherited from the parent module and do not need to be explicitly set.
  • What is the proper way to expose a resource attribute from a child module to the root module?
  • Most Terraform providers interact with ______.
  • Which mechanism do Terraform providers primarily use to communicate with cloud services?
  • Which feature allows you to reuse a computed value across multiple resources by defining it once?
  • Which command should you run to preview changes Terraform would apply without applying them?
  • Which Terraform command shows detailed information for a specific resource in the state?
  • What is a key benefit of the Terraform state file?
  • Which option is used to pass variable values to Terraform from the command line?
  • The ______ determines how Terraform creates, updates, or deletes resources.
  • Terraform validate reports syntax check errors from which scenario?
  • What feature prevents multiple admins from changing the Terraform state at the same time?
  • Which backend does the Terraform CLI use by default?
  • Which option is not a safe way to inject sensitive values into a Terraform Cloud workspace?
  • What command does Terraform require the first time you run it within a configuration directory?
  • Moving from local backend to remote backend, which backend would not work?
  • In Terraform configuration, what is the term for the label used to reference a specific resource instance?
  • Which backend feature enables sharing state and applying state operations remotely?
  • When importing existing infrastructure into Terraform, should Terraform configuration be written before performing the import?
  • As a member of an operations team, you are diagnosing a 403 Access Denied error while loading state. What is a recommended first step?
  • A Terraform provisioner must be nested inside a resource configuration block. Which of the following best reflects this statement?
  • Which flag would you add to terraform plan to save the execution plan to a file?
  • What is the primary benefit of using a provisioning pipeline with version control and code reviews?
  • You run a local-exec provisioner in a null resource called null_resource.run_script and realize that you need to rerun the script. Which of the following commands would you use first?
  • Which commands would you use to view the attributes of a resource from the state file?
  • If a resource is tainted, what will Terraform do on the next apply?
  • In the Azure Terraform workflow, which statement about state updates is true?
  • What is the provider for this fictitious resource in the example?
  • What is the effect of tainting a resource in Terraform?
  • When should you use the force-unlock command?
  • Where does the Terraform local backend store its state?
  • Which statement about Terraform's interaction with plan output when applying is correct?
  • Which provisioner invokes a process on the resource created by Terraform?
  • When running terraform taint against a managed resource you want to force recreation upon, Terraform will immediately destroy and recreate the resource.
  • Which action is the primary way to incorporate existing resources into Terraform's state?
  • Which feature of the Terraform Cloud/Terraform Enterprise private module registry helps with version constraints and provides a browsable directory?
  • Terraform can run on Windows or Linux, but it requires a Windows operating system.
  • Which command migrates your current state file to a new S3 remote backend?
  • When should you run terraform init in a new Terraform project?
  • Which of the following is a valid module source reference using Terraform Registry style?
  • Which Terraform command initializes the configuration directory, setting up the backend and modules for subsequent operations?
  • If you have a simple Terraform configuration with one VM and you apply again immediately after a successful apply with no code changes, what will happen?
  • Which command option upgrades provider plugins to the latest permissible version for your configuration?
  • Terraform Enterprise workspaces can trigger plans and applies via what integration?
  • How would you output returned values from a child module?
  • Which of the following is not an action performed by terraform init?
  • Which command can you run to generate DOT formatted data to visualize Terraform dependencies?
  • Which of the following is not a valid Terraform variable type?
  • In a deployment where a race condition caused a user's data script to fail, what is the least disruptive fix?
  • Which command outputs the current value of a named output after applying?
  • Setting the TF_LOG environment variable to DEBUG causes debug messages to be logged into syslog.
  • Which action brings existing external resources under Terraform management by creating an entry in the state file?
  • Which command-line option can be used to provide variable values from a file?
  • What value does the Terraform Cloud/Terraform Enterprise private module registry provide over the public Terraform Module Registry?
  • Which backend does the Terraform CLI use by default?
  • If you apply again after no changes to the configuration, Terraform will:
  • Sentinel policy-as-code is available in Terraform Enterprise.
  • True or False: You can reference a resource created with for_each using a Splat (*) expression.
  • Which method is recommended for supplying sensitive variables to Terraform during automation?
  • Running terraform fmt without any flags will check the formatting of those files without changing their contents.
  • If you update the version constraint in your Terraform configuration, will Terraform update the lock file the next time you run terraform init?
  • Which Terraform collection type should you use to store key/value pairs?
  • Which data source expression correctly references the id of a vsphere_datacenter data source named 'dc'?
  • Which statement describes a configuration where a resource ID is declared more than once?
  • Which Terraform command lists the resources currently tracked in the state file?
  • When does Sentinel enforce policy logic during a Terraform Enterprise run?
  • A Terraform apply cannot _______ infrastructure.
  • How does Terraform determine dependencies between resources?
  • You have declared an input variable called environment in your parent module. What must you do to pass the value to a child module in the configuration?
  • Which Terraform command migrates a workspace to a remote backend after updating your configuration?
  • Are all standard Terraform backends capable of state storage, locking, and remote operations?
  • What does running a terraform plan do?
  • Why will the apply fail when you write a new configuration and immediately run Terraform apply with the local backend?
  • If you want a child module to receive a value from a parent module, what must you declare in the child module?
  • When using a data source for an AWS AMI, which value should be used for the ami argument in a resource?
  • From which sources can Terraform import modules?
  • Which Terraform construct is used to compose configurations and reuse code across deployments?
  • Which statement describes a goal of infrastructure as code?
  • How is the Terraform remote backend different than other state backends such as S3, Consul, etc.?
  • How can Terraform variables be provided to a configuration?
  • Where can Terraform not load a provider from?
  • Where are modules cached in the first initialization of Terraform?
  • Terraform configuration can contain only one provider type.
  • To check if all code in a Terraform configuration with multiple modules is properly formatted without making changes, what command should be run?
  • What is the primary purpose of a Terraform workspace in either open source or enterprise?
  • Which Terraform feature would let you tag multiple resources with a string composed from a generated random_id and a variable without repeating them in each resource?
  • Which command lets you experiment with Terraform's built-in functions?
  • Which command shows what will be deleted when destroying a Terraform configuration, without applying changes?
  • Which of the following is an example of infrastructure as code?
  • Terraform init fetches module sources for referenced modules.
  • Terraform workspaces provide isolation of state by environment, allowing separate state files for different environments within the same configuration.
  • After performing your first terraform apply, changing the backend configuration to a different backend is:
  • Terraform Cloud is available only as a paid offering from HashiCorp.
  • Which command creates an execution plan in Terraform?
  • You have to initialize a Terraform backend before it can be configured.
  • What is the primary purpose of terraform import?
  • Which command initializes a working directory and downloads provider plugins?
  • What is the general syntax to reference a data source attribute in Terraform?
  • Which statement is true about Terraform providers and APIs?
  • Which type of block fetches or computes information for use elsewhere in a Terraform configuration?
  • In Terraform expressions, which option correctly describes the var keyword?
  • How do you specify version 1.0.0 for a module stored on the public Terraform Module Registry within a module block?
  • Which action will prevent two Terraform runs from changing the same state file at the same time?
  • Which concept describes where Terraform stores the state and how it's locked?
  • Define the purpose of state in Terraform.
  • Terraform can only manage resource dependencies if you set them explicitly with the depends_on argument.
  • To install the new provider version in an existing Terraform project, which command should you run?
  • Terraform can import modules from a number of sources; which of the following is not a valid source?
  • Terraform init initializes a sample main.tf file in the current directory.
  • What is a primary benefit of running terraform plan during development?
  • Which method demonstrates infrastructure as code when provisioning resources into a public cloud?
  • Which option prevents sensitive values from appearing in logs or plans?
  • Which of the following is not a valid string function in Terraform?
  • Which statement describes a goal of infrastructure as code?
  • Which statement about Terraform state management in Azure deployments is accurate?
  • You corrected the count variable value and saved your change. What should you do next to apply the changes?
  • Which pattern would follow IaC best practices for making a change to an infrastructure stack running in a public cloud?
  • How would you reference the name value of the second aws_instance.web instance?
  • What does state locking accomplish?
  • Which Terraform variable type is best suited to capture configuration values that include a memory field as a number and a server name as a string?
  • Which Terraform command validates the syntax and configuration without applying changes?
  • Which Terraform feature lets you read information from existing infrastructure without creating or modifying it?
  • Which provider authentication method prevents credentials from being stored in the state file?
  • To deploy resources into two different cloud regions in the same Terraform configuration, you declare multiple provider configurations. What meta-argument do you need to configure in a resource block to deploy the resource to the us-west-2 AWS region?
  • Which provisioner runs commands on the local machine where Terraform is executed during apply?
  • When organizing module sources, which statement best describes a private module registry in Terraform Cloud/Enterprise?
  • Which operation is not performed by terraform apply?
  • Which Terraform command initializes a working directory containing configuration files?
  • How do you specify a module's version when publishing it to the public Terraform Module Registry?
  • What does terraform destroy do?
  • In Terraform 0.12 provider configuration, which keyword controls the version constraint for a provider?
  • Which option would let you define multiple nested blocks inside a VM resource using a variable's values?
  • Which method for sharing Terraform configurations keeps them confidential within your organization, supports Terraform's semantic version constraints, and provides a browsable directory?
  • A provider configuration block is required in every Terraform configuration.
  • Which Terraform command brings existing infrastructure into Terraform state?
  • Define the purpose of state in Terraform.
  • HashiCorp Configuration Language (HCL) supports user-defined functions.
  • You have decided to create a new Terraform workspace to deploy a development environment. What is different about this workspace?
  • Which expression correctly references the ID attribute of a data source named ubuntu with type aws_ami?
  • Which action does not affect the Terraform state?
  • How can you format Terraform HCL code according to standard Terraform style convention?
  • Which module source path does not specify a remote module?
  • Which command displays all workspaces for the current Terraform configuration?
  • All standard backend types support state storage, locking, and remote operations like plan, apply and destroy.
  • A Terraform provider is not responsible for:
  • You're building a CI/CD pipeline and need to inject sensitive variables into your Terraform run. How can you do this safely?
  • Which configuration consistency error does Terraform validate report?
  • Which command checks that all code referencing multiple modules is properly formatted without making changes?
  • Which statement about the Terraform public Module Registry is true?
  • Which detail is included in the public Module Registry exposure that helps users configure modules?
  • Which Terraform command updates provider plugins to the latest acceptable versions?
  • What does a local module source path indicate?
  • In Terraform, what is the name of the output used to expose the VPC ID in the example?
  • Which Terraform feature would help you define multiple data disks as nested blocks inside a VM resource using values from a variable?
  • Which task does terraform init not perform?
  • To bring existing GCP VMs under Terraform management, which action is required?
  • Terraform and Terraform providers must use the same major version number in a single configuration.
  • In the context of remote backends requiring authentication, which approach is advised?
  • What is a typical use-case for a private module registry in Terraform Cloud?
  • Where in Terraform configuration do you declare a state backend?
  • What is the result of importing an existing resource into Terraform state?
  • If there are no outputs defined in your configuration, which method helps you determine a resource's attribute from the state file?
  • What is the default backend when no remote backend is configured in Terraform?
  • All modules published on the official Terraform Module Registry have been verified by HashiCorp.
  • Terraform apply will fail if you have not run a terraform plan first to update the plan output.
  • Which of the following describes a module source path that indicates a module from HashiCorp's registry?
  • What does the file() function do in Terraform?
  • What is the primary role of Terraform providers?
  • What is the most secure place to store secrets for connecting to a Terraform remote backend?
  • How can you trigger a run in a Terraform Cloud workspace that is connected to a Version Control System (VCS) repository?
  • Which Terraform command refreshes the state to align with real infrastructure?
  • Which statement about HCL is true?
  • A Terraform output that sets the "sensitive" argument to true will not store that value in the state file.
  • Which statement about what Terraform fmt does by default is true?
  • Can Open Source Terraform import private modules from private registries?
  • Changing the Terraform backend from the default 'local' backend to a different one after doing your first terraform apply is:
  • Which Terraform feature can expose a locally derived value from a module?
  • Which statement about Terraform apply is true?
  • Using the terraform state rm command against a resource will destroy it.
  • Which outcome is expected when a creation-time provisioner fails?
  • Which feature is not included in Terraform Cloud's free tier?
  • Before you can use Terraform's remote backend, you must first execute terraform init.
  • Is a module version required to reference a Module Registry module?
  • Terraform Enterprise and Cloud Workspaces are conceptually separate working directories from Terraform Open Source.
  • The statement 'A module can always refer to all variables declared in its parent module' is:
  • Which command is used to migrate your Terraform state to a new remote backend as shown?
  • If a local module is specified with source = "./module", what kind of module is this?
  • When should you write Terraform configuration files for existing infrastructure that you want to start managing with Terraform?
  • Which statement about Terraform's approach to infrastructure as code is true?
  • Which statement describes a Terraform module?
  • Which statement about Terraform workspaces is true?
  • If a module declares a variable with a default value, must that variable also be defined within the module?
  • When using multiple configurations of the same Terraform provider, which meta-argument must be included in any non-default provider configurations?
  • What is the primary purpose of terraform validate?
  • What feature stops multiple users from operating on the Terraform state at the same time?
  • A Terraform local value can reference other Terraform local values.
  • Which command should be run in CI/CD to enforce Terraform code formatting standards?
  • When you modify your local Terraform configuration and run terraform plan while a teammate has concurrently modified the infrastructure, the execution plan for terraform apply will be the same.
  • You would like to reuse the same Terraform configuration for development and production with different state files; which command would you use?
  • Which option would log trace-level information about provider loading when debugging Terraform?
  • How can you protect sensitive data stored in Terraform state files?
  • How is Terraform import executed?
  • Which of the following is not an advantage of using infrastructure as code operations?
  • If you delete the VM via the cloud provider console and run Terraform apply again without changing code, what happens?
  • What is the workflow for deploying new infrastructure with Terraform?
  • You are configuring Terraform to use both AWS and Datadog providers. Which approach enables multiple providers in a single configuration?
  • Which is the correct way to pass the value of the variable num_servers into a module input named servers in HCL2?
  • If you run terraform destroy without any flags after applying a configuration that includes a load balancer, what will Terraform do?
  • Do Terraform Cloud and Terraform Enterprise support policy as code (Sentinel)?
  • What is the purpose of the depends_on meta-argument in Terraform?
  • Why does this backend configuration not follow best practices?
  • What is not processed when running a Terraform refresh?
  • Which Terraform feature allows enforcing security controls before changes are applied?
  • Are Terraform variable names stored in the Terraform state file?
  • Which of the following is a typical way to provide variables to Terraform when using multiple providers?
  • A Terraform backend determines how Terraform loads state and stores updates when you execute which operation?
  • Which practice best protects sensitive values in Terraform state files?
  • Which command updates the lock file with provider version constraints?
  • In a Terraform Cloud workspace linked to a version control repository, speculative plan runs start automatically when you merge or commit changes to version control.
  • Which approach best enforces consistent infrastructure configuration by treating deployments as code committed to version control and reviewed before apply?
  • Terraform provisioners can be added to any resource block.
  • Is the public Module Registry free to use?
  • Which argument is required when declaring a Terraform output?
  • What artifact is persisted by the default local backend to track the current state?
  • In Terraform 0.13 and above, outside of the required_providers block, Terraform configurations always refer to providers by their local names.
  • Variables declared within a module are accessible outside of the module.
  • Which command initializes a Terraform working directory and downloads provider plugins?
  • Which method could you use to identify which VM instance Terraform manages if you found two servers with the same name outside Terraform?
  • You must use different Terraform commands depending on the cloud provider you use.
  • Which command adds existing resources to the Terraform state?
  • Which approach helps prevent exposure of sensitive data in Terraform state when using a remote backend?
  • What does terraform refresh modify?
  • Which is the safest way to inject sensitive values into a Terraform Cloud workspace?
  • What is the primary purpose of a Terraform module?
  • Which command displays the values of Terraform outputs defined in the configuration?
  • Which of the following is not true of Terraform providers?
  • What does the default 'local' Terraform backend store?
  • Which IaC principle emphasizes reproducibility and consistency in operations?
  • Which Terraform command lets you view all attributes and details of a managed resource?
  • For a resource that uses a named provider configuration, which option shows the correct syntax to reference the named provider?
  • Which environment variable must be configured to make Terraform's logging more verbose?
  • Which expression references the name of the first aws_instance.web in Terraform?
  • If you want to replace a VM created by Terraform with an identical one without affecting a database, which approach is best?
  • To move a resource in state from one name to another without recreating it, which command should you use?
  • Which function would you use to join strings in Terraform?
  • Which statement best describes the use of terraform taint?
  • What is the purpose of the .terraform.lock.hcl file?
  • To share Terraform state with your team, store it securely, and provide state locking, which backend configuration would you choose?
  • Which command will show all resources that would be deleted if you proceed with destruction?
  • In Terraform HCL, an object type defined as object({ name = string, age = number }) would match which value?
  • Which statement about Terraform code indentation is correct?
  • Which statement about Terraform modules and nesting is true?
  • Which is not a benefit of adopting infrastructure as code?
  • Which command would bring existing infrastructure under Terraform management?
  • What is the name assigned by Terraform to reference this resource? (Example in the configuration)
  • Terraform init retrieves the source code for all referenced modules.
  • Which statement about state backends is true?
  • Infrastructure as Code (IaC) can be stored in a version control system along with application code.
  • Which of the following is not a valid source path for specifying a module?
  • How would you reference the attribute "name" of this fictitious resource in HCL?
  • In a scenario where an external change is made to a resource managed by Terraform, what happens when you run terraform apply?
  • Select the command that doesn't cause Terraform to refresh its state.
  • Do the Terraform binary version and provider versions need to match in a single configuration?
  • What is true about the Terraform state file?
  • Which of the following is not a valid Terraform collection type?
  • Which action statement best describes how Terraform Cloud runs are triggered in a VCS-connected workspace?
  • Must you initialize your working directory before running terraform validate?
Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy