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 57

Question 560

A university platform team sees a lock error during lab hours and must not disrupt another student's active Terraform apply. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: 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. Verify: Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either.
  2. Implement: Configure a remote backend with supported state locking and avoid applying while another run holds the relevant workspace lock. 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: 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: Launch two harmless test operations against a locking-capable backend and verify the second cannot modify state until the first releases its lock.
  4. 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.

Answer & Explanations

Correct answer: D

A.

This action/test pair addresses “Use refresh-only plans to reconcile observed drift into state deliberately”. 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. Change a safe remote tag on a disposable resource, compare normal and refresh-only plans and verify their effects differ before approving either. The case instead calls for: 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.

B.

The question is set in this situation: A university platform team sees a lock error during lab hours and must not disrupt another student's active Terraform apply. The test would be relevant: Simulate an abandoned test lock, inspect its reported ID and confirm an authorized unlock followed by a normal plan restores safe operation. But the offered implementation—Configure a remote backend with supported state locking and avoid applying while another run holds the relevant workspace lock.—addresses “Respect state locking when multiple operators share a backend”. The action needed here is: 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.

C.

The question is set in this situation: A university platform team sees a lock error during lab hours and must not disrupt another student's active Terraform apply. The action is applicable: 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. But its proposed test—Launch two harmless test operations against a locking-capable backend and verify the second cannot modify state until the first releases its lock.—addresses “Respect state locking when multiple operators share a backend”. This requirement is confirmed instead by: Simulate an abandoned test lock, inspect its reported ID and confirm an authorized unlock followed by a normal plan restores safe operation.

D.

The question is set in this situation: A university platform team sees a lock error during lab hours and must not disrupt another student's active Terraform apply. 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. Confirm it through this test: Simulate an abandoned test lock, inspect its reported ID and confirm an authorized unlock followed by a normal plan restores safe operation. Force-unlock removes locking protection rather than safely terminating a still-running Terraform operation; using it during an active apply can create conflicts.

Question 561

A retailer centralizes Terraform state in an approved managed store and wants each environment to have distinct access policies. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Configure a remote backend with supported state locking and avoid applying while another run holds the relevant workspace lock.
  2. Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.
  3. 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.
  4. Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

Answer & Explanations

Correct answer: D

A.

Configure a remote backend with supported state locking and avoid applying while another run holds the relevant workspace lock. This addresses “Respect state locking when multiple operators share a backend”, where the governing principle is: Locking protects the critical section for reading and writing a shared state snapshot; concurrent plan-and-apply processes can otherwise race. The stated case instead calls for: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

B.

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: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

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. This addresses “Do not assume local backend state is automatically backed up”, where the governing 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. The stated case instead calls for: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

D.

Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access. Verify the result with this test: 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.

Question 562

A retailer centralizes Terraform state in an approved managed store and wants each environment to have distinct access policies. The infrastructure engineer proposes this change: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. Which mechanism explains why it works?

  1. The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings.
  2. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.
  3. A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.
  4. Locking protects the critical section for reading and writing a shared state snapshot; concurrent plan-and-apply processes can otherwise race.

Answer & Explanations

Correct answer: C

A.

The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings. That explains “Do not assume local backend state is automatically backed up”, not the mechanism behind the described change. The relevant 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.

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: A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.

C.

A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access. The corresponding implementation is: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

D.

Locking protects the critical section for reading and writing a shared state snapshot; concurrent plan-and-apply processes can otherwise race. That explains “Respect state locking when multiple operators share a backend”, not the mechanism behind the described change. The relevant 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.

Question 563

A retailer centralizes Terraform state in an approved managed store and wants each environment to have distinct access policies. After implementing this change—Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.—which test most directly validates its intended outcome?

  1. 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. Launch two harmless test operations against a locking-capable backend and verify the second cannot modify state until the first releases its lock.
  3. Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses.
  4. Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

Answer & Explanations

Correct answer: A

A.

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. This check is decisive because a backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.

B.

Launch two harmless test operations against a locking-capable backend and verify the second cannot modify state until the first releases its lock. That would help test “Respect state locking when multiple operators share a backend”, not the outcome required in this scenario. The relevant acceptance check is: 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.

C.

Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses. That would help test “Do not assume local backend state is automatically backed up”, not the outcome required in this scenario. The relevant acceptance check is: 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.

D.

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: 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.

Question 564

A retailer centralizes Terraform state in an approved managed store and wants each environment to have distinct access policies. Which proposed shortcut most directly risks multiple authoritative state copies or loss of tracking after backend changes and should therefore be rejected?

  1. Disable locking for a busy shared state so both pipelines can apply competing changes at the same time.
  2. Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.
  3. Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository.
  4. Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID.

Answer & Explanations

Correct answer: B

A.

Disable locking for a busy shared state so both pipelines can apply competing changes at the same time. That shortcut risks corrupted state or infrastructure conflicts from concurrent writes. Here the specific shortcut is: Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.

B.

Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage. The foreseeable failure is multiple authoritative state copies or loss of tracking after backend changes. The safer response is: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

C.

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: Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.

D.

Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID. That shortcut risks orphaned infrastructure or costly duplicate resources after losing state identities. Here the specific shortcut is: Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.

Question 565

A retailer centralizes Terraform state in an approved managed store and wants each environment to have distinct access policies. 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: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. 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.
  3. Implement: Configure a remote backend with supported state locking and avoid applying while another run holds the relevant workspace lock. Verify: Launch two harmless test operations against a locking-capable backend and verify the second cannot modify state until the first releases its lock.
  4. 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: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

Answer & Explanations

Correct answer: A

A.

Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. Confirm it through this test: 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. A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.

B.

The test would be relevant: 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. But the offered implementation—Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.—addresses “Keep backend configuration credentials outside source control”. The action needed here is: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

C.

This action/test pair addresses “Respect state locking when multiple operators share a backend”. Configure a remote backend with supported state locking and avoid applying while another run holds the relevant workspace lock. Launch two harmless test operations against a locking-capable backend and verify the second cannot modify state until the first releases its lock. The case instead calls for: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

D.

The action is applicable: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. But its proposed test—Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.—addresses “Keep backend configuration credentials outside source control”. This requirement is confirmed instead by: 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.

Question 566

A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. 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.
  2. Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.
  3. 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.
  4. Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

Answer & Explanations

Correct answer: D

A.

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: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

B.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. 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: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

C.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. 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. This addresses “Do not assume local backend state is automatically backed up”, where the governing 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. The stated case instead calls for: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

D.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access. Verify the result with this test: 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.

Question 567

A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. The infrastructure engineer proposes this change: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. Which mechanism explains why it works?

  1. 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.
  2. A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.
  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. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

Answer & Explanations

Correct answer: B

A.

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: A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.

B.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access. The corresponding implementation is: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

C.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. The local backend does not inherently provide centralized recovery, cross-host synchronization or immutable history; a damaged state file can lose resource identity bindings. That explains “Do not assume local backend state is automatically backed up”, not the mechanism behind the described change. The relevant 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.

D.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. 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: A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.

Question 568

A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. After implementing this change—Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.—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. Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.
  3. 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.
  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: C

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: 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.

B.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. 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: 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.

C.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity 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. This check is decisive because a backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.

D.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. Create a controlled state backup before an isolated lab change and demonstrate restoring it to recover the original resource addresses. That would help test “Do not assume local backend state is automatically backed up”, not the outcome required in this scenario. The relevant acceptance check is: 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.

Question 569

A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. Which proposed shortcut most directly risks multiple authoritative state copies or loss of tracking after backend changes 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. Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.
  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.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. Delete a locally stored state file after an apply because the configuration source code alone can reconstruct every remote object ID. That shortcut risks orphaned infrastructure or costly duplicate resources after losing state identities. Here the specific shortcut is: Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.

B.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage. The foreseeable failure is multiple authoritative state copies or loss of tracking after backend changes. The safer response is: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

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: Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.

D.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. 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: Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.

Question 570

A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. 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: 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.
  3. 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.
  4. 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: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

Answer & Explanations

Correct answer: C

A.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. The test would be relevant: 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. But the offered implementation—Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.—addresses “Keep backend configuration credentials outside source control”. The action needed here is: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

B.

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: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.

C.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. Confirm it through this test: 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. A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.

D.

The question is set in this situation: A university research consortium moves shared infrastructure management into an audited remote state service with controlled identity access. The action is applicable: Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access. But its proposed test—Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.—addresses “Keep backend configuration credentials outside source control”. This requirement is confirmed instead by: 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.

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