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 course image
More practice questions

These questions are part of the practice quiz. Start practicing

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

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy