Refresh state

Update state file to match real infrastructure

terraform refresh -var-file=prod.tfvars

tool
terraform43 commands
tags
terraform

More terraform commands

  • 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

  • terraform plan -var-file=prod.tfvars -out=prod.tfplan

    Generate plan with prod variables, save to file

all 43 terraform commands