HashiCorp Certified: Terraform Associate — Question 308

What does terraform destroy do?

Answer options

Correct answer: A

Explanation

The correct answer is A because the terraform destroy command is specifically designed to remove all resources defined in the Terraform state file. Option B is incorrect as it refers to deleting code files instead of infrastructure. Option C is misleading since it suggests destruction of resources tied to the provider without mentioning the state file. Option D incorrectly states that the state file can be removed while leaving the infrastructure intact, which is not the purpose of the command.