terraform-safe-changeslisted
Install: claude install-skill riteshsonawane1372/devops-skills
# Terraform Safe Changes
Apply infrastructure changes so that the worst outcome is a failed apply, not a deleted database.
## Purpose
**Use this when:**
- Applying a Terraform change to production.
- Refactoring modules, renaming resources, or moving resources between states.
- Importing existing infrastructure into Terraform.
- A plan wants to replace or destroy something that must survive.
- A previous apply failed partway and state no longer matches reality.
**Do not use this when:**
- You are only assessing a plan — use `terraform-review` first. Review precedes execution, always.
- Terraform itself is erroring — use `terraform-troubleshooting`.
**What this skill assumes:** a remote backend with locking and versioning, credentials for the
target environment, and the ability to take a backup of whatever is at risk. If state is local and
unversioned, fix that before making any production change.
## Operating Procedure
Terraform has no undo. The procedure exists because of that.
1. **Confirm the target.** Workspace, backend, account, region. Print them; do not assume.
2. **Back up state.** A copy of state before the change is your only recovery path for state
corruption.
3. **Plan to a file** and review it (`terraform-review`). Never apply an unreviewed plan.
4. **Classify the change**: additive, in-place, replacement, or destroy. The rest of the procedure
depends on which.
5. **Guard what must not die.** `prevent_destroy` on stateful resources, before the app