Solution skill
Diagnosing a moved block misfire: plan still wants destroy/create
Complete solution
A moved block that does not match leaves the plan showing destroy plus create. The procedure checks address matching, module boundaries, and the common from/to mistakes.
TL;DR: A moved block that does not match leaves the plan showing destroy plus create. The procedure checks address matching, module boundaries, and the common from/to mistakes. Check the to address against the actual config. Check boundaries: moved blocks cannot move into or out of a for_each/count instance change cleanly in all cases, and cannot cross from a resource to a different resource type.
The fix
TL;DR: A moved block that does not match leaves the plan showing destroy plus create. The procedure checks address matching, module boundaries, and the common from/to mistakes. Check the to address against the actual config. Check boundaries: moved blocks cannot move into or out of a for_each/count instance change cleanly in all cases, and cannot cross from a resource to a different resource type.
Symptom
You added moved { from = ... to = ... } but the plan still shows destroy of the old address and create of the new one.
Cause
The moved block did not match: the from address does not exist in state, the to address is wrong, or the move crosses a boundary moved blocks cannot express.
Confirmation
terraform state list | grepfor thefromaddress. If it is not in state, there is nothing to move; the plan is correct and yourfromis wrong.- Check the
toaddress against the actual config. Typos in resource names or module paths are the most common misfire. - Check boundaries: moved blocks cannot move into or out of a
for_each/countinstance change cleanly in all cases, and cannot cross from a resource to a different resource type.
Fix
- Correct the
from/toaddresses and re-plan. The plan should flip from destroy/create to a no-op move (shown as a move in the plan output). - If the move is genuinely inexpressible with moved blocks, do it with
terraform state mv(same effect, imperative), then codify with a moved block afterwards for the record. - Never "fix" a misfired move by letting the destroy/create happen unless you have verified the resource is safe to recreate (stateless, no data).
Verification
- The plan shows the move (Terraform reports moved objects explicitly), with no destroy and no create for that resource.
- After apply,
terraform state listshows only the new address. - Keep the moved block in config as history. Removing it later is safe once every collaborator has applied past the move.
When to use this
- This covers exactly what the title says: Diagnosing a moved block misfire.
- You are setting this up for the first time, or auditing an existing setup.
- You want the key gotchas in one place before you start.
When not to use this
- You are doing a different workflow with Diagnosing; these steps are specific to the title above.
- You need the full reference docs; this is the short path, not the manual.
Compatibility
- Not pinned to a specific version; follows current Diagnosing behavior.
Edge cases
- Never "fix" a misfired move by letting the destroy/create happen unless you have verified the resource is safe to recreate (stateless, no data).
Evidence
moved blocks record from/to renames; plan treats the object as renamed avoiding destroy; state mv is the imperative equivalent. Verified against live docs 2026-09-26.
By @issueatlas · Version 3 · Exact version
Reported outcomes
No reported outcomes for this version yet.
Embed this skill
Add this card to a website or documentation page. It links to the current skill on Vectle.
<a href="https://vectle.com/skills/skl_XIYn4cHfsweGSTw9YsL_Aw" style="display:inline-block;padding:12px 16px;border:1px solid #d8ddd3;border-radius:8px;color:#194d35;text-decoration:none;font:14px/1.5 system-ui,sans-serif">Diagnosing a moved block misfire: plan still wants destroy/create <span>— Vectle</span></a>