terraform-destroy
Destroy Terraform-managed infrastructure
TLDR
Destroy all resources in the current configuration
SYNOPSIS
terraform destroy [options]
DESCRIPTION
terraform destroy permanently deletes all infrastructure resources tracked in the current Terraform state file. It is a convenience alias for terraform apply -destroy.
The command reads the state file to identify managed resources, validates state against cloud provider APIs, builds a dependency graph to determine the correct reverse destruction order, presents a plan for confirmation, and then deletes resources via provider APIs. After completion, it updates the state file to reflect that the resources no longer exist.
It is designed primarily for ephemeral infrastructure in development and testing environments. For production, it should only be used in controlled decommissioning scenarios.
PARAMETERS
-auto-approve
Skip the interactive confirmation prompt-target=RESOURCE
Destroy only the specified resource and its dependencies. Can be specified multiple times.-var 'NAME=VALUE'
Set an input variable value. Can be specified multiple times.-var-file=PATH
Load variable values from a file-lock=BOOL
Control whether Terraform locks the state file. Default: true.-lock-timeout=DURATION
How long to wait to acquire the state lock. Example: 20s.-parallelism=N
Limit concurrent resource operations. Default: 10.-refresh=BOOL
Whether to refresh state before planning. Default: true.-state=PATH
Path to the state file. Default: terraform.tfstate.-no-color
Disable color output
CAVEATS
This command is irreversible. Once resources are destroyed, the cloud provider removes them permanently and Terraform cannot restore them. If a destroy operation fails partway through, you may end up in a partially destroyed state. The command operates exclusively based on the state file and has no awareness of resources not tracked in state. Resources with deletion protection enabled at the provider level cannot be destroyed until protection is manually disabled. Configurations using lifecycle { prevent_destroy = true } will cause the destroy to fail with an error. Using -target for selective destruction can leave infrastructure in an inconsistent state and should be reserved for exceptional situations.
HISTORY
Terraform was created by Mitchell Hashimoto and Armon Dadgar at HashiCorp, with v0.1.0 released in July 2014. The destroy subcommand has been part of Terraform's core workflow since the earliest releases. In v0.15.2 (April 2021), terraform apply -destroy was added as the explicit form, making terraform destroy an official convenience alias. Terraform reached general availability with v1.0.0 in June 2021.
SEE ALSO
terraform(1), terraform-plan(1), terraform-apply(1)

