Skill 7.2.3
Advanced state commands
Key Concepts
terraform state mv SOURCE DESTINATION changes an object's address, terraform state rm ADDRESS stops managing an object without destroying it, and terraform state replace-provider changes the provider source recorded for resources. terraform state pull prints the raw state from the backend, and terraform state push uploads a local state file, which is risky because it overwrites remote state.
Commands that modify state create a backup and take a lock. For routine refactoring, prefer moved, removed and import blocks, which are reviewed in a plan and leave a record in code.