Using Terraform CLI, how do you destroy all infrastructure that is present in your Terraform state?

Experience Level: Junior
Tags: Terraform

Answer

There are multiple options:

Option 1:

Run the following command:

terraform apply -destroy

Option 2:

Run the following command:

terraform destroy

Option 3:

Run the following command:

terraform plan -destroy -out=plan.zip
terraform apply plan.zip

Comments

No Comments Yet.
Be the first to tell us what you think.
Terraform CLI
Terraform CLI

Are you learning Terraform ? Try our test we designed to help you progress faster.

Test yourself