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 25

Question 240

A public sector IT service is moving from manual Terraform execution to CI and must preserve mandatory human approval for high-risk changes. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Reserve terraform apply -auto-approve for tightly controlled automation with prior independent plan approval, identity boundaries and audit records. Verify: Apply a saved plan in a disposable account and verify its resulting state and resources match the planned creates, updates and deletes.
  2. Implement: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Verify: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.
  3. Implement: Run terraform apply on a reviewed saved plan after checking backend, workspace, provider account, authorization and expected changed resource addresses. Verify: Compare a nonproduction apply requiring confirmation with a gated CI apply and verify the gate rather than a prompt protects production changes.
  4. Implement: Reserve terraform apply -auto-approve for tightly controlled automation with prior independent plan approval, identity boundaries and audit records. Verify: Compare a nonproduction apply requiring confirmation with a gated CI apply and verify the gate rather than a prompt protects production changes.

Answer & Explanations

Correct answer: D

A.

The question is set in this situation: A public sector IT service is moving from manual Terraform execution to CI and must preserve mandatory human approval for high-risk changes. The action is applicable: Reserve terraform apply -auto-approve for tightly controlled automation with prior independent plan approval, identity boundaries and audit records. But its proposed test—Apply a saved plan in a disposable account and verify its resulting state and resources match the planned creates, updates and deletes.—addresses “Apply a reviewed plan under the intended identity”. This requirement is confirmed instead by: Compare a nonproduction apply requiring confirmation with a gated CI apply and verify the gate rather than a prompt protects production changes.

B.

This action/test pair addresses “Use terraform destroy only after reviewing the removal plan”. Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone. The case instead calls for: Reserve terraform apply -auto-approve for tightly controlled automation with prior independent plan approval, identity boundaries and audit records.

C.

The question is set in this situation: A public sector IT service is moving from manual Terraform execution to CI and must preserve mandatory human approval for high-risk changes. The test would be relevant: Compare a nonproduction apply requiring confirmation with a gated CI apply and verify the gate rather than a prompt protects production changes. But the offered implementation—Run terraform apply on a reviewed saved plan after checking backend, workspace, provider account, authorization and expected changed resource addresses.—addresses “Apply a reviewed plan under the intended identity”. The action needed here is: Reserve terraform apply -auto-approve for tightly controlled automation with prior independent plan approval, identity boundaries and audit records.

D.

The question is set in this situation: A public sector IT service is moving from manual Terraform execution to CI and must preserve mandatory human approval for high-risk changes. Reserve terraform apply -auto-approve for tightly controlled automation with prior independent plan approval, identity boundaries and audit records. Confirm it through this test: Compare a nonproduction apply requiring confirmation with a gated CI apply and verify the gate rather than a prompt protects production changes. The flag skips interactive confirmation; it does not validate policy compliance or remove the impact of destructive provider operations.

Question 241

A training workshop cleans up short-lived cloud resources but the operator's terminal also has access to a live production backend. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Prefer a full configuration plan and use targeted operations only for carefully justified recovery after evaluating dependencies and state consistency.
  2. Initialize providers and backend, validate configuration, inspect a plan and apply only reviewed changes under the appropriate identity.
  3. Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.
  4. Use independent backend state and credentials per environment, generating and reviewing plans against the selected environment before any apply.

Answer & Explanations

Correct answer: C

A.

Prefer a full configuration plan and use targeted operations only for carefully justified recovery after evaluating dependencies and state consistency. This addresses “Avoid routine targeting as a substitute for normal lifecycle review”, where the governing principle is: Target selection can produce partial changes outside normal graph reconciliation, so skipping a full follow-up plan can leave dependent infrastructure misaligned. The stated case instead calls for: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

B.

Initialize providers and backend, validate configuration, inspect a plan and apply only reviewed changes under the appropriate identity. This addresses “Follow init-plan-apply workflow before changing infrastructure”, where the governing principle is: Terraform builds an execution plan from configuration, state and remote reality; separating review from apply helps control infrastructure effects. The stated case instead calls for: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

C.

Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent. Verify the result with this test: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.

D.

Use independent backend state and credentials per environment, generating and reviewing plans against the selected environment before any apply. This addresses “Keep development and production approvals separate within the same workflow”, where the governing principle is: The same HCL can operate on very different resources when credentials and state differ; a local workspace name is not a complete security boundary. The stated case instead calls for: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

Question 242

A training workshop cleans up short-lived cloud resources but the operator's terminal also has access to a live production backend. The infrastructure engineer proposes this change: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Which mechanism explains why it works?

  1. Terraform builds an execution plan from configuration, state and remote reality; separating review from apply helps control infrastructure effects.
  2. The same HCL can operate on very different resources when credentials and state differ; a local workspace name is not a complete security boundary.
  3. Target selection can produce partial changes outside normal graph reconciliation, so skipping a full follow-up plan can leave dependent infrastructure misaligned.
  4. Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

Answer & Explanations

Correct answer: D

A.

Terraform builds an execution plan from configuration, state and remote reality; separating review from apply helps control infrastructure effects. That explains “Follow init-plan-apply workflow before changing infrastructure”, not the mechanism behind the described change. The relevant principle is: Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

B.

The same HCL can operate on very different resources when credentials and state differ; a local workspace name is not a complete security boundary. That explains “Keep development and production approvals separate within the same workflow”, not the mechanism behind the described change. The relevant principle is: Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

C.

Target selection can produce partial changes outside normal graph reconciliation, so skipping a full follow-up plan can leave dependent infrastructure misaligned. That explains “Avoid routine targeting as a substitute for normal lifecycle review”, not the mechanism behind the described change. The relevant principle is: Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

D.

Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent. The corresponding implementation is: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

Question 243

A training workshop cleans up short-lived cloud resources but the operator's terminal also has access to a live production backend. After implementing this change—Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.—which test most directly validates its intended outcome?

  1. Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.
  2. Execute a deliberately scoped disposable cleanup, then perform a full plan and verify no unintended dependency drift remains.
  3. Plan the same module in isolated development and production test contexts and verify the state backend and provider account match each environment.
  4. In a sandbox, run init, validate, plan and apply with an approved test resource, then confirm an unchanged subsequent plan.

Answer & Explanations

Correct answer: A

A.

Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone. This check is decisive because destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

B.

Execute a deliberately scoped disposable cleanup, then perform a full plan and verify no unintended dependency drift remains. That would help test “Avoid routine targeting as a substitute for normal lifecycle review”, not the outcome required in this scenario. The relevant acceptance check is: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.

C.

Plan the same module in isolated development and production test contexts and verify the state backend and provider account match each environment. That would help test “Keep development and production approvals separate within the same workflow”, not the outcome required in this scenario. The relevant acceptance check is: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.

D.

In a sandbox, run init, validate, plan and apply with an approved test resource, then confirm an unchanged subsequent plan. That would help test “Follow init-plan-apply workflow before changing infrastructure”, not the outcome required in this scenario. The relevant acceptance check is: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.

Question 244

A training workshop cleans up short-lived cloud resources but the operator's terminal also has access to a live production backend. Which proposed shortcut most directly risks permanent loss of unrelated managed infrastructure or stored data and should therefore be rejected?

  1. Assume copying a terraform directory from staging into production makes it safe to apply without checking credentials, backend and target objects.
  2. Run terraform destroy in a shared production backend assuming it deletes only temporary resources from the current terminal session.
  3. Destroy one selected resource with a targeted option and declare the environment fully reconciled without reviewing its dependencies.
  4. Run terraform apply on an unfamiliar production directory before initialization and without reviewing the proposed resource changes.

Answer & Explanations

Correct answer: B

A.

Assume copying a terraform directory from staging into production makes it safe to apply without checking credentials, backend and target objects. That shortcut risks accidental infrastructure changes to a protected environment. Here the specific shortcut is: Run terraform destroy in a shared production backend assuming it deletes only temporary resources from the current terminal session.

B.

Run terraform destroy in a shared production backend assuming it deletes only temporary resources from the current terminal session. The foreseeable failure is permanent loss of unrelated managed infrastructure or stored data. The safer response is: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

C.

Destroy one selected resource with a targeted option and declare the environment fully reconciled without reviewing its dependencies. That shortcut risks broken dependent resources and incomplete infrastructure convergence. Here the specific shortcut is: Run terraform destroy in a shared production backend assuming it deletes only temporary resources from the current terminal session.

D.

Run terraform apply on an unfamiliar production directory before initialization and without reviewing the proposed resource changes. That shortcut risks unintended production changes from skipping baseline validation and change review. Here the specific shortcut is: Run terraform destroy in a shared production backend assuming it deletes only temporary resources from the current terminal session.

Question 245

A training workshop cleans up short-lived cloud resources but the operator's terminal also has access to a live production backend. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Verify: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.
  2. Implement: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Verify: Execute a deliberately scoped disposable cleanup, then perform a full plan and verify no unintended dependency drift remains.
  3. Implement: Prefer a full configuration plan and use targeted operations only for carefully justified recovery after evaluating dependencies and state consistency. Verify: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.
  4. Implement: Initialize providers and backend, validate configuration, inspect a plan and apply only reviewed changes under the appropriate identity. Verify: In a sandbox, run init, validate, plan and apply with an approved test resource, then confirm an unchanged subsequent plan.

Answer & Explanations

Correct answer: A

A.

Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Confirm it through this test: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone. Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

B.

The action is applicable: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. But its proposed test—Execute a deliberately scoped disposable cleanup, then perform a full plan and verify no unintended dependency drift remains.—addresses “Avoid routine targeting as a substitute for normal lifecycle review”. This requirement is confirmed instead by: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.

C.

The test would be relevant: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone. But the offered implementation—Prefer a full configuration plan and use targeted operations only for carefully justified recovery after evaluating dependencies and state consistency.—addresses “Avoid routine targeting as a substitute for normal lifecycle review”. The action needed here is: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

D.

This action/test pair addresses “Follow init-plan-apply workflow before changing infrastructure”. Initialize providers and backend, validate configuration, inspect a plan and apply only reviewed changes under the appropriate identity. In a sandbox, run init, validate, plan and apply with an approved test resource, then confirm an unchanged subsequent plan. The case instead calls for: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

Question 246

A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Which HashiCorp Terraform infrastructure implementation best satisfies this requirement?

  1. Create an execution plan with terraform plan -out to a protected artifact and apply that exact reviewed plan under the same intended infrastructure context.
  2. When changing backend settings, choose the appropriate terraform init -migrate-state or -reconfigure workflow after safeguarding the existing state and validating target storage.
  3. Prefer a full configuration plan and use targeted operations only for carefully justified recovery after evaluating dependencies and state consistency.
  4. Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

Answer & Explanations

Correct answer: D

A.

Create an execution plan with terraform plan -out to a protected artifact and apply that exact reviewed plan under the same intended infrastructure context. This addresses “Save an execution plan artifact for controlled apply”, where the governing principle is: A saved plan fixes the selected actions for approval while still requiring safeguards against stale state and leaked sensitive values in plan artifacts. The stated case instead calls for: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

B.

When changing backend settings, choose the appropriate terraform init -migrate-state or -reconfigure workflow after safeguarding the existing state and validating target storage. This addresses “Handle backend reconfiguration and migration deliberately”, where the governing principle is: Backend initialization may require state migration; reconfiguration tells Terraform to forget prior local backend initialization without copying old state automatically. The stated case instead calls for: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

C.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Prefer a full configuration plan and use targeted operations only for carefully justified recovery after evaluating dependencies and state consistency. This addresses “Avoid routine targeting as a substitute for normal lifecycle review”, where the governing principle is: Target selection can produce partial changes outside normal graph reconciliation, so skipping a full follow-up plan can leave dependent infrastructure misaligned. The stated case instead calls for: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

D.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent. Verify the result with this test: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.

Question 247

A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. The infrastructure engineer proposes this change: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Which mechanism explains why it works?

  1. Backend initialization may require state migration; reconfiguration tells Terraform to forget prior local backend initialization without copying old state automatically.
  2. A saved plan fixes the selected actions for approval while still requiring safeguards against stale state and leaked sensitive values in plan artifacts.
  3. Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.
  4. Target selection can produce partial changes outside normal graph reconciliation, so skipping a full follow-up plan can leave dependent infrastructure misaligned.

Answer & Explanations

Correct answer: C

A.

Backend initialization may require state migration; reconfiguration tells Terraform to forget prior local backend initialization without copying old state automatically. That explains “Handle backend reconfiguration and migration deliberately”, not the mechanism behind the described change. The relevant principle is: Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

B.

A saved plan fixes the selected actions for approval while still requiring safeguards against stale state and leaked sensitive values in plan artifacts. That explains “Save an execution plan artifact for controlled apply”, not the mechanism behind the described change. The relevant principle is: Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

C.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent. The corresponding implementation is: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

D.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Target selection can produce partial changes outside normal graph reconciliation, so skipping a full follow-up plan can leave dependent infrastructure misaligned. That explains “Avoid routine targeting as a substitute for normal lifecycle review”, not the mechanism behind the described change. The relevant principle is: Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

Question 248

A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. After implementing this change—Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.—which test most directly validates its intended outcome?

  1. Test a local-to-remote backend move on disposable state, inspect source and destination snapshots, and confirm a subsequent plan preserves resource addresses.
  2. Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.
  3. Execute a deliberately scoped disposable cleanup, then perform a full plan and verify no unintended dependency drift remains.
  4. Generate a protected test plan, review intended creates and deletes, then execute terraform apply with that saved file and verify the resulting object IDs.

Answer & Explanations

Correct answer: B

A.

Test a local-to-remote backend move on disposable state, inspect source and destination snapshots, and confirm a subsequent plan preserves resource addresses. That would help test “Handle backend reconfiguration and migration deliberately”, not the outcome required in this scenario. The relevant acceptance check is: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.

B.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone. This check is decisive because destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

C.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Execute a deliberately scoped disposable cleanup, then perform a full plan and verify no unintended dependency drift remains. That would help test “Avoid routine targeting as a substitute for normal lifecycle review”, not the outcome required in this scenario. The relevant acceptance check is: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.

D.

Generate a protected test plan, review intended creates and deletes, then execute terraform apply with that saved file and verify the resulting object IDs. That would help test “Save an execution plan artifact for controlled apply”, not the outcome required in this scenario. The relevant acceptance check is: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.

Question 249

A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Which proposed shortcut most directly risks permanent loss of unrelated managed infrastructure or stored data and should therefore be rejected?

  1. Approve one displayed plan but later run an unrelated unreviewed apply after intervening configuration edits.
  2. Destroy one selected resource with a targeted option and declare the environment fully reconciled without reviewing its dependencies.
  3. Replace a backend block and force reconfigure without checking where the original state went, assuming Terraform silently copies all resource bindings.
  4. Run terraform destroy in a shared production backend assuming it deletes only temporary resources from the current terminal session.

Answer & Explanations

Correct answer: D

A.

Approve one displayed plan but later run an unrelated unreviewed apply after intervening configuration edits. That shortcut risks production changes that differ from the reviewed execution plan. Here the specific shortcut is: Run terraform destroy in a shared production backend assuming it deletes only temporary resources from the current terminal session.

B.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Destroy one selected resource with a targeted option and declare the environment fully reconciled without reviewing its dependencies. That shortcut risks broken dependent resources and incomplete infrastructure convergence. Here the specific shortcut is: Run terraform destroy in a shared production backend assuming it deletes only temporary resources from the current terminal session.

C.

Replace a backend block and force reconfigure without checking where the original state went, assuming Terraform silently copies all resource bindings. That shortcut risks resource loss-of-tracking or duplicate proposals after an incomplete backend change. Here the specific shortcut is: Run terraform destroy in a shared production backend assuming it deletes only temporary resources from the current terminal session.

D.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Run terraform destroy in a shared production backend assuming it deletes only temporary resources from the current terminal session. The foreseeable failure is permanent loss of unrelated managed infrastructure or stored data. The safer response is: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

Question 250

A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Which combined implementation and verification plan is the best match for this workload?

  1. Implement: Prefer a full configuration plan and use targeted operations only for carefully justified recovery after evaluating dependencies and state consistency. Verify: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.
  2. Implement: When changing backend settings, choose the appropriate terraform init -migrate-state or -reconfigure workflow after safeguarding the existing state and validating target storage. Verify: Test a local-to-remote backend move on disposable state, inspect source and destination snapshots, and confirm a subsequent plan preserves resource addresses.
  3. Implement: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Verify: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.
  4. Implement: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Verify: Execute a deliberately scoped disposable cleanup, then perform a full plan and verify no unintended dependency drift remains.

Answer & Explanations

Correct answer: C

A.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. The test would be relevant: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone. But the offered implementation—Prefer a full configuration plan and use targeted operations only for carefully justified recovery after evaluating dependencies and state consistency.—addresses “Avoid routine targeting as a substitute for normal lifecycle review”. The action needed here is: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

B.

This action/test pair addresses “Handle backend reconfiguration and migration deliberately”. When changing backend settings, choose the appropriate terraform init -migrate-state or -reconfigure workflow after safeguarding the existing state and validating target storage. Test a local-to-remote backend move on disposable state, inspect source and destination snapshots, and confirm a subsequent plan preserves resource addresses. The case instead calls for: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove.

C.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. Confirm it through this test: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone. Destroy asks providers to delete managed resources in the selected state, including dependencies; it can permanently remove data if safeguards are absent.

D.

The question is set in this situation: A research team decommissions a temporary test environment and must verify the plan does not include a shared persistent database. The action is applicable: Run terraform plan -destroy or a reviewed terraform destroy in the exact disposable environment and confirm all listed objects are safe to remove. But its proposed test—Execute a deliberately scoped disposable cleanup, then perform a full plan and verify no unintended dependency drift remains.—addresses “Avoid routine targeting as a substitute for normal lifecycle review”. This requirement is confirmed instead by: Create a small isolated test stack, inspect the destroy plan, perform removal and verify the remote objects and state addresses are gone.

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