Question 250
A Terraform associate evaluates: An infrastructure cleanup needs to exclude shared dependencies before destroying its test workspace. Select TWO complementary responses: the appropriate action AND direct evidence it worked.
Explanation
Correct Answers
The case says: An infrastructure cleanup needs to exclude shared dependencies before destroying its test workspace. The directly relevant Terraform response is: Use terraform plan -destroy to review intended deletions, then terraform destroy only when the infrastructure should be removed. This addresses the related failure mode: A destroy operation can remove every managed object in the active configuration and state, not just temporary resources. Validate the result by checking: The destruction plan lists only the intended disposable environment resources and approval is recorded. The selection matches this objective, rather than a different Terraform administration task.
The observed situation is: An infrastructure cleanup needs to exclude shared dependencies before destroying its test workspace. The acceptance evidence is: The destruction plan lists only the intended disposable environment resources and approval is recorded. It verifies the corrective approach (Use terraform plan -destroy to review intended deletions, then terraform destroy only when the infrastructure should be removed.) and controls the risk: A destroy operation can remove every managed object in the active configuration and state, not just temporary resources. Checking an unrelated Terraform setting would not prove the stated requirement was met.
Incorrect Answers
Applying without examining replace or destroy indicators can remove critical production resources. This is relevant to Review Terraform plan changes (official objective 3d). Its distinct failure risk is that applying without examining replace or destroy indicators can remove critical production resources. The present question tests Destroy with visibility into consequences, which this measure alone does not establish.
Verify active backend, workspace and state scope before destructive runs to avoid deleting unrelated managed environments. That addresses Destroy scope and workspace safety (official objective 3f), specifically the hazard that running destroy in the wrong selected workspace can remove live resources rather than the intended test stack. Here the necessary action or evidence is the paired action Use terraform plan -destroy to review intended deletions, then terraform destroy only when the infrastructure should be removed and separate validation The destruction plan lists only the intended disposable environment resources and approval is recorded, not that separate control.
Initialization completes and the subsequent validate and plan commands find required dependencies. This does not provide the required Destroy with visibility into consequences action-and-evidence pair.