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 58

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.

Question 571

A healthcare team is relocating Terraform state but cannot publish the storage-account access key in its training repository. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.
  2. Configure a remote backend with supported state locking and avoid applying while another run holds the relevant workspace lock.
  3. 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.
  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: D

A.

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: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

B.

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: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

C.

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. This addresses “Use force-unlock only after verifying a stale lock”, where the governing principle is: Force-unlock removes locking protection rather than safely terminating a still-running Terraform operation; using it during an active apply can create conflicts. The stated case instead calls for: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

D.

Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata. Verify the result with this test: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

Question 572

A healthcare team is relocating Terraform state but cannot publish the storage-account access key in its training repository. The infrastructure engineer proposes this change: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. Which mechanism explains why it works?

  1. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.
  2. Force-unlock removes locking protection rather than safely terminating a still-running Terraform operation; using it during an active apply can create conflicts.
  3. Locking protects the critical section for reading and writing a shared state snapshot; concurrent plan-and-apply processes can otherwise race.
  4. A backend determines where authoritative state is stored and often provides locking; provider authentication alone does not grant or configure remote backend access.

Answer & Explanations

Correct answer: A

A.

Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata. The corresponding implementation is: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

B.

Force-unlock removes locking protection rather than safely terminating a still-running Terraform operation; using it during an active apply can create conflicts. That explains “Use force-unlock only after verifying a stale lock”, not the mechanism behind the described change. The relevant principle is: Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

C.

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: Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

D.

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: Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

Question 573

A healthcare team is relocating Terraform state but cannot publish the storage-account access key in its training repository. After implementing this change—Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.—which test most directly validates its intended outcome?

  1. Launch two harmless test operations against a locking-capable backend and verify the second cannot modify state until the first releases its lock.
  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. 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: B

A.

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: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

B.

Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password. This check is decisive because backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

C.

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: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

D.

Simulate an abandoned test lock, inspect its reported ID and confirm an authorized unlock followed by a normal plan restores safe operation. That would help test “Use force-unlock only after verifying a stale lock”, not the outcome required in this scenario. The relevant acceptance check is: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

Question 574

A healthcare team is relocating Terraform state but cannot publish the storage-account access key in its training repository. Which proposed shortcut most directly risks unauthorized access to state snapshots and secrets due to leaked backend credentials and should therefore be rejected?

  1. Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.
  2. Force-unlock a backend whenever planning is slow without checking whether a live CI job currently owns the lock.
  3. Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository.
  4. Disable locking for a busy shared state so both pipelines can apply competing changes at the same time.

Answer & Explanations

Correct answer: C

A.

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: Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository.

B.

Force-unlock a backend whenever planning is slow without checking whether a live CI job currently owns the lock. That shortcut risks overlapping operations and potential state corruption after premature unlock. Here the specific shortcut is: Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository.

C.

Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository. The foreseeable failure is unauthorized access to state snapshots and secrets due to leaked backend credentials. The safer response is: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

D.

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: Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository.

Question 575

A healthcare team is relocating Terraform state but cannot publish the storage-account access key in its training repository. Which combined implementation and verification plan is the best match for this workload?

  1. 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.
  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: 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.
  4. 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: 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: D

A.

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: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

B.

The action is applicable: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. But its proposed 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.—addresses “Configure a supported remote state backend with access controls”. This requirement is confirmed instead by: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

C.

The test would be relevant: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password. But the offered implementation—Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.—addresses “Configure a supported remote state backend with access controls”. The action needed here is: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

D.

Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. Confirm it through this test: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

Question 576

A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.
  2. Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers.
  3. Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.
  4. 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.

Answer & Explanations

Correct answer: A

A.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata. Verify the result with this test: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

B.

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: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

C.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. 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: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

D.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. 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. This addresses “Use force-unlock only after verifying a stale lock”, where the governing principle is: Force-unlock removes locking protection rather than safely terminating a still-running Terraform operation; using it during an active apply can create conflicts. The stated case instead calls for: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

Question 577

A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. The infrastructure engineer proposes this change: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. Which mechanism explains why it works?

  1. Force-unlock removes locking protection rather than safely terminating a still-running Terraform operation; using it during an active apply can create conflicts.
  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. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.
  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.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. Force-unlock removes locking protection rather than safely terminating a still-running Terraform operation; using it during an active apply can create conflicts. That explains “Use force-unlock only after verifying a stale lock”, not the mechanism behind the described change. The relevant principle is: Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

B.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. 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: Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

C.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata. The corresponding implementation is: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

D.

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: Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

Question 578

A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. After implementing this change—Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.—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. Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.
  3. Simulate an abandoned test lock, inspect its reported ID and confirm an authorized unlock followed by a normal plan restores safe operation.
  4. 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: B

A.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. 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: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

B.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password. This check is decisive because backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

C.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. Simulate an abandoned test lock, inspect its reported ID and confirm an authorized unlock followed by a normal plan restores safe operation. That would help test “Use force-unlock only after verifying a stale lock”, not the outcome required in this scenario. The relevant acceptance check is: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

D.

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: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

Question 579

A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. Which proposed shortcut most directly risks unauthorized access to state snapshots and secrets due to leaked backend credentials and should therefore be rejected?

  1. Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository.
  2. Write a remote backend block without running terraform init and assume existing local state instantly migrates to the new storage.
  3. Have three engineers keep independent terraform.tfstate files for one production environment and assume all changes will reconcile safely.
  4. Force-unlock a backend whenever planning is slow without checking whether a live CI job currently owns the lock.

Answer & Explanations

Correct answer: A

A.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository. The foreseeable failure is unauthorized access to state snapshots and secrets due to leaked backend credentials. The safer response is: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

B.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. 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: Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository.

C.

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: Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository.

D.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. Force-unlock a backend whenever planning is slow without checking whether a live CI job currently owns the lock. That shortcut risks overlapping operations and potential state corruption after premature unlock. Here the specific shortcut is: Hardcode a permanent organization-wide backend storage key in terraform.tf and commit it to a public tutorial repository.

Question 580

A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. 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: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.
  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: 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: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. 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: D

A.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. The test would be relevant: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password. But the offered implementation—Define a supported backend in the terraform block, initialize it with approved credentials and secure remote state storage with encryption and scoped access.—addresses “Configure a supported remote state backend with access controls”. The action needed here is: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

B.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. The action is applicable: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. But its proposed 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.—addresses “Configure a supported remote state backend with access controls”. This requirement is confirmed instead by: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password.

C.

This action/test pair addresses “Recognize the limits of the local Terraform state backend”. Use the local backend only for isolated or small controlled contexts and secure the terraform.tfstate file from loss, accidental commits and parallel writers. Apply a disposable resource, locate its local state and compare a second isolated checkout to show why it lacks a shared authoritative state snapshot. The case instead calls for: Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL.

D.

The question is set in this situation: A financial-services CI platform needs separate privileges for downloading state and modifying remote cloud infrastructure. Provide backend authentication using supported environment or workload identity and inject backend settings safely rather than embedding long-lived access tokens in HCL. Confirm it through this test: Run a clean test initialization with a scoped CI identity and verify that source and saved artifacts contain no plaintext backend password. Backends are initialized before providers and have their own authentication flow; committed secrets can be exposed through source history and initialization metadata.

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