nerdexam
HashiCorp

TERRAFORM-ASSOCIATE-004 · Question #39

You have created a main.tf Terraform configuration consisting of an application server, a database and a load balanced. You ran terraform apply and Terraform created all of the resources successfully.

The correct answer is C. Terraform will prompt you to confirm that you want to destroy all the infrastructure. This is what will happen if you run terraform destroy without any flags, as it will attempt to delete all the resources that are associated with your current working directory or workspace. You can use the - target flag to specify a particular resource that you want to destroy.

Submitted by alyssa_d· Apr 18, 2026Use Terraform CLI

Question

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

Options

  • ATerraform will prompt you to pick which resource you want to destroy
  • BTerraform will destroy the application server because it is listed first in the code
  • CTerraform will prompt you to confirm that you want to destroy all the infrastructure
  • DTerraform will destroy the main, tf file
  • ETerraform will immediately destroy all the infrastructure

How the community answered

(69 responses)
  • A
    3% (2)
  • C
    88% (61)
  • D
    7% (5)
  • E
    1% (1)

Explanation

This is what will happen if you run terraform destroy without any flags, as it will attempt to delete all the resources that are associated with your current working directory or workspace. You can use the - target flag to specify a particular resource that you want to destroy.

Topics

#terraform destroy#Terraform CLI#Resource lifecycle#Confirmation prompt

Community Discussion

No community discussion yet for this question.

Full TERRAFORM-ASSOCIATE-004 Practice