A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://developer.hashicorp.com/terraform/cli/commands/destroy below:

terraform destroy command reference | Terraform

terraform destroy command

The terraform destroy command deprovisions all objects managed by a Terraform configuration.

While you will typically not want to destroy long-lived objects in a production environment, Terraform is sometimes used to manage ephemeral infrastructure for development purposes, in which case you can use terraform destroy to conveniently clean up all of those temporary objects once you are finished with your work.

Usage: terraform destroy [options]

This command is just a convenience alias for the following command:

For that reason, this command accepts most of the options that terraform apply accepts, although it does not accept a plan file argument and forces the selection of the "destroy" planning mode.

You can also create a speculative destroy plan, to see what the effect of destroying would be, by running the following command:

This will run terraform plan in destroy mode, showing you the proposed destroy changes without executing them.

Note: The -destroy option to terraform apply exists only in Terraform v0.15.2 and later. For earlier versions, you must use terraform destroy to get the effect of terraform apply -destroy.

Target a specific resource

You can use the -target option to destroy a particular resource and its dependencies. For example, if your Terraform configuration contained a aws_instance resource with the label example, you could destroy that resource with the following command.

terraform destroy -target aws_instance.example

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4