HashiCorp Certified: Terraform Associate — Question 237
What does terraform destroy do?
Answer options
- A. Destroys the Terraform state file, leaves the infrastructure intact.
- B. Destroys all Terraform code files in the current directory, leaves the state file intact.
- C. Destroy all infrastructure in the Terraform state file.
- D. Destroys all infrastructure in the configured Terraform provider.
Correct answer: C
Explanation
The correct answer is C because the terraform destroy command is specifically designed to remove all infrastructure that is currently managed by the Terraform state file. Options A and B incorrectly describe the impact on the state file and code files, while option D is misleading as it suggests that all infrastructure from the provider is destroyed without specifying the state file context.