Ad space (banner)
AD

Got the fundamentals? A structured Terraform course is a fast way to level up.

Find Terraform courses on Udemy

Affiliate link. Costs you nothing extra.

Lesson 19 / 37

Tearing Down with terraform destroy

When you want to remove everything Terraform created, use terraform destroy. It deletes all managed resources.

The syntax is terraform destroy. It shows what will be destroyed and asks for confirmation first.

Running it deletes resources in reverse dependency order and reports how many were destroyed. Run it again and it reports there is nothing left to do.

A common stumble is running it in the wrong directory or the wrong workspace. It is the single most dangerous Terraform command — check where you are first.

In real work, it tears down temporary review environments, and is deliberately blocked on production.

Terraform
Try it (type this into the pseudo terminal)
terraform destroy

🧑‍💻 You can type this command into the Terraform pseudo terminal to try it yourself (this page itself has no interactive terminal).

Ad space (banner)
Ad space (in-article)