Move a resource in state
Rename or move a resource without destroying and recreating it
terraform state mv old.address new.address
More terraform commands
-
terraform workspace listShow all workspaces; the current one is marked with *
-
terraform workspace new staging && terraform workspace select stagingCreate a new workspace and switch to it
-
terraform validateCheck Terraform configuration for syntax and consistency errors
-
terraform fmt -recursiveAuto-format all .tf files recursively
-
terraform output -jsonPrint all outputs as JSON; handy in pipeline scripts