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

Question 750

A design uses Plan without state refresh to avoid remote refresh reads when an intentional troubleshooting constraint requires it. Which qualification applies to the named mechanism?

  1. The JSON can expose secrets and requires secure handling.
  2. It does not use configuration to correct drift in the remote service.
  3. A plan based on stale state can be inaccurate about real infrastructure.
  4. Plan does not persist the proposed changes to remote infrastructure.
  5. An in-place update is represented differently and preserves the existing instance.

Explanation

Correct Answer

C:

For Plan without state refresh in the task to avoid remote refresh reads when an intentional troubleshooting constraint requires it, the important caution is: A plan based on stale state can be inaccurate about real infrastructure. The reason this matters is its actual behavior: terraform plan -refresh=false uses existing state without refreshing live objects before planning.

Incorrect Answers

A:

The proposed warning belongs to Machine-readable plan inspection, which serves the different goal to convert a saved plan into JSON for automated analysis, rather than to Plan without state refresh: terraform show -json change.tfplan exposes plan details for tooling. The question concerns Plan without state refresh acting to avoid remote refresh reads when an intentional troubleshooting constraint requires it, not a limit of Machine-readable plan inspection.

B:

The proposed warning belongs to Refresh-only planning, which serves the different goal to inspect externally changed infrastructure without planning configuration reconciliation, rather than to Plan without state refresh: terraform plan -refresh-only proposes updates to state and outputs based on remote observations. The question concerns Plan without state refresh acting to avoid remote refresh reads when an intentional troubleshooting constraint requires it, not a limit of Refresh-only planning.

D:

The proposed warning belongs to terraform plan command, which serves the different goal to preview actions required to reach the declared infrastructure state, rather than to Plan without state refresh: terraform plan shows changes Terraform expects, including creates, updates, deletes, and replacements. The question concerns Plan without state refresh acting to avoid remote refresh reads when an intentional troubleshooting constraint requires it, not a limit of terraform plan command.

E:

The proposed warning belongs to Replacement plan indicator, which serves the different goal to recognize that a proposed change will replace an existing resource, rather than to Plan without state refresh: The plan symbols -/+ or +/- indicate replacement behavior and its creation/destruction ordering. The question concerns Plan without state refresh acting to avoid remote refresh reads when an intentional troubleshooting constraint requires it, not a limit of Replacement plan indicator.

Question 751

A team is adjusting its declarative infrastructure process to pass an aliased provider to resources inside a child module. Which mechanism most directly meets this particular need?

  1. Explicit child module provider mapping
  2. Provider alias reference address
  3. Multiple regions in one configuration
  4. Default provider configuration inheritance

Explanation

Correct Answer

A:

The task is to pass an aliased provider to resources inside a child module; Explicit child module provider mapping directly supports that requirement: The providers map in a module block maps the child's provider name to a parent provider configuration. Its relevant boundary is: A child module cannot automatically see every parent alias just because it exists.

Incorrect Answers

B:

Provider alias reference address is designed to refer to a provider configuration by its local name and alias, whereas this task is to pass an aliased provider to resources inside a child module: An address such as aws.audit identifies a specific configured instance of the aws provider. Against Explicit child module provider mapping, its limitation is: A provider alias is not a separate package with its own source address.

C:

Multiple regions in one configuration is designed to create similar resources in different regions without duplicating the root module, whereas this task is to pass an aliased provider to resources inside a child module: Two provider instances with different region settings can serve explicitly assigned resources or modules. Against Explicit child module provider mapping, its limitation is: A default provider does not infer a resource's desired region from its name.

D:

Default provider configuration inheritance is designed to let a child module use default provider settings from its parent, whereas this task is to pass an aliased provider to resources inside a child module: Child modules commonly inherit default provider configurations from the calling module. Against Explicit child module provider mapping, its limitation is: Aliases and complex configurations often require explicit mapping.

Question 752

Before adopting terraform state rm to detach a resource address from state while leaving the remote object intact, which statement sets an accurate boundary?

  1. Configuration reconciliation requires a subsequent reviewed apply.
  2. It does not make the live object conform to an old configuration value.
  3. If its configuration remains, a later plan can propose creating another object.
  4. It does not transfer a resource between unrelated provider types.

Explanation

Correct Answer

C:

For terraform state rm in the task to detach a resource address from state while leaving the remote object intact, the important caution is: If its configuration remains, a later plan can propose creating another object. The reason this matters is its actual behavior: state rm forgets the binding but does not delete the real infrastructure object.

Incorrect Answers

A:

The proposed warning belongs to Remote drift detection during plan, which serves the different goal to recognize that a resource was changed outside Terraform, rather than to terraform state rm: Normal plan refresh reads can reveal drift between state and the remote object. The question concerns terraform state rm acting to detach a resource address from state while leaving the remote object intact, not a limit of Remote drift detection during plan.

B:

The proposed warning belongs to Refresh-only reconciliation, which serves the different goal to accept an external change into Terraform state without modifying remote infrastructure, rather than to terraform state rm: A refresh-only plan or apply updates state and outputs to observed values. The question concerns terraform state rm acting to detach a resource address from state while leaving the remote object intact, not a limit of Refresh-only reconciliation.

D:

The proposed warning belongs to moved block for refactoring, which serves the different goal to rename a managed resource address without destroying its remote object, rather than to terraform state rm: A moved block describes an address migration as part of configuration history. The question concerns terraform state rm acting to detach a resource address from state while leaving the remote object intact, not a limit of moved block for refactoring.

Question 753

A design uses Local module development lifecycle to update a local path module without applying registry release versioning. Which qualification applies to the named mechanism?

  1. A local edit can still change the next plan and should be reviewed.
  2. The registry module version argument does not apply to generic Git sources.
  3. terraform apply does not automatically fetch newly declared module packages.
  4. Pinning a module does not pin its provider dependencies unless constrained separately.
  5. An unpinned module version may drift as newer releases appear.

Explanation

Correct Answer

A:

For Local module development lifecycle in the task to update a local path module without applying registry release versioning, the important caution is: A local edit can still change the next plan and should be reviewed. The reason this matters is its actual behavior: Local module source code is read from its path and does not use a version argument.

Incorrect Answers

B:

The proposed warning belongs to Version of Git module, which serves the different goal to pin a VCS module using its source ref rather than registry version, rather than to Local module development lifecycle: A ?ref=tag or commit in a Git module source selects the VCS revision to fetch. The question concerns Local module development lifecycle acting to update a local path module without applying registry release versioning, not a limit of Version of Git module.

C:

The proposed warning belongs to Module upgrade through init, which serves the different goal to fetch a newly allowed version after editing the module version requirement, rather than to Local module development lifecycle: Rerunning terraform init downloads compatible module source versions when module requirements change. The question concerns Local module development lifecycle acting to update a local path module without applying registry release versioning, not a limit of Module upgrade through init.

D:

The proposed warning belongs to Exact registry module version, which serves the different goal to make a published module dependency deterministic across clean installs, rather than to Local module development lifecycle: An exact version requirement identifies one registry module release. The question concerns Local module development lifecycle acting to update a local path module without applying registry release versioning, not a limit of Exact registry module version.

E:

The proposed warning belongs to Registry module version constraint, which serves the different goal to select module releases meeting a declared compatibility range, rather than to Local module development lifecycle: A registry module call accepts a version argument that chooses supported release versions. The question concerns Local module development lifecycle acting to update a local path module without applying registry release versioning, not a limit of Registry module version constraint.

Question 754

The team is documenting risks of CLI-driven HCP runs while planning to initiate workspace operations through familiar Terraform commands. Which caveat specifically applies to that mechanism?

  1. Provider version constraints remain a separate configuration concern.
  2. Actual execution behavior depends on the workspace and integration settings.
  3. A CLI token is not a cloud provider's deployment credential.
  4. A migration should be backed up and verified before discarding the local copy.
  5. Sensitive values should be marked appropriately and access limited.

Explanation

Correct Answer

B:

For CLI-driven HCP runs in the task to initiate workspace operations through familiar Terraform commands, the important caution is: Actual execution behavior depends on the workspace and integration settings. The reason this matters is its actual behavior: HCP Terraform supports CLI-driven workflows connected to remote workspace state and operations.

Incorrect Answers

A:

The proposed warning belongs to HCP Terraform workspace version settings, which serves the different goal to control the Terraform version used for remote runs, rather than to CLI-driven HCP runs: Workspace settings can select the Terraform Core version used in HCP remote execution. The question concerns CLI-driven HCP runs acting to initiate workspace operations through familiar Terraform commands, not a limit of HCP Terraform workspace version settings.

C:

The proposed warning belongs to Terraform CLI login to HCP, which serves the different goal to authenticate local Terraform CLI operations against HCP Terraform, rather than to CLI-driven HCP runs: terraform login starts an authentication workflow and stores a token for HCP Terraform access. The question concerns CLI-driven HCP runs acting to initiate workspace operations through familiar Terraform commands, not a limit of Terraform CLI login to HCP.

D:

The proposed warning belongs to Local to HCP state migration, which serves the different goal to move a locally managed state history into an HCP Terraform workspace, rather than to CLI-driven HCP runs: Changing state integration and reinitializing can migrate state into HCP Terraform when configured correctly. The question concerns CLI-driven HCP runs acting to initiate workspace operations through familiar Terraform commands, not a limit of Local to HCP state migration.

E:

The proposed warning belongs to HCP Terraform workspace variable configuration, which serves the different goal to provide Terraform and environment variables to a hosted run, rather than to CLI-driven HCP runs: Workspace variables and variable sets can supply inputs or environment settings to HCP Terraform operations. The question concerns CLI-driven HCP runs acting to initiate workspace operations through familiar Terraform commands, not a limit of HCP Terraform workspace variable configuration.

Question 755

A team reviews the use of for_each resource replication in Terraform 1.12. Which purpose matches its actual behavior?

  1. embed evaluated expressions in a Terraform string
  2. create one resource instance per unique map or set key
  3. calculate collection values without an external provisioner
  4. generate repeated nested configuration blocks from a collection

Explanation

Correct Answer

B:

The practical result of for_each resource replication, used to create one resource instance per unique map or set key, is: for_each expands a resource into stable keyed instances when its collection is known at planning. A qualification for this effect is: Keys cannot be unknown or derived directly from sensitive values.

Incorrect Answers

A:

That outcome applies to Template interpolation, intended to embed evaluated expressions in a Terraform string, rather than the question's feature for_each resource replication: The ${...} syntax can interpolate an expression into a quoted string or template. Unlike Template interpolation, for_each resource replication is intended to create one resource instance per unique map or set key, not to embed evaluated expressions in a Terraform string.

C:

That outcome applies to Built-in collection function, intended to calculate collection values without an external provisioner, rather than the question's feature for_each resource replication: Functions such as length, concat, and merge manipulate Terraform values during expression evaluation. Unlike Built-in collection function, for_each resource replication is intended to create one resource instance per unique map or set key, not to calculate collection values without an external provisioner.

D:

That outcome applies to Dynamic nested block, intended to generate repeated nested configuration blocks from a collection, rather than the question's feature for_each resource replication: A dynamic block emits nested blocks where the enclosing resource schema permits them. Unlike Dynamic nested block, for_each resource replication is intended to create one resource instance per unique map or set key, not to generate repeated nested configuration blocks from a collection.

Question 756

For a new infrastructure repository, the team wants to use a common language without pretending providers expose identical capabilities. Which mechanism most directly meets this particular need?

  1. Provider-specific implementation
  2. Service-agnostic orchestration
  3. Hybrid infrastructure automation
  4. Cross-platform dependency references
  5. Vendor portability through modules

Explanation

Correct Answer

A:

The task is to use a common language without pretending providers expose identical capabilities; Provider-specific implementation directly supports that requirement: HCL and workflow are common while each provider defines its own resource schema and service-specific behavior. Its relevant boundary is: A resource type from one provider cannot be substituted blindly for another.

Incorrect Answers

B:

Service-agnostic orchestration is designed to control DNS, SaaS, and cloud resources through a common configuration tool, whereas this task is to use a common language without pretending providers expose identical capabilities: Terraform providers expose resource and data types beyond infrastructure hosted by a cloud vendor. Against Provider-specific implementation, its limitation is: Service-agnostic does not mean resource schemas are interchangeable.

C:

Hybrid infrastructure automation is designed to configure cloud and on-premises platforms through a common workflow, whereas this task is to use a common language without pretending providers expose identical capabilities: Terraform can coordinate providers for hosted services and private infrastructure without imposing one cloud API. Against Provider-specific implementation, its limitation is: An appropriate provider or integration must exist for each target system.

D:

Cross-platform dependency references is designed to use output from one service to configure another supported service, whereas this task is to use a common language without pretending providers expose identical capabilities: References can establish ordering when a resource on one platform consumes attributes from another resource. Against Provider-specific implementation, its limitation is: The dependency does not remove authentication or network prerequisites on either platform.

E:

Vendor portability through modules addresses the different requirement to abstract a deployment pattern while keeping provider details explicit: A module can offer common input and output conventions even if its implementation uses provider-specific resources; this does not by itself satisfy the requested task to use a common language without pretending providers expose identical capabilities. For the stated need, Provider-specific implementation is the more direct mechanism.

Question 757

A platform engineering group needs to focus verbose diagnostics on provider-side activity. Which mechanism most directly meets this particular need?

  1. TF_LOG_PATH environment variable
  2. TRACE diagnostic level
  3. TF_LOG_PROVIDER environment variable
  4. TF_LOG_CORE environment variable
  5. Disable debug logging after diagnosis

Explanation

Correct Answer

C:

The task is to focus verbose diagnostics on provider-side activity; TF_LOG_PROVIDER environment variable directly supports that requirement: TF_LOG_PROVIDER controls the provider logging level to aid plugin or API troubleshooting. Its relevant boundary is: Provider logs may reveal credentials or request data and require caution.

Incorrect Answers

A:

TF_LOG_PATH environment variable is designed to write Terraform debug logging to a named file, whereas this task is to focus verbose diagnostics on provider-side activity: TF_LOG_PATH controls a file destination for Terraform logging when logging is enabled. Against TF_LOG_PROVIDER environment variable, its limitation is: Setting a log path alone does not necessarily enable logging.

B:

TRACE diagnostic level is designed to capture highly detailed events for a stubborn Terraform problem, whereas this task is to focus verbose diagnostics on provider-side activity: TRACE is a very verbose Terraform logging level useful for deep troubleshooting. Against TF_LOG_PROVIDER environment variable, its limitation is: It is too noisy and potentially sensitive for routine production pipelines.

D:

TF_LOG_CORE environment variable is designed to focus debugging on Terraform Core behavior rather than provider messages, whereas this task is to focus verbose diagnostics on provider-side activity: TF_LOG_CORE can set logging for Terraform Core separately from provider plugin output. Against TF_LOG_PROVIDER environment variable, its limitation is: Core logging does not substitute for investigating remote API authorization errors.

E:

Disable debug logging after diagnosis addresses the different requirement to avoid collecting unnecessary sensitive operational output: Unset debug environment variables or restore normal log settings when the investigation ends; this does not by itself satisfy the requested task to focus verbose diagnostics on provider-side activity. For the stated need, TF_LOG_PROVIDER environment variable is the more direct mechanism.

Question 758

The implementation must both avoid remote refresh reads when an intentional troubleshooting constraint requires it and recognize that a proposed change will replace an existing resource. Which TWO mechanisms directly address these two separate requirements? Choose TWO.

  1. Plan without state refresh
  2. terraform plan command
  3. Targeted planning
  4. Plan saved to file
  5. Replacement plan indicator

Explanation

Correct Answers

A:

Among the paired tasks to avoid remote refresh reads when an intentional troubleshooting constraint requires it and recognize that a proposed change will replace an existing resource, Plan without state refresh serves the requirement to avoid remote refresh reads when an intentional troubleshooting constraint requires it: terraform plan -refresh=false uses existing state without refreshing live objects before planning. The other task must be covered by a separate mechanism.

E:

Among the paired tasks to avoid remote refresh reads when an intentional troubleshooting constraint requires it and recognize that a proposed change will replace an existing resource, Replacement plan indicator serves the requirement to recognize that a proposed change will replace an existing resource: The plan symbols -/+ or +/- indicate replacement behavior and its creation/destruction ordering. The other task must be covered by a separate mechanism.

Incorrect Answers

B:

The requirements are avoid remote refresh reads when an intentional troubleshooting constraint requires it and recognize that a proposed change will replace an existing resource, while terraform plan command supports the different task to preview actions required to reach the declared infrastructure state: terraform plan shows changes Terraform expects, including creates, updates, deletes, and replacements. That capability is outside the two selected responsibilities.

C:

The requirements are avoid remote refresh reads when an intentional troubleshooting constraint requires it and recognize that a proposed change will replace an existing resource, while Targeted planning supports the different task to focus on a small subset for exceptional repair or troubleshooting: terraform plan -target=ADDRESS limits the planner's focus to the selected graph portion. That capability is outside the two selected responsibilities.

D:

The requirements are avoid remote refresh reads when an intentional troubleshooting constraint requires it and recognize that a proposed change will replace an existing resource, while Plan saved to file supports the different task to capture one execution plan for later approval and application: terraform plan -out=change.tfplan saves an executable binary plan artifact. That capability is outside the two selected responsibilities.

Question 759

A Terraform rollout has two separate requirements: first, detach a resource address from state while leaving the remote object intact; second, restore externally modified resource settings to desired code values. Which assignment of mechanisms correctly handles both responsibilities?

  1. First use terraform state rm; then use Remote drift detection during plan.
  2. First use Drift reconciliation to configuration; then use terraform state rm.
  3. First use terraform state rm; then use Drift reconciliation to configuration.
  4. First use Remote drift detection during plan; then use Refresh-only reconciliation.
  5. First use Refresh-only reconciliation; then use Drift reconciliation to configuration.

Explanation

Correct Answer

C:

The first requirement, to detach a resource address from state while leaving the remote object intact, is handled by terraform state rm: state rm forgets the binding but does not delete the real infrastructure object. The second requirement, to restore externally modified resource settings to desired code values, is handled by Drift reconciliation to configuration: A regular plan and apply can propose changing a drifted object back to configured settings. Each of these mechanisms has a distinct responsibility.

Incorrect Answers

A:

For the requested tasks to detach a resource address from state while leaving the remote object intact and restore externally modified resource settings to desired code values, the first candidate terraform state rm addresses detach a resource address from state while leaving the remote object intact; the second candidate Remote drift detection during plan addresses recognize that a resource was changed outside Terraform. This mapping fails because the second mechanism primarily supports the task to recognize that a resource was changed outside Terraform; the actual requirements are detach a resource address from state while leaving the remote object intact first and restore externally modified resource settings to desired code values second.

B:

For the requested tasks to detach a resource address from state while leaving the remote object intact and restore externally modified resource settings to desired code values, the first candidate Drift reconciliation to configuration addresses restore externally modified resource settings to desired code values; the second candidate terraform state rm addresses detach a resource address from state while leaving the remote object intact. This mapping fails because the first mechanism primarily supports the task to restore externally modified resource settings to desired code values and the second mechanism primarily supports the task to detach a resource address from state while leaving the remote object intact; the actual requirements are detach a resource address from state while leaving the remote object intact first and restore externally modified resource settings to desired code values second.

D:

For the requested tasks to detach a resource address from state while leaving the remote object intact and restore externally modified resource settings to desired code values, the first candidate Remote drift detection during plan addresses recognize that a resource was changed outside Terraform; the second candidate Refresh-only reconciliation addresses accept an external change into Terraform state without modifying remote infrastructure. This mapping fails because the first mechanism primarily supports the task to recognize that a resource was changed outside Terraform and the second mechanism primarily supports the task to accept an external change into Terraform state without modifying remote infrastructure; the actual requirements are detach a resource address from state while leaving the remote object intact first and restore externally modified resource settings to desired code values second.

E:

For the requested tasks to detach a resource address from state while leaving the remote object intact and restore externally modified resource settings to desired code values, the first candidate Refresh-only reconciliation addresses accept an external change into Terraform state without modifying remote infrastructure; the second candidate Drift reconciliation to configuration addresses restore externally modified resource settings to desired code values. This mapping fails because the first mechanism primarily supports the task to accept an external change into Terraform state without modifying remote infrastructure; the actual requirements are detach a resource address from state while leaving the remote object intact first and restore externally modified resource settings to desired code values second.

Question 760

Before adopting for_each resource replication to create one resource instance per unique map or set key, which statement sets an accurate boundary?

  1. Interpolation is not required when an argument can take a direct expression reference.
  2. Keys cannot be unknown or derived directly from sensitive values.
  3. Dynamic cannot generate resource or provider blocks at the root level.
  4. A for expression calculates values but does not itself create resource instances.

Explanation

Correct Answer

B:

For for_each resource replication in the task to create one resource instance per unique map or set key, the important caution is: Keys cannot be unknown or derived directly from sensitive values. The reason this matters is its actual behavior: for_each expands a resource into stable keyed instances when its collection is known at planning.

Incorrect Answers

A:

The proposed warning belongs to Template interpolation, which serves the different goal to embed evaluated expressions in a Terraform string, rather than to for_each resource replication: The ${...} syntax can interpolate an expression into a quoted string or template. The question concerns for_each resource replication acting to create one resource instance per unique map or set key, not a limit of Template interpolation.

C:

The proposed warning belongs to Dynamic nested block, which serves the different goal to generate repeated nested configuration blocks from a collection, rather than to for_each resource replication: A dynamic block emits nested blocks where the enclosing resource schema permits them. The question concerns for_each resource replication acting to create one resource instance per unique map or set key, not a limit of Dynamic nested block.

D:

The listed caution belongs specifically to for expression list projection, used to transform a collection into a list of calculated values: A bracketed for expression maps each element to a new value using a declared iterator; the feature under review is instead for_each resource replication, so this answer attaches another feature's qualification to the wrong mechanism.

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