Remove resource from state

Forget a resource from state without destroying it in cloud

terraform state rm module.path.resource_type.name

tool
terraform43 commands
tags
terraform

More terraform commands

  • terraform refresh -var-file=prod.tfvars

    Update state file to match real infrastructure

  • terraform graph | dot -Tsvg > graph.svg

    Visualize resource dependency graph (requires Graphviz)

  • terraform state list | grep <pattern>

    Filter state resources by pattern

  • terraform fmt -recursive

    Recursively format all .tf files in subdirectories

  • terraform validate

    Check configuration syntax without accessing remote state

all 43 terraform commands