HashiCorp Terraform Associate 004 (HashiCorp Certified: Terraform Associate (004)) Practice Test 69

Question 680

A Terraform operator is specifically tasked to fetch a newly allowed version after editing the module version requirement. Which mechanism most directly meets this particular need?

  1. Registry module version constraint
  2. Version of Git module
  3. Local module development lifecycle
  4. Module upgrade through init

Explanation

Correct Answer

D:

The task is to fetch a newly allowed version after editing the module version requirement; Module upgrade through init directly supports that requirement: Rerunning terraform init downloads compatible module source versions when module requirements change. Its relevant boundary is: terraform apply does not automatically fetch newly declared module packages.

Incorrect Answers

A:

Registry module version constraint is designed to select module releases meeting a declared compatibility range, whereas this task is to fetch a newly allowed version after editing the module version requirement: A registry module call accepts a version argument that chooses supported release versions. Against Module upgrade through init, its limitation is: An unpinned module version may drift as newer releases appear.

B:

Version of Git module is designed to pin a VCS module using its source ref rather than registry version, whereas this task is to fetch a newly allowed version after editing the module version requirement: A ?ref=tag or commit in a Git module source selects the VCS revision to fetch. Against Module upgrade through init, its limitation is: The registry module version argument does not apply to generic Git sources.

C:

Local module development lifecycle addresses the different requirement to update a local path module without applying registry release versioning: Local module source code is read from its path and does not use a version argument; this does not by itself satisfy the requested task to fetch a newly allowed version after editing the module version requirement. For the stated need, Module upgrade through init is the more direct mechanism.

Question 681

A team is adjusting its declarative infrastructure process to route CLI-driven operations to the intended HCP workspace. Which mechanism most directly meets this particular need?

  1. CLI-driven HCP runs
  2. HCP Terraform workspace variable configuration
  3. HCP Terraform workspace selection
  4. HCP Terraform workspace version settings

Explanation

Correct Answer

C:

The task is to route CLI-driven operations to the intended HCP workspace; HCP Terraform workspace selection directly supports that requirement: The cloud block workspace settings determine which HCP workspace the configuration uses. Its relevant boundary is: Selecting the wrong workspace can target a different infrastructure state.

Incorrect Answers

A:

CLI-driven HCP runs is designed to initiate workspace operations through familiar Terraform commands, whereas this task is to route CLI-driven operations to the intended HCP workspace: HCP Terraform supports CLI-driven workflows connected to remote workspace state and operations. Against HCP Terraform workspace selection, its limitation is: Actual execution behavior depends on the workspace and integration settings.

B:

HCP Terraform workspace variable configuration is designed to provide Terraform and environment variables to a hosted run, whereas this task is to route CLI-driven operations to the intended HCP workspace: Workspace variables and variable sets can supply inputs or environment settings to HCP Terraform operations. Against HCP Terraform workspace selection, its limitation is: Sensitive values should be marked appropriately and access limited.

D:

HCP Terraform workspace version settings is designed to control the Terraform version used for remote runs, whereas this task is to route CLI-driven operations to the intended HCP workspace: Workspace settings can select the Terraform Core version used in HCP remote execution. Against HCP Terraform workspace selection, its limitation is: Provider version constraints remain a separate configuration concern.

Question 682

During an implementation review, a Terraform team encounters "TF_LOG_PATH environment variable". Which purpose is associated with that mechanism?

  1. enable Terraform debugging output while investigating a CLI failure
  2. write Terraform debug logging to a named file
  3. focus debugging on Terraform Core behavior rather than provider messages
  4. focus verbose diagnostics on provider-side activity

Explanation

Correct Answer

B:

The practical result of TF_LOG_PATH environment variable, used to write Terraform debug logging to a named file, is: TF_LOG_PATH controls a file destination for Terraform logging when logging is enabled. A qualification for this effect is: Setting a log path alone does not necessarily enable logging.

Incorrect Answers

A:

That outcome applies to TF_LOG environment variable, intended to enable Terraform debugging output while investigating a CLI failure, rather than the question's feature TF_LOG_PATH environment variable: TF_LOG sets a supported logging level such as DEBUG or TRACE for a Terraform process. Unlike TF_LOG environment variable, TF_LOG_PATH environment variable is intended to write Terraform debug logging to a named file, not to enable Terraform debugging output while investigating a CLI failure.

C:

That outcome applies to TF_LOG_CORE environment variable, intended to focus debugging on Terraform Core behavior rather than provider messages, rather than the question's feature TF_LOG_PATH environment variable: TF_LOG_CORE can set logging for Terraform Core separately from provider plugin output. Unlike TF_LOG_CORE environment variable, TF_LOG_PATH environment variable is intended to write Terraform debug logging to a named file, not to focus debugging on Terraform Core behavior rather than provider messages.

D:

That outcome applies to TF_LOG_PROVIDER environment variable, intended to focus verbose diagnostics on provider-side activity, rather than the question's feature TF_LOG_PATH environment variable: TF_LOG_PROVIDER controls the provider logging level to aid plugin or API troubleshooting. Unlike TF_LOG_PROVIDER environment variable, TF_LOG_PATH environment variable is intended to write Terraform debug logging to a named file, not to focus verbose diagnostics on provider-side activity.

Question 683

A Terraform operator is specifically tasked to embed evaluated expressions in a Terraform string. Which mechanism most directly meets this particular need?

  1. Template interpolation
  2. Built-in collection function
  3. Conditional expression
  4. for expression list projection
  5. Dynamic nested block

Explanation

Correct Answer

A:

The task is to embed evaluated expressions in a Terraform string; Template interpolation directly supports that requirement: The ${...} syntax can interpolate an expression into a quoted string or template. Its relevant boundary is: Interpolation is not required when an argument can take a direct expression reference.

Incorrect Answers

B:

Built-in collection function is designed to calculate collection values without an external provisioner, whereas this task is to embed evaluated expressions in a Terraform string: Functions such as length, concat, and merge manipulate Terraform values during expression evaluation. Against Template interpolation, its limitation is: A function call does not fetch remote provider resources unless a data source is used.

C:

Conditional expression is designed to choose between two values based on a boolean condition, whereas this task is to embed evaluated expressions in a Terraform string: Terraform's condition ? true_value : false_value expression selects a value based on a predicate. Against Template interpolation, its limitation is: The two branches need compatible types for Terraform to reconcile the result.

D:

for expression list projection is designed to transform a collection into a list of calculated values, whereas this task is to embed evaluated expressions in a Terraform string: A bracketed for expression maps each element to a new value using a declared iterator. Against Template interpolation, its limitation is: A for expression calculates values but does not itself create resource instances.

E:

Dynamic nested block addresses the different requirement to generate repeated nested configuration blocks from a collection: A dynamic block emits nested blocks where the enclosing resource schema permits them; this does not by itself satisfy the requested task to embed evaluated expressions in a Terraform string. For the stated need, Template interpolation is the more direct mechanism.

Question 684

A team reviews the use of Targeted planning in Terraform 1.12. Which purpose matches its actual behavior?

  1. avoid remote refresh reads when an intentional troubleshooting constraint requires it
  2. recognize that a proposed change will replace an existing resource
  3. convert a saved plan into JSON for automated analysis
  4. focus on a small subset for exceptional repair or troubleshooting

Explanation

Correct Answer

D:

The practical result of Targeted planning, used to focus on a small subset for exceptional repair or troubleshooting, is: terraform plan -target=ADDRESS limits the planner's focus to the selected graph portion. A qualification for this effect is: Routine targeted planning can overlook intended changes elsewhere.

Incorrect Answers

A:

That outcome applies to Plan without state refresh, intended to avoid remote refresh reads when an intentional troubleshooting constraint requires it, rather than the question's feature Targeted planning: terraform plan -refresh=false uses existing state without refreshing live objects before planning. Unlike Plan without state refresh, Targeted planning is intended to focus on a small subset for exceptional repair or troubleshooting, not to avoid remote refresh reads when an intentional troubleshooting constraint requires it.

B:

That outcome applies to Replacement plan indicator, intended to recognize that a proposed change will replace an existing resource, rather than the question's feature Targeted planning: The plan symbols -/+ or +/- indicate replacement behavior and its creation/destruction ordering. Unlike Replacement plan indicator, Targeted planning is intended to focus on a small subset for exceptional repair or troubleshooting, not to recognize that a proposed change will replace an existing resource.

C:

That outcome applies to Machine-readable plan inspection, intended to convert a saved plan into JSON for automated analysis, rather than the question's feature Targeted planning: terraform show -json change.tfplan exposes plan details for tooling. Unlike Machine-readable plan inspection, Targeted planning is intended to focus on a small subset for exceptional repair or troubleshooting, not to convert a saved plan into JSON for automated analysis.

Question 685

The team is documenting risks of Resource provider meta-argument while planning to direct an individual resource to the intended aliased provider. Which caveat specifically applies to that mechanism?

  1. The existence of an alias does not move existing resources to that configuration automatically.
  2. A default provider does not infer a resource's desired region from its name.
  3. A provider alias is not a separate package with its own source address.
  4. Aliases and complex configurations often require explicit mapping.
  5. The alias must be declared and satisfy provider requirements.

Explanation

Correct Answer

E:

For Resource provider meta-argument in the task to direct an individual resource to the intended aliased provider, the important caution is: The alias must be declared and satisfy provider requirements. The reason this matters is its actual behavior: The provider meta-argument can select a configured instance such as aws.west for that resource.

Incorrect Answers

A:

The proposed warning belongs to Aliased provider instance, which serves the different goal to configure a second instance of the same provider for another account or region, rather than to Resource provider meta-argument: The alias argument gives a provider configuration an additional address that resources can select. The question concerns Resource provider meta-argument acting to direct an individual resource to the intended aliased provider, not a limit of Aliased provider instance.

B:

The proposed warning belongs to Multiple regions in one configuration, which serves the different goal to create similar resources in different regions without duplicating the root module, rather than to Resource provider meta-argument: Two provider instances with different region settings can serve explicitly assigned resources or modules. The question concerns Resource provider meta-argument acting to direct an individual resource to the intended aliased provider, not a limit of Multiple regions in one configuration.

C:

The proposed warning belongs to Provider alias reference address, which serves the different goal to refer to a provider configuration by its local name and alias, rather than to Resource provider meta-argument: An address such as aws.audit identifies a specific configured instance of the aws provider. The question concerns Resource provider meta-argument acting to direct an individual resource to the intended aliased provider, not a limit of Provider alias reference address.

D:

The proposed warning belongs to Default provider configuration inheritance, which serves the different goal to let a child module use default provider settings from its parent, rather than to Resource provider meta-argument: Child modules commonly inherit default provider configurations from the calling module. The question concerns Resource provider meta-argument acting to direct an individual resource to the intended aliased provider, not a limit of Default provider configuration inheritance.

Question 686

A configuration walkthrough identifies "moved block for refactoring". Which task is it principally intended to support?

  1. recognize that a resource was changed outside Terraform
  2. accept an external change into Terraform state without modifying remote infrastructure
  3. rename a managed resource address without destroying its remote object
  4. detach a resource address from state while leaving the remote object intact

Explanation

Correct Answer

C:

The practical result of moved block for refactoring, used to rename a managed resource address without destroying its remote object, is: A moved block describes an address migration as part of configuration history. A qualification for this effect is: It does not transfer a resource between unrelated provider types.

Incorrect Answers

A:

That outcome applies to Remote drift detection during plan, intended to recognize that a resource was changed outside Terraform, rather than the question's feature moved block for refactoring: Normal plan refresh reads can reveal drift between state and the remote object. Unlike Remote drift detection during plan, moved block for refactoring is intended to rename a managed resource address without destroying its remote object, not to recognize that a resource was changed outside Terraform.

B:

That outcome applies to Refresh-only reconciliation, intended to accept an external change into Terraform state without modifying remote infrastructure, rather than the question's feature moved block for refactoring: A refresh-only plan or apply updates state and outputs to observed values. Unlike Refresh-only reconciliation, moved block for refactoring is intended to rename a managed resource address without destroying its remote object, not to accept an external change into Terraform state without modifying remote infrastructure.

D:

The outcome in this option belongs to terraform state rm: state rm forgets the binding but does not delete the real infrastructure object; by contrast, the feature actually named in the stem, moved block for refactoring, has a distinct purpose: to rename a managed resource address without destroying its remote object.

Question 687

During an implementation review, a Terraform team encounters "Module upgrade through init". Which purpose is associated with that mechanism?

  1. pin a VCS module using its source ref rather than registry version
  2. make a published module dependency deterministic across clean installs
  3. fetch a newly allowed version after editing the module version requirement
  4. update a local path module without applying registry release versioning

Explanation

Correct Answer

C:

The practical result of Module upgrade through init, used to fetch a newly allowed version after editing the module version requirement, is: Rerunning terraform init downloads compatible module source versions when module requirements change. A qualification for this effect is: terraform apply does not automatically fetch newly declared module packages.

Incorrect Answers

A:

That outcome applies to Version of Git module, intended to pin a VCS module using its source ref rather than registry version, rather than the question's feature Module upgrade through init: A ?ref=tag or commit in a Git module source selects the VCS revision to fetch. Unlike Version of Git module, Module upgrade through init is intended to fetch a newly allowed version after editing the module version requirement, not to pin a VCS module using its source ref rather than registry version.

B:

That outcome applies to Exact registry module version, intended to make a published module dependency deterministic across clean installs, rather than the question's feature Module upgrade through init: An exact version requirement identifies one registry module release. Unlike Exact registry module version, Module upgrade through init is intended to fetch a newly allowed version after editing the module version requirement, not to make a published module dependency deterministic across clean installs.

D:

The outcome in this option belongs to Local module development lifecycle: Local module source code is read from its path and does not use a version argument; by contrast, the feature actually named in the stem, Module upgrade through init, has a distinct purpose: to fetch a newly allowed version after editing the module version requirement.

Question 688

A Terraform runbook describes the mechanism "HCP Terraform workspace selection". Which responsibility should a reviewer associate with it?

  1. route CLI-driven operations to the intended HCP workspace
  2. initiate workspace operations through familiar Terraform commands
  3. control the Terraform version used for remote runs
  4. provide Terraform and environment variables to a hosted run

Explanation

Correct Answer

A:

The practical result of HCP Terraform workspace selection, used to route CLI-driven operations to the intended HCP workspace, is: The cloud block workspace settings determine which HCP workspace the configuration uses. A qualification for this effect is: Selecting the wrong workspace can target a different infrastructure state.

Incorrect Answers

B:

That outcome applies to CLI-driven HCP runs, intended to initiate workspace operations through familiar Terraform commands, rather than the question's feature HCP Terraform workspace selection: HCP Terraform supports CLI-driven workflows connected to remote workspace state and operations. Unlike CLI-driven HCP runs, HCP Terraform workspace selection is intended to route CLI-driven operations to the intended HCP workspace, not to initiate workspace operations through familiar Terraform commands.

C:

That outcome applies to HCP Terraform workspace version settings, intended to control the Terraform version used for remote runs, rather than the question's feature HCP Terraform workspace selection: Workspace settings can select the Terraform Core version used in HCP remote execution. Unlike HCP Terraform workspace version settings, HCP Terraform workspace selection is intended to route CLI-driven operations to the intended HCP workspace, not to control the Terraform version used for remote runs.

D:

That outcome applies to HCP Terraform workspace variable configuration, intended to provide Terraform and environment variables to a hosted run, rather than the question's feature HCP Terraform workspace selection: Workspace variables and variable sets can supply inputs or environment settings to HCP Terraform operations. Unlike HCP Terraform workspace variable configuration, HCP Terraform workspace selection is intended to route CLI-driven operations to the intended HCP workspace, not to provide Terraform and environment variables to a hosted run.

Question 689

During an implementation review, a Terraform team encounters "Template interpolation". Which purpose is associated with that mechanism?

  1. calculate collection values without an external provisioner
  2. choose between two values based on a boolean condition
  3. include only elements satisfying an if condition in a derived collection
  4. transform a collection into a list of calculated values
  5. embed evaluated expressions in a Terraform string

Explanation

Correct Answer

E:

The practical result of Template interpolation, used to embed evaluated expressions in a Terraform string, is: The ${...} syntax can interpolate an expression into a quoted string or template. A qualification for this effect is: Interpolation is not required when an argument can take a direct expression reference.

Incorrect Answers

A:

That outcome applies to Built-in collection function, intended to calculate collection values without an external provisioner, rather than the question's feature Template interpolation: Functions such as length, concat, and merge manipulate Terraform values during expression evaluation. Unlike Built-in collection function, Template interpolation is intended to embed evaluated expressions in a Terraform string, not to calculate collection values without an external provisioner.

B:

That outcome applies to Conditional expression, intended to choose between two values based on a boolean condition, rather than the question's feature Template interpolation: Terraform's condition ? true_value : false_value expression selects a value based on a predicate. Unlike Conditional expression, Template interpolation is intended to embed evaluated expressions in a Terraform string, not to choose between two values based on a boolean condition.

C:

That outcome applies to for expression filtering, intended to include only elements satisfying an if condition in a derived collection, rather than the question's feature Template interpolation: A for expression's optional if clause filters elements while projecting results. Unlike for expression filtering, Template interpolation is intended to embed evaluated expressions in a Terraform string, not to include only elements satisfying an if condition in a derived collection.

D:

That outcome applies to for expression list projection, intended to transform a collection into a list of calculated values, rather than the question's feature Template interpolation: A bracketed for expression maps each element to a new value using a declared iterator. Unlike for expression list projection, Template interpolation is intended to embed evaluated expressions in a Terraform string, not to transform a collection into a list of calculated values.

Question 690

A change proposal relies on Hybrid infrastructure automation for the task to configure cloud and on-premises platforms through a common workflow. Which limitation specifically applies to it?

  1. An appropriate provider or integration must exist for each target system.
  2. Each provider still needs suitable credentials and service permissions.
  3. A resource type from one provider cannot be substituted blindly for another.
  4. Service-agnostic does not mean resource schemas are interchangeable.

Explanation

Correct Answer

A:

For Hybrid infrastructure automation in the task to configure cloud and on-premises platforms through a common workflow, the important caution is: An appropriate provider or integration must exist for each target system. The reason this matters is its actual behavior: Terraform can coordinate providers for hosted services and private infrastructure without imposing one cloud API.

Incorrect Answers

B:

The proposed warning belongs to Multi-cloud provider configuration, which serves the different goal to manage different clouds from one Terraform root module, rather than to Hybrid infrastructure automation: Separate provider plugins can reconcile resources on multiple platforms within the same configuration. The question concerns Hybrid infrastructure automation acting to configure cloud and on-premises platforms through a common workflow, not a limit of Multi-cloud provider configuration.

C:

The proposed warning belongs to Provider-specific implementation, which serves the different goal to use a common language without pretending providers expose identical capabilities, rather than to Hybrid infrastructure automation: HCL and workflow are common while each provider defines its own resource schema and service-specific behavior. The question concerns Hybrid infrastructure automation acting to configure cloud and on-premises platforms through a common workflow, not a limit of Provider-specific implementation.

D:

The proposed warning belongs to Service-agnostic orchestration, which serves the different goal to control DNS, SaaS, and cloud resources through a common configuration tool, rather than to Hybrid infrastructure automation: Terraform providers expose resource and data types beyond infrastructure hosted by a cloud vendor. The question concerns Hybrid infrastructure automation acting to configure cloud and on-premises platforms through a common workflow, not a limit of Service-agnostic orchestration.

HashiCorp Certified: Terraform Associate (004) (Terraform Associate 004) Practice Tests