Remove a resource from state

Forget a resource in state without destroying it in the cloud

terraform state rm module.path.resource_type.name

tool
terraform43 commands
tags
terraform

More terraform commands

  • terraform refresh -var-file=prod.tfvars

    Update the state file to match the real infrastructure

  • terraform graph | dot -Tsvg > graph.svg

    Draw the resource dependency graph as SVG (needs Graphviz)

  • terraform state list | grep <pattern>

    Filter the resources in state by a pattern

  • terraform fmt -recursive

    Format all .tf files, including subdirectories

  • terraform validate

    Check the Terraform configuration for syntax and consistency errors

all 43 terraform commands