HashiCorp Certified: Terraform Associate — Question 277
You have used Terraform to create an ephemeral development environment in the cloud and are now ready to destroy all the infrastructure described by your
Terraform configuration. To be safe, you would like to first see all the infrastructure that will be deleted by Terraform.
Which command should you use to show all of the resources that will be deleted? (Choose two.)
Answer options
- A. Run terraform plan -destroy
- B. Run terraform show -destroy
- C. Run terraform destroy and it will first output all the resources that will be deleted before prompting for approval
- D. Run terraform show -destroy
Correct answer: A, C
Explanation
The correct answers are A and C. Running 'terraform plan -destroy' provides a detailed plan of the resources that will be deleted, while 'terraform destroy' gives a list of resources before requesting confirmation. Options B and D are incorrect as 'terraform show -destroy' is not a valid command for previewing deletions.