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
All questions

These questions are part of the practice quiz. Start practicing

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

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy