← ClaudeAtlas

terraform-safe-changeslisted

Execute Terraform or OpenTofu changes against live infrastructure without causing an outage - staged applies, plan files, lifecycle guards, moved blocks instead of replacements, imports, state surgery, and rollback. Use when applying infrastructure changes to production, refactoring modules, renaming resources, importing existing infrastructure, or when a plan wants to destroy something it should not.
riteshsonawane1372/devops-skills · ★ 0 · DevOps & Infrastructure · score 66
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