nerdexam
HashiCorp

TA-002-P · Question #400

What does terraform destroy do?

The correct answer is A. Destroy all infrastructure in the Terraform state file. The terraform destroy command terminates resources managed by your Terraform project. This command is the inverse of terraform apply in that it terminates all the resources specified in your Terraform state. It does not destroy resources running elsewhere that are not managed by

Use the Terraform CLI (terraform plan, apply, destroy, fmt, init, validate, workspace, import, taint, providers, output)

Question

What does terraform destroy do?

Options

  • ADestroy all infrastructure in the Terraform state file
  • BDestroy all Terraform code files in the current directory while leaving the state file intact
  • CDestroy all infrastructure in the configured Terraform provider
  • DDestroy the Terraform state file while leaving infrastructure intact

How the community answered

(21 responses)
  • A
    90% (19)
  • C
    5% (1)
  • D
    5% (1)

Explanation

The terraform destroy command terminates resources managed by your Terraform project. This command is the inverse of terraform apply in that it terminates all the resources specified in your Terraform state. It does not destroy resources running elsewhere that are not managed by the current Terraform project. https://learn.hashicorp.com/tutorials/terraform/aws-destroy

Topics

#terraform destroy#Terraform CLI#infrastructure management#state file

Community Discussion

No community discussion yet for this question.

Full TA-002-P Practice