What this thread does
Do first: run -refresh-only planning mode in the intended workspace to inspect remote changes, then decide whether each change should be accepted or reverted.
Short answer
As of November 2026, this card uses Terraform 1.17.1, October 28, 2026. Refresh-only proposes state/output reconciliation; it does not repair infrastructure or rewrite configuration. Normal planning compares current configuration to the prior state (planning modes). A resource rename needs an address move, not acceptance of an unrelated delete/create.
Choose / don't choose
- Accept remote drift: choose a reviewed refresh-only apply plus corresponding configuration change; do not assume updating state permanently accepts a mismatch in configuration.
- Restore declared configuration: choose a normal repair plan; do not hide the affected attribute with ignore_changes.
- Shared ownership: choose narrowly ignored attributes only when another controller intentionally owns them.
Not for: state-lock incidents; see terraform-s3-error-acquiring-state-lock-owner-or-permissions.
Settings that matter
| Setting or flag | Value / default | Applies to | Source |
|---|---|---|---|
-refresh-only planning mode | Inspect state/output changes only; apply the reviewed refresh-only plan to persist accepted state | Terraform baseline above | plan |
ignore_changes | Example [tags] only if an external controller owns tags; avoid all for a drift repair | Resource lifecycle; baseline above | lifecycle |
prevent_destroy | true rejects destroy plans while present in configuration; removing the resource block removes this protection | Resource lifecycle; baseline above | lifecycle |
moved | Set from to old address and to to new address before planning the rename; retain historical moves | Resource/module refactoring; baseline above | refactoring |
terraform plan -out | tfplan saves the actual reviewed plan; artifact may contain cleartext sensitive values | CLI baseline above | plan |
Order of operations
1. Confirm backend/workspace, configuration revision and dependency lock selection. Pause competing changes and retain a protected backend snapshot before state mutation. Compare remote reality, configuration and recorded resource address; do not hand-edit state to make a diff disappear. 2. For a rename add the moved block first and confirm the plan preserves the remote object. For accepted drift update desired configuration as appropriate; for unwanted drift leave the desired value and plan its repair (refactoring). 3. If prevent_destroy blocks planning, inspect the resource address, changed immutable arguments, provider/version diff, count/for_each keys and replacement triggers. Compare the provider resource documentation with the exact plan reason. beanaroo’s October 18, 2017 report documents limited diagnostics; disabling protection in a disposable diagnostic configuration is not authorization to apply. 4. Generate the final normal repair plan with terraform plan -out=tfplan; inspect terraform show tfplan and, for automation, terraform show -json tfplan. Account for every delete/replacement. Re-review if state or configuration changes (show). 5. Apply only the approved artifact with terraform apply tfplan; without an artifact apply generates a new plan. Saved-plan application treats the file as approval, so gate access to it. Re-plan after completion and inspect remaining drift (apply modes).
Known failures and fixes
| Error (short quote) | Cause | Fix | Source |
|---|---|---|---|
Error: Instance cannot be destroyed | Lifecycle protection rejects a required delete/replacement; this can hide the initiating diff | Trace configuration/address/provider changes before relaxing the guard; do not apply a diagnostic plan with protection removed | beanaroo report |
forces new resource | The report requests a reason for replacement | For an address-only rename use moved; for a genuine immutable change choose rollback or explicitly reviewed replacement rather than suppressing all drift | report; refactoring |
Missing
- The resource type, provider schema and actual plan are unknown; no specific ignore_changes list or replacement-free repair can be promised. A saved plan is a review artifact, not a lock on remote infrastructure.
Checked
2026-11-12; HashiCorp; Terraform 1.17.1 (release); plan, lifecycle, refactoring, show/apply references and beanaroo report read. No application commands were executed.
Started from a post by @HashiCorp, packaged by the editor. Original post