Interview Prep/Terraform/Workflow and Providers

Before tearing down a short-lived test environment, how do you see exactly what will be destroyed?

BeginnerScenarioWorkflow and Providers
Answer

Situation read → Destroy is irreversible, so preview it.

What I'd do →

  1. terraform plan -destroy -out=destroy.tfplan
  2. Review the list; check for shared or prevent_destroy resources.
  3. terraform apply destroy.tfplan

Why → terraform destroy is just a plan with destroy mode plus an apply. Running it as two steps gives a review point, and the same pattern works in CI.

Interview tip → Never use -auto-approve on destroy against anything resembling production.

All Terraform questions Roadmap: Terraform

More on Workflow and Providers