Destroy one resource

Destroy one resource without a full plan and without confirmation (-auto-approve)

terraform destroy -target='aws_instance.web' -auto-approve

tool
terraform43 commands
tags
terraform

More terraform commands

  • terraform force-unlock <lock-id>

    Release a stuck state lock after a failed apply

  • terraform workspace new staging && terraform workspace select staging

    Create a new workspace and switch to it

  • terraform graph | dot -Tsvg > graph.svg && open graph.svg

    Render the resource dependency graph as SVG and open it (needs Graphviz)

  • terraform providers lock -platform=linux_amd64 -platform=darwin_arm64

    Lock 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

all 43 terraform commands