QuestionQ106

Core Terraform workflow

You create a main.tf Terraform configuration that includes an application server, a database, and a load balancer. You run terraform apply, and Terraform successfully creates all resources.

You then realize you do not actually need the load balancer, so you run terraform destroy without any flags.

What will occur?

  • A Terraform will prompt you to confirm that you want to destroy all the infrastructure.
  • B Terraform will prompt you to pick which resource you want to destroy.
  • C Terraform will immediately destroy all the infrastructure.
  • D Terraform will destroy the application server because it is listed first in the code.
  • E Terraform will destroy the main.tf file.
Explanation

terraform destroy creates a destroy plan for all resources managed by the current working directory and workspace. Like terraform apply, it asks for confirmation before proceeding unless an approval-bypass flag is supplied. Terraform workflow documentation

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!