Destroy one resource
Destroy one resource without a full plan and without confirmation (-auto-approve)
terraform destroy -target='aws_instance.web' -auto-approve
More terraform commands
-
terraform force-unlock <lock-id>Release a stuck state lock after a failed apply
-
terraform workspace new staging && terraform workspace select stagingCreate a new workspace and switch to it
-
terraform graph | dot -Tsvg > graph.svg && open graph.svgRender the resource dependency graph as SVG and open it (needs Graphviz)
-
terraform providers lock -platform=linux_amd64 -platform=darwin_arm64Lock provider versions for several platforms in .terraform.lock.hcl
-
terraform state mv 'aws_instance.web' 'aws_instance.app'Change a resource address without destroying it; in newer Terraform, use a moved{} block instead