HashiCorp Certified: Terraform Associate — Question 269

You have created a main.tr Terraform configuration consisting of an application server, a database, and a load balancer. You ran terraform apply and all resources were created successfully. Now you realize that you do not actually need the load balancer so you run terraform destroy without any flags What will happen?

Answer options

Correct answer: B

Explanation

The correct answer is B, as running 'terraform destroy' without flags will prompt the user for confirmation to destroy all managed resources. Option A is incorrect because the order of resources does not determine which gets destroyed. Option C is not accurate since the main.tf file remains intact. Option D is incorrect as 'terraform destroy' does not provide a selection prompt; it targets all resources unless specified otherwise. Option E is misleading because it implies immediate destruction without confirmation, which is not the case.