Practice Exams:

HashiCorp Terraform Associate 004 Dumps

EXAM: HashiCorp Certified: Terraform Associate (004)
Verified By Experts
Premium Bundle
$40.00
$59.97 $99.97

Terraform Associate 004 Premium Bundle


  • Premium File 167 Questions & Answers
  • Training Course 118 Lectures
  • Study Guide 285 Pages

HashiCorp Terraform Associate 004 Practice Test 54

Question 530

A university demonstration uses local state but wants students to know the risks before adapting it to an enterprise-managed cloud account. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers. Verify: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.
  2. Implement: Investigate a persisted state lock, establish that no run remains active, and use terraform force-unlock only with the exact known lock ID under approved recovery procedure. Verify: Simulate an abandoned test lock, inspect its reported ID and confirm an authorized unlock followed by a normal plan restores safe operation.
  3. Implement: Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers. Verify: Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot.
  4. Implement: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. Verify: Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot.

Answer & Explanations

Correct answer: C

A.

The question is set in this situation: A university demonstration uses local state but wants students to know the risks before adapting it to an enterprise-managed cloud account. The action is applicable: Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers. But its proposed test—Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.—addresses “Do not assume local backend state is automatically backed up”. This requirement is confirmed instead by: Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot.

B.

This action/test pair addresses “Use force-unlock only after verifying a stale lock”. Investigate a persisted state lock, establish that no run remains active, and use terraform force-unlock only with the exact known lock ID under approved recovery procedure. Simulate an abandoned test lock, inspect its reported ID and confirm an authorized unlock followed by a normal plan restores safe operation. The case instead calls for: Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers.

C.

The question is set in this situation: A university demonstration uses local state but wants students to know the risks before adapting it to an enterprise-managed cloud account. Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers. Confirm it through this test: Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot. A local backend writes state on the machine running Terraform, so other workers may not share the same view or state lock across machines.

D.

The question is set in this situation: A university demonstration uses local state but wants students to know the risks before adapting it to an enterprise-managed cloud account. The test would be relevant: Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot. But the offered implementation—Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.—addresses “Do not assume local backend state is automatically backed up”. The action needed here is: Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers.

Question 531

A research group has dozens of cloud lab resources but its only state copy lives on an unbacked laptop scheduled for replacement. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.
  2. Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity.
  3. Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers.
  4. Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

Answer & Explanations

Correct answer: A

A.

Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings. Verify the result with this test: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

B.

Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. This addresses “Use moved blocks for resource address refactors without intentional recreation”, where the governing principle is: Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource. The stated case instead calls for: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

C.

Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers. This addresses “Recognize the limits of the local Terraform state backend”, where the governing principle is: A local backend writes state on the machine running Terraform, so other workers may not share the same view or state lock across machines. The stated case instead calls for: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

D.

Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. This addresses “Keep backend configuration credentials outside source control”, where the governing principle is: Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata. The stated case instead calls for: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

Question 532

A research group has dozens of cloud lab resources but its only state copy lives on an unbacked laptop scheduled for replacement. The infrastructure engineer proposes this change: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. Which mechanism explains why it works?

  1. A local backend writes state on the machine running Terraform, so other workers may not share the same view or state lock across machines.
  2. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.
  3. Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource.
  4. The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

Answer & Explanations

Correct answer: D

A.

A local backend writes state on the machine running Terraform, so other workers may not share the same view or state lock across machines. That explains “Recognize the limits of the local Terraform state backend”, not the mechanism behind the described change. The relevant principle is: The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

B.

Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata. That explains “Keep backend configuration credentials outside source control”, not the mechanism behind the described change. The relevant principle is: The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

C.

Moved blocks update Terraform's knowledge of resource addresses so renaming code does not by itself imply destroy and recreate of the same remote resource. That explains “Use moved blocks for resource address refactors without intentional recreation”, not the mechanism behind the described change. The relevant principle is: The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

D.

The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings. The corresponding implementation is: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

Question 533

A research group has dozens of cloud lab resources but its only state copy lives on an unbacked laptop scheduled for replacement. After implementing this change—Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.—which test most directly validates its intended outcome?

  1. Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.
  2. Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot.
  3. Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.
  4. Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

Answer & Explanations

Correct answer: D

A.

Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID. That would help test “Use moved blocks for resource address refactors without intentional recreation”, not the outcome required in this scenario. The relevant acceptance check is: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

B.

Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot. That would help test “Recognize the limits of the local Terraform state backend”, not the outcome required in this scenario. The relevant acceptance check is: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

C.

Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password. That would help test “Keep backend configuration credentials outside source control”, not the outcome required in this scenario. The relevant acceptance check is: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

D.

Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses. This check is decisive because the local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

Question 534

A research group has dozens of cloud lab resources but its only state copy lives on an unbacked laptop scheduled for replacement. Which proposed shortcut most directly risks orphaned infrastructure or costly duplicate resources after losing state identities and should therefore be rejected?

  1. Have three engineers keep independent terraform.tfstate files for one production environment and assume all changes will reconcile safely.
  2. Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID.
  3. Rename a resource block in production without a moved mapping and assume Terraform always recognizes it as the same object by cloud display name.
  4. Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository.

Answer & Explanations

Correct answer: B

A.

Have three engineers keep independent terraform.tfstate files for one production environment and assume all changes will reconcile safely. That shortcut risks competing resource ownership and state divergence among collaborators. Here the specific shortcut is: Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID.

B.

Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID. The foreseeable failure is orphaned infrastructure or costly duplicate resources after losing state identities. The safer response is: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

C.

Rename a resource block in production without a moved mapping and assume Terraform always recognizes it as the same object by cloud display name. That shortcut risks unintended destroy-and-create operations during harmless code organization. Here the specific shortcut is: Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID.

D.

Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository. That shortcut risks unauthorized access to state snapshots and secrets due to leaked backend credentials. Here the specific shortcut is: Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID.

Question 535

A research group has dozens of cloud lab resources but its only state copy lives on an unbacked laptop scheduled for replacement. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. Verify: Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot.
  2. Implement: Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers. Verify: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.
  3. Implement: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. Verify: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.
  4. Implement: Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. Verify: Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID.

Answer & Explanations

Correct answer: C

A.

The action is applicable: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. But its proposed test—Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot.—addresses “Recognize the limits of the local Terraform state backend”. This requirement is confirmed instead by: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

B.

The test would be relevant: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses. But the offered implementation—Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers.—addresses “Recognize the limits of the local Terraform state backend”. The action needed here is: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

C.

Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. Confirm it through this test: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses. The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

D.

This action/test pair addresses “Use moved blocks for resource address refactors without intentional recreation”. Declare a moved block mapping an old resource address to its new address during a configuration refactor, then review a plan for preserved remote identity. Rename a disposable managed resource, add the corresponding moved mapping and verify the plan retains the original remote ID. The case instead calls for: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

Question 536

A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.
  2. Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.
  3. Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers.
  4. Run terraform plan -refresh-only to inspect externally changed resource attributes and review a refresh-only apply only when state should accept the remote reality.

Answer & Explanations

Correct answer: A

A.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings. Verify the result with this test: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

B.

Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. This addresses “Configure a supported remote state backend with access controls”, where the governing principle is: A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access. The stated case instead calls for: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

C.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers. This addresses “Recognize the limits of the local Terraform state backend”, where the governing principle is: A local backend writes state on the machine running Terraform, so other workers may not share the same view or state lock across machines. The stated case instead calls for: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

D.

Run terraform plan -refresh-only to inspect externally changed resource attributes and review a refresh-only apply only when state should accept the remote reality. This addresses “Use refresh-only plans to reconcile observed drift into state deliberately”, where the governing principle is: Refresh-only mode updates Terraform's observed state and outputs without reconciling remote objects toward configuration; normal plans may instead propose repairs. The stated case instead calls for: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

Question 537

A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. The infrastructure engineer proposes this change: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. Which mechanism explains why it works?

  1. A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.
  2. Refresh-only mode updates Terraform's observed state and outputs without reconciling remote objects toward configuration; normal plans may instead propose repairs.
  3. The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.
  4. A local backend writes state on the machine running Terraform, so other workers may not share the same view or state lock across machines.

Answer & Explanations

Correct answer: C

A.

A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access. That explains “Configure a supported remote state backend with access controls”, not the mechanism behind the described change. The relevant principle is: The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

B.

Refresh-only mode updates Terraform's observed state and outputs without reconciling remote objects toward configuration; normal plans may instead propose repairs. That explains “Use refresh-only plans to reconcile observed drift into state deliberately”, not the mechanism behind the described change. The relevant principle is: The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

C.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings. The corresponding implementation is: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

D.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. A local backend writes state on the machine running Terraform, so other workers may not share the same view or state lock across machines. That explains “Recognize the limits of the local Terraform state backend”, not the mechanism behind the described change. The relevant principle is: The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

Question 538

A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. After implementing this change—Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.—which test most directly validates its intended outcome?

  1. Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either.
  2. Initialize a disposable remote backend, apply a test resource and verify the resulting state is in the intended restricted location rather than the local directory.
  3. Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot.
  4. Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

Answer & Explanations

Correct answer: D

A.

Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either. That would help test “Use refresh-only plans to reconcile observed drift into state deliberately”, not the outcome required in this scenario. The relevant acceptance check is: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

B.

Initialize a disposable remote backend, apply a test resource and verify the resulting state is in the intended restricted location rather than the local directory. That would help test “Configure a supported remote state backend with access controls”, not the outcome required in this scenario. The relevant acceptance check is: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

C.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot. That would help test “Recognize the limits of the local Terraform state backend”, not the outcome required in this scenario. The relevant acceptance check is: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

D.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses. This check is decisive because the local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

Question 539

A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. Which proposed shortcut most directly risks orphaned infrastructure or costly duplicate resources after losing state identities and should therefore be rejected?

  1. Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID.
  2. Assume terraform apply -refresh-only will forcibly restore every cloud resource to its old configured values after an external manual edit.
  3. Have three engineers keep independent terraform.tfstate files for one production environment and assume all changes will reconcile safely.
  4. Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.

Answer & Explanations

Correct answer: A

A.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID. The foreseeable failure is orphaned infrastructure or costly duplicate resources after losing state identities. The safer response is: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

B.

Assume terraform apply -refresh-only will forcibly restore every cloud resource to its old configured values after an external manual edit. That shortcut risks unrepaired infrastructure drift because state refresh was confused with configuration enforcement. Here the specific shortcut is: Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID.

C.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. Have three engineers keep independent terraform.tfstate files for one production environment and assume all changes will reconcile safely. That shortcut risks competing resource ownership and state divergence among collaborators. Here the specific shortcut is: Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID.

D.

Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage. That shortcut risks multiple authoritative state copies or loss of tracking after backend changes. Here the specific shortcut is: Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID.

Question 540

A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. Verify: Initialize a disposable remote backend, apply a test resource and verify the resulting state is in the intended restricted location rather than the local directory.
  2. Implement: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. Verify: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.
  3. Implement: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. Verify: Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot.
  4. Implement: Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers. Verify: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

Answer & Explanations

Correct answer: B

A.

This action/test pair addresses “Configure a supported remote state backend with access controls”. Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. Initialize a disposable remote backend, apply a test resource and verify the resulting state is in the intended restricted location rather than the local directory. The case instead calls for: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

B.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. Confirm it through this test: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses. The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.

C.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. The action is applicable: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend. But its proposed test—Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot.—addresses “Recognize the limits of the local Terraform state backend”. This requirement is confirmed instead by: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.

D.

The question is set in this situation: A nonprofit needs to preserve a proof-of-concept Terraform workspace while moving the project to a new maintainer's machine. The test would be relevant: Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses. But the offered implementation—Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers.—addresses “Recognize the limits of the local Terraform state backend”. The action needed here is: Protect the working directory's local state with appropriate encrypted backups and avoid manual file edits while preparing a move to an approved shared backend.

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