HashiCorp Terraform Associate (HashiCorp Certified: Terraform Associate) Practice Test 67

Question 660

An engineer needs to let a Terraform operation retry acquiring a busy state lock as part of a planned migration. Which option is the best fit?

  1. Use -lock-timeout=5m where supported
  2. Use separate states to reduce unrelated lock contention
  3. Use terraform force-unlock LOCK_ID only after verification
  4. Serialize applies in CI for a shared workspace

Explanation

Correct Answer

A:

The timeout specifies how long to wait for lock availability before failing; it does not forcibly terminate another process; this behavior should be assessed against the concrete need to let a Terraform operation retry acquiring a busy state lock. This directly supports the task to let a Terraform operation retry acquiring a busy state lock during a maintenance request.

Incorrect Answers

B:

Different state keys or workspaces allow separate lock scopes; splitting state also introduces explicit cross-state integration responsibilities; this behavior should be assessed against the concrete need to let a Terraform operation retry acquiring a busy state lock. The stated requirement is to let a Terraform operation retry acquiring a busy state lock, not to isolate independently managed infrastructure components; this alternative addresses a different control or phase.

C:

Force-unlock bypasses normal safeguards and can permit conflicting state writes; the lock ID helps ensure the intended lock is targeted; this behavior should be assessed against the concrete need to let a Terraform operation retry acquiring a busy state lock. That can be useful when the aim is to clear a stale lock when the original owner is definitely inactive, but it does not directly deliver the requested ability to let a Terraform operation retry acquiring a busy state lock.

D:

Pipeline serialization reduces contention and conflicting approval assumptions; backend locking is an additional integrity layer rather than a full deployment scheduler; this behavior should be assessed against the concrete need to let a Terraform operation retry acquiring a busy state lock. The distinction matters here: using that mechanism to avoid overlapping infrastructure modifications even when locks exist would still leave the objective to let a Terraform operation retry acquiring a busy state lock unmet.

Question 661

A Terraform review separates 2 requirements: (1) prevent local initialization secrets and settings from entering Git; (2) share selected information from another state rather than taking over its resources. Identify the two features that each directly handle one of those requirements. Choose TWO.

  1. Protect remote state with encryption and restricted IAM
  2. Understand terraform_remote_state reads root outputs
  3. Avoid committing .terraform/ backend metadata
  4. Use a backend with versioned object storage when possible
  5. Use backend-specific environment variables for credentials

Explanation

Correct Answers

B:

The built-in data source consumes outputs from a different state; it does not give Terraform lifecycle ownership of the remote objects stored there; this behavior should be assessed against the concrete need to prevent local initialization secrets and settings from entering Git and share selected information from another state rather than taking over its resources. This matches the distinct objective to share selected information from another state rather than taking over its resources; the remaining chosen features address prevent local initialization secrets and settings from entering Git.

C:

Terraform records initialized backend configuration in its generated data directory; this is separate from the tracked HCL declarations; this behavior should be assessed against the concrete need to prevent local initialization secrets and settings from entering Git and share selected information from another state rather than taking over its resources. This matches the distinct objective to prevent local initialization secrets and settings from entering Git; the remaining chosen features address share selected information from another state rather than taking over its resources.

Incorrect Answers

A:

Remote state can include secrets, IDs, and metadata; confidentiality and access authorization are required even when console outputs are marked sensitive; this behavior should be assessed against the concrete need to prevent local initialization secrets and settings from entering Git and share selected information from another state rather than taking over its resources. Its main application is to secure a centrally stored record of infrastructure attributes; the checklist instead asks for prevent local initialization secrets and settings from entering Git; and share selected information from another state rather than taking over its resources. None of those distinct criteria specifically calls for this alternative.

D:

Storage-side version history can assist state recovery after mistakes; it does not automatically repair corrupt resource bindings or provider permissions; this behavior should be assessed against the concrete need to prevent local initialization secrets and settings from entering Git and share selected information from another state rather than taking over its resources. Its main application is to retain recoverable previous snapshots for disaster response; the checklist instead asks for prevent local initialization secrets and settings from entering Git; and share selected information from another state rather than taking over its resources. None of those distinct criteria specifically calls for this alternative.

E:

Environment-based authentication can reduce disclosure in saved metadata and plans; backend permissions must still permit the required state operations; this behavior should be assessed against the concrete need to prevent local initialization secrets and settings from entering Git and share selected information from another state rather than taking over its resources. Its main application is to avoid hardcoding secret authentication fields in HCL or init flags; the checklist instead asks for prevent local initialization secrets and settings from entering Git; and share selected information from another state rather than taking over its resources. None of those distinct criteria specifically calls for this alternative.

Question 662

During a platform review, the team must accomplish all of these distinct aims: (1) preview a state update that accepts the current remote attributes; (2) rename a Terraform resource address while preserving ongoing management of the same remote object; (3) understand reconciliation when provider-observed values differ from HCL. Select exactly the three relevant mechanisms. Choose THREE.

  1. Use terraform plan -refresh-only
  2. Avoid editing raw state JSON
  3. Use terraform apply -refresh-only when appropriate
  4. Treat out-of-band tag updates as drift
  5. Use a removed block with destroy = false
  6. Use a moved block for an address rename

Explanation

Correct Answers

A:

Refresh-only does not plan corrective resource changes; applying that plan updates Terraform's state representation of the observed infrastructure; this behavior should be assessed against the concrete need to preview a state update that accepts the current remote attributes and rename a Terraform resource address while preserving ongoing management of the same remote object and understand reconciliation when provider-observed values differ from HCL. This matches the distinct objective to preview a state update that accepts the current remote attributes; the remaining chosen features address rename a Terraform resource address while preserving ongoing management of the same remote object and understand reconciliation when provider-observed values differ from HCL.

D:

Terraform may plan to restore declared tags unless lifecycle rules deliberately ignore certain changes; the external edit does not automatically rewrite HCL; this behavior should be assessed against the concrete need to preview a state update that accepts the current remote attributes and rename a Terraform resource address while preserving ongoing management of the same remote object and understand reconciliation when provider-observed values differ from HCL. This matches the distinct objective to understand reconciliation when provider-observed values differ from HCL; the remaining chosen features address preview a state update that accepts the current remote attributes and rename a Terraform resource address while preserving ongoing management of the same remote object.

F:

The from/to mapping teaches Terraform how to refactor tracked addresses before planning; it prevents an unnecessary destroy/create caused solely by a configuration rename; this behavior should be assessed against the concrete need to preview a state update that accepts the current remote attributes and rename a Terraform resource address while preserving ongoing management of the same remote object and understand reconciliation when provider-observed values differ from HCL. This matches the distinct objective to rename a Terraform resource address while preserving ongoing management of the same remote object; the remaining chosen features address preview a state update that accepts the current remote attributes and understand reconciliation when provider-observed values differ from HCL.

Incorrect Answers

B:

Supported state commands and declarative refactoring blocks are safer; incorrect manual edits can make future plans target the wrong objects; this behavior should be assessed against the concrete need to preview a state update that accepts the current remote attributes and rename a Terraform resource address while preserving ongoing management of the same remote object and understand reconciliation when provider-observed values differ from HCL. Its main application is to prevent inconsistent serials, lineages, attributes, and provider references; the checklist instead asks for preview a state update that accepts the current remote attributes; and rename a Terraform resource address while preserving ongoing management of the same remote object; and understand reconciliation when provider-observed values differ from HCL. None of those distinct criteria specifically calls for this alternative.

C:

The mode reconciles state to remote reality; it differs from an ordinary apply that might revert unauthorized changes; this behavior should be assessed against the concrete need to preview a state update that accepts the current remote attributes and rename a Terraform resource address while preserving ongoing management of the same remote object and understand reconciliation when provider-observed values differ from HCL. Its main application is to commit the newly observed remote attributes to state without altering cloud objects; the checklist instead asks for preview a state update that accepts the current remote attributes; and rename a Terraform resource address while preserving ongoing management of the same remote object; and understand reconciliation when provider-observed values differ from HCL. None of those distinct criteria specifically calls for this alternative.

E:

The removed block records the intentional withdrawal of management without instructing the provider to delete the remote object; it is not a mere address rename like a moved block; this behavior should be assessed against the concrete need to preview a state update that accepts the current remote attributes and rename a Terraform resource address while preserving ongoing management of the same remote object and understand reconciliation when provider-observed values differ from HCL. Its main application is to document a handoff where Terraform relinquishes ownership but leaves deployed infrastructure untouched; the checklist instead asks for preview a state update that accepts the current remote attributes; and rename a Terraform resource address while preserving ongoing management of the same remote object; and understand reconciliation when provider-observed values differ from HCL. None of those distinct criteria specifically calls for this alternative.

Question 663

An operator is resolving a blocked state update. The requirement is to prevent simultaneous runs from overwriting shared state. Which Terraform mechanism directly meets this requirement?

  1. Use a backend with state locking
  2. Use -lock-timeout=5m where supported
  3. Distinguish backend locking support from remote storage
  4. Keep lock tokens or IDs private to administrators

Explanation

Correct Answer

A:

Backends that support locking serialize state-changing operations; this guards consistency but does not replace change approval; this behavior should be assessed against the concrete need to prevent simultaneous runs from overwriting shared state. This directly supports the task to prevent simultaneous runs from overwriting shared state during an automated release.

Incorrect Answers

B:

The timeout specifies how long to wait for lock availability before failing; it does not forcibly terminate another process; this behavior should be assessed against the concrete need to prevent simultaneous runs from overwriting shared state. That can be useful when the aim is to let a Terraform operation retry acquiring a busy state lock, but it does not directly deliver the requested ability to prevent simultaneous runs from overwriting shared state.

C:

A remote backend may store state but have different locking capabilities; sharing storage is not proof that concurrent writers are safe; this behavior should be assessed against the concrete need to prevent simultaneous runs from overwriting shared state. The distinction matters here: using that mechanism to verify that the selected backend actually coordinates operations would still leave the objective to prevent simultaneous runs from overwriting shared state unmet.

D:

An unlock command can affect shared state coordination; its use should be audited and restricted to trusted operators; this behavior should be assessed against the concrete need to prevent simultaneous runs from overwriting shared state. It may support a related workflow, but the question specifically requires the mechanism for prevent simultaneous runs from overwriting shared state rather than avoid accidental interference with someone else's active run.

Question 664

A Terraform root is moving its state into a shared backend. A reviewer must determine how to avoid treating backend setup like an ordinary runtime variable evaluation. Which action is the appropriate choice?

  1. Protect remote state with encryption and restricted IAM
  2. Understand terraform_remote_state reads root outputs
  3. Use distinct state keys or workspaces for environments
  4. Recognize backend blocks cannot use var.* expressions

Explanation

Correct Answer

D:

Terraform initializes its backend before normal expression evaluation and variable processing; use supported partial configuration mechanisms instead; this behavior should be assessed against the concrete need to avoid treating backend setup like an ordinary runtime variable evaluation. This directly supports the task to avoid treating backend setup like an ordinary runtime variable evaluation during a staged rollout.

Incorrect Answers

A:

Remote state can include secrets, IDs, and metadata; confidentiality and access authorization are required even when console outputs are marked sensitive; this behavior should be assessed against the concrete need to avoid treating backend setup like an ordinary runtime variable evaluation. It may support a related workflow, but the question specifically requires the mechanism for avoid treating backend setup like an ordinary runtime variable evaluation rather than secure a centrally stored record of infrastructure attributes.

B:

The built-in data source consumes outputs from a different state; it does not give Terraform lifecycle ownership of the remote objects stored there; this behavior should be assessed against the concrete need to avoid treating backend setup like an ordinary runtime variable evaluation. The stated requirement is to avoid treating backend setup like an ordinary runtime variable evaluation, not to share selected information from another state rather than taking over its resources; this alternative addresses a different control or phase.

C:

Isolation prevents two environments from sharing addresses and IDs in one state; the storage service can still be shared if access boundaries are enforced; this behavior should be assessed against the concrete need to avoid treating backend setup like an ordinary runtime variable evaluation. That can be useful when the aim is to separate staging and production resource bindings, but it does not directly deliver the requested ability to avoid treating backend setup like an ordinary runtime variable evaluation.

Question 665

The immediate Terraform task is to identify whether old recorded values still reflect remote reality after out-of-band changes. Which method handles that task most directly?

  1. Use a normal terraform plan to assess drift
  2. Compare stored state with a freshly evaluated plan
  3. Avoid editing raw state JSON
  4. Treat a deleted remote object as drift

Explanation

Correct Answer

B:

State holds a previous observation rather than live inventory; a new normal plan asks the provider for current properties and can expose drift that a static state inspection alone would miss; this behavior should be assessed against the concrete need to identify whether old recorded values still reflect remote reality after out-of-band changes. This directly supports the task to identify whether old recorded values still reflect remote reality after out-of-band changes during a configuration change.

Incorrect Answers

A:

Planning typically refreshes tracked resource values and proposes actions to converge with configuration; it does not automatically accept external modifications as desired; this behavior should be assessed against the concrete need to identify whether old recorded values still reflect remote reality after out-of-band changes. The distinction matters here: using that mechanism to compare declared intent with refreshed remote resource attributes would still leave the objective to identify whether old recorded values still reflect remote reality after out-of-band changes unmet.

C:

Supported state commands and declarative refactoring blocks are safer; incorrect manual edits can make future plans target the wrong objects; this behavior should be assessed against the concrete need to identify whether old recorded values still reflect remote reality after out-of-band changes. The stated requirement is to identify whether old recorded values still reflect remote reality after out-of-band changes, not to prevent inconsistent serials, lineages, attributes, and provider references; this alternative addresses a different control or phase.

D:

If a tracked object no longer exists but configuration still declares it, a normal plan may propose recreating it; state alone cannot revive the original object; this behavior should be assessed against the concrete need to identify whether old recorded values still reflect remote reality after out-of-band changes. That can be useful when the aim is to understand why Terraform may propose creation again, but it does not directly deliver the requested ability to identify whether old recorded values still reflect remote reality after out-of-band changes.

Question 666

A reviewer has to approve a two-part design: copy existing state to the new location during reinitialization; additionally, supply environment-specific backend keys at initialization time. Which option pairs the correct mechanisms?

  1. Use a backend with versioned object storage when possible + Use terraform init -reconfigure when not migrating
  2. Use backend migration instead of copying arbitrary JSON + Use a partial backend configuration
  3. Use terraform init -migrate-state for a backend switch + Use backend-specific environment variables for credentials
  4. Use terraform init -migrate-state for a backend switch + Use a partial backend configuration

Explanation

Correct Answer

D:

For the first criterion, migration helps preserve object bindings when changing backends; backup and verify the source state first because the operation affects management continuity; this behavior should be assessed against the concrete need to copy existing state to the new location during reinitialization and supply environment-specific backend keys at initialization time; this directly addresses the need to copy existing state to the new location during reinitialization. For the separate second criterion, a backend block can omit settings that init receives separately; terraform persists merged backend settings in local metadata, so avoid putting raw secrets there; this behavior should be assessed against the concrete need to copy existing state to the new location during reinitialization and supply environment-specific backend keys at initialization time; this fulfills the need to supply environment-specific backend keys at initialization time. Together they cover the independent tasks of copy existing state to the new location during reinitialization and supply environment-specific backend keys at initialization time without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure is intended to retain recoverable previous snapshots for disaster response: Storage-side version history can assist state recovery after mistakes; it does not automatically repair corrupt resource bindings or provider permissions; this behavior should be assessed against the concrete need to copy existing state to the new location during reinitialization and supply environment-specific backend keys at initialization time. The second measure is intended to accept new backend settings without copying old state: Reconfiguration forgets the previously initialized backend relationship; it is dangerous if the operator mistakenly believes existing bindings moved with it; this behavior should be assessed against the concrete need to copy existing state to the new location during reinitialization and supply environment-specific backend keys at initialization time. Neither is the directly designated method for the separate goals of copy existing state to the new location during reinitialization and supply environment-specific backend keys at initialization time in this review.

B:

The second measure does meet the supply environment-specific backend keys at initialization time requirement, but the first is designed for another concern: Terraform's migration workflow handles state snapshots and workspace considerations; manual files copied to the wrong state key can cause unexpected destructive plans; this behavior should be assessed against the concrete need to copy existing state to the new location during reinitialization and supply environment-specific backend keys at initialization time. That first component is designed to preserve state metadata while switching storage, which does not accomplish the requested task to copy existing state to the new location during reinitialization, even though the other measure satisfies supply environment-specific backend keys at initialization time.

C:

The first measure meets the requirement to copy existing state to the new location during reinitialization, but its partner serves a different role: Environment-based authentication can reduce disclosure in saved metadata and plans; backend permissions must still permit the required state operations; this behavior should be assessed against the concrete need to copy existing state to the new location during reinitialization and supply environment-specific backend keys at initialization time. That second component is designed to avoid hardcoding secret authentication fields in HCL or init flags, so the still-missing criterion is to supply environment-specific backend keys at initialization time, while the first criterion remains copy existing state to the new location during reinitialization.

Question 667

A Terraform review separates 2 requirements: (1) understand why Terraform may propose creation again; (2) understand reconciliation when provider-observed values differ from HCL. Identify the two features that each directly handle one of those requirements. Choose TWO.

  1. Treat out-of-band tag updates as drift
  2. Use a moved block for an address rename
  3. Compare stored state with a freshly evaluated plan
  4. Treat a deleted remote object as drift
  5. Use terraform apply -refresh-only when appropriate
  6. Use terraform state rm to forget an object

Explanation

Correct Answers

A:

Terraform may plan to restore declared tags unless lifecycle rules deliberately ignore certain changes; the external edit does not automatically rewrite HCL; this behavior should be assessed against the concrete need to understand why Terraform may propose creation again and understand reconciliation when provider-observed values differ from HCL. This matches the distinct objective to understand reconciliation when provider-observed values differ from HCL; the remaining chosen features address understand why Terraform may propose creation again.

D:

If a tracked object no longer exists but configuration still declares it, a normal plan may propose recreating it; state alone cannot revive the original object; this behavior should be assessed against the concrete need to understand why Terraform may propose creation again and understand reconciliation when provider-observed values differ from HCL. This matches the distinct objective to understand why Terraform may propose creation again; the remaining chosen features address understand reconciliation when provider-observed values differ from HCL.

Incorrect Answers

B:

The from/to mapping teaches Terraform how to refactor tracked addresses before planning; it prevents an unnecessary destroy/create caused solely by a configuration rename; this behavior should be assessed against the concrete need to understand why Terraform may propose creation again and understand reconciliation when provider-observed values differ from HCL. Its main application is to rename a Terraform resource address while preserving ongoing management of the same remote object; the checklist instead asks for understand why Terraform may propose creation again; and understand reconciliation when provider-observed values differ from HCL. None of those distinct criteria specifically calls for this alternative.

C:

State holds a previous observation rather than live inventory; a new normal plan asks the provider for current properties and can expose drift that a static state inspection alone would miss; this behavior should be assessed against the concrete need to understand why Terraform may propose creation again and understand reconciliation when provider-observed values differ from HCL. Its main application is to identify whether old recorded values still reflect remote reality after out-of-band changes; the checklist instead asks for understand why Terraform may propose creation again; and understand reconciliation when provider-observed values differ from HCL. None of those distinct criteria specifically calls for this alternative.

E:

The mode reconciles state to remote reality; it differs from an ordinary apply that might revert unauthorized changes; this behavior should be assessed against the concrete need to understand why Terraform may propose creation again and understand reconciliation when provider-observed values differ from HCL. Its main application is to commit the newly observed remote attributes to state without altering cloud objects; the checklist instead asks for understand why Terraform may propose creation again; and understand reconciliation when provider-observed values differ from HCL. None of those distinct criteria specifically calls for this alternative.

F:

The command removes an address from state; the remote object remains, but a still-present resource block may plan a new object later; this behavior should be assessed against the concrete need to understand why Terraform may propose creation again and understand reconciliation when provider-observed values differ from HCL. Its main application is to stop managing a specific binding without deleting the infrastructure; the checklist instead asks for understand why Terraform may propose creation again; and understand reconciliation when provider-observed values differ from HCL. None of those distinct criteria specifically calls for this alternative.

Question 668

In an automated release, the requested result is to copy existing state to the new location during reinitialization. What should the engineer select?

  1. Enable state locking when supported
  2. Run terraform init after declaring a backend
  3. Use a backend with versioned object storage when possible
  4. Use terraform init -migrate-state for a backend switch

Explanation

Correct Answer

D:

Migration helps preserve object bindings when changing backends; backup and verify the source state first because the operation affects management continuity; this behavior should be assessed against the concrete need to copy existing state to the new location during reinitialization. This directly supports the task to copy existing state to the new location during reinitialization during a module implementation.

Incorrect Answers

A:

Storage alone does not coordinate multiple applies; the backend's documented locking behavior must be configured and understood; this behavior should be assessed against the concrete need to copy existing state to the new location during reinitialization. That can be useful when the aim is to protect the authoritative snapshot from concurrent writers, but it does not directly deliver the requested ability to copy existing state to the new location during reinitialization.

B:

Backend initialization validates configuration and can prompt to migrate existing state; declaring the block alone does not upload the prior snapshot; this behavior should be assessed against the concrete need to copy existing state to the new location during reinitialization. The distinction matters here: using that mechanism to initialize the configured state location before normal operations would still leave the objective to copy existing state to the new location during reinitialization unmet.

C:

Storage-side version history can assist state recovery after mistakes; it does not automatically repair corrupt resource bindings or provider permissions; this behavior should be assessed against the concrete need to copy existing state to the new location during reinitialization. It may support a related workflow, but the question specifically requires the mechanism for copy existing state to the new location during reinitialization rather than retain recoverable previous snapshots for disaster response.

Question 669

An operator finds differences between state and reality. The team must both commit the newly observed remote attributes to state without altering cloud objects and change which Terraform address owns an existing object. Which paired choice implements those distinct goals?

  1. Use terraform apply -refresh-only when appropriate + Use terraform state list to inspect bindings
  2. Use terraform state rm to forget an object + Use an import block to adopt a preexisting object
  3. Use terraform apply -refresh-only when appropriate + Use terraform state mv for imperative state relocation
  4. Use a removed block with destroy = false + Use terraform state mv for imperative state relocation

Explanation

Correct Answer

C:

For the first criterion, the mode reconciles state to remote reality; it differs from an ordinary apply that might revert unauthorized changes; this behavior should be assessed against the concrete need to commit the newly observed remote attributes to state without altering cloud objects and change which Terraform address owns an existing object; this directly addresses the need to commit the newly observed remote attributes to state without altering cloud objects. For the separate second criterion, state move adjusts tracked bindings and writes a backup; it does not call a provider to physically move the cloud object; this behavior should be assessed against the concrete need to commit the newly observed remote attributes to state without altering cloud objects and change which Terraform address owns an existing object; this fulfills the need to change which Terraform address owns an existing object. Together they cover the independent tasks of commit the newly observed remote attributes to state without altering cloud objects and change which Terraform address owns an existing object without exchanging the responsibilities of these features.

Incorrect Answers

A:

The first measure meets the requirement to commit the newly observed remote attributes to state without altering cloud objects, but its partner serves a different role: The command reports addresses, not a complete catalog of provider-side objects; unmanaged objects will not appear; this behavior should be assessed against the concrete need to commit the newly observed remote attributes to state without altering cloud objects and change which Terraform address owns an existing object. That second component is designed to enumerate the tracked resource addresses in the selected state, so the still-missing criterion is to change which Terraform address owns an existing object, while the first criterion remains commit the newly observed remote attributes to state without altering cloud objects.

B:

The first measure is intended to stop managing a specific binding without deleting the infrastructure: The command removes an address from state; the remote object remains, but a still-present resource block may plan a new object later; this behavior should be assessed against the concrete need to commit the newly observed remote attributes to state without altering cloud objects and change which Terraform address owns an existing object. The second measure is intended to add an unmanaged object into the current state under a declared address: Import maps a remote ID to resource configuration; it does not automatically create the imported infrastructure from scratch; this behavior should be assessed against the concrete need to commit the newly observed remote attributes to state without altering cloud objects and change which Terraform address owns an existing object. Neither is the directly designated method for the separate goals of commit the newly observed remote attributes to state without altering cloud objects and change which Terraform address owns an existing object in this review.

D:

The second measure does meet the change which Terraform address owns an existing object requirement, but the first is designed for another concern: The removed block records the intentional withdrawal of management without instructing the provider to delete the remote object; it is not a mere address rename like a moved block; this behavior should be assessed against the concrete need to commit the newly observed remote attributes to state without altering cloud objects and change which Terraform address owns an existing object. That first component is designed to document a handoff where Terraform relinquishes ownership but leaves deployed infrastructure untouched, which does not accomplish the requested task to commit the newly observed remote attributes to state without altering cloud objects, even though the other measure satisfies change which Terraform address owns an existing object.

Question 670

An engineer needs to accept new backend settings without copying old state as part of an automated release. Which option is the best fit?

  1. Use backend migration instead of copying arbitrary JSON
  2. Declare terraform { backend "s3" { ... } }
  3. Use terraform init -reconfigure when not migrating
  4. Use a partial backend configuration

Explanation

Correct Answer

C:

Reconfiguration forgets the previously initialized backend relationship; it is dangerous if the operator mistakenly believes existing bindings moved with it; this behavior should be assessed against the concrete need to accept new backend settings without copying old state. This directly supports the task to accept new backend settings without copying old state during an infrastructure audit.

Incorrect Answers

A:

Terraform's migration workflow handles state snapshots and workspace considerations; manual files copied to the wrong state key can cause unexpected destructive plans; this behavior should be assessed against the concrete need to accept new backend settings without copying old state. The distinction matters here: using that mechanism to preserve state metadata while switching storage would still leave the objective to accept new backend settings without copying old state unmet.

B:

A backend block chooses Terraform state storage and related settings; it does not configure the AWS provider used for managed resources; this behavior should be assessed against the concrete need to accept new backend settings without copying old state. It may support a related workflow, but the question specifically requires the mechanism for accept new backend settings without copying old state rather than select a supported remote state storage implementation.

D:

A backend block can omit settings that init receives separately; terraform persists merged backend settings in local metadata, so avoid putting raw secrets there; this behavior should be assessed against the concrete need to accept new backend settings without copying old state. That can be useful when the aim is to supply environment-specific backend keys at initialization time, but it does not directly deliver the requested ability to accept new backend settings without copying old state.

HashiCorp Certified: Terraform Associate (Terraform Associate) Practice Tests