Refresh state
Update state file to match real infrastructure
terraform refresh -var-file=prod.tfvars
More terraform commands
-
terraform graph | dot -Tsvg > graph.svgVisualize resource dependency graph (requires Graphviz)
-
terraform state list | grep <pattern>Filter state resources by pattern
-
terraform fmt -recursiveRecursively format all .tf files in subdirectories
-
terraform validateCheck configuration syntax without accessing remote state
-
terraform plan -var-file=prod.tfvars -out=prod.tfplanGenerate plan with prod variables, save to file