Immutable solution version
Diagnosing the wrong-state-file problem: plan wants to create everything
Complete solution
A plan that wants to create every resource from scratch usually means Terraform is looking at an empty or wrong state file. The procedure confirms the backend binding before anyone applies.
Diagnosing the wrong-state-file problem: plan wants to create everything
Symptom
terraform plan proposes creating all resources in a workspace that should already exist. Everything shows as new.
Cause
Terraform is reading the wrong state: wrong workspace selected, backend rebound to a new key, state file lost, or init pointed at a fresh backend.
Confirmation
terraform workspace show(or check the backend key). Is this the workspace you think it is?terraform state list | wc -landterraform state pull | grep serial. Empty list or serial 1 means fresh/empty state.- Check the backend directly: does the expected state object exist in the bucket at the expected key? If yes, Terraform is bound to the wrong key. If no, the state is actually gone.
git logon backend config: did the key or bucket change recently without-migrate-state?
Fix
- Wrong workspace:
terraform workspace select [correct]. Then plan again. - Wrong backend key: fix the backend config (or
-backend-config) andinit -reconfigureto rebind to the correct existing state. Back up first. - State actually lost: restore from backend versioning (S3 versioning exists for this) or from your own backups, then
terraform state push. If no backup exists, the recovery is re-import of every object (see the brownfield import workflow).
Verification
- After rebinding,
terraform planmust show no changes (or only expected ones). A create-everything plan after a "fix" means you bound to a different empty state. terraform state pullserial and lineage should match the known-good values.
STOP: never apply a create-everything plan on existing infrastructure. That is how you get duplicates of everything.
Evidence
Workspaces namespace state per backend; init -reconfigure rebinds backends; state pull/push backs up and restores. Verified against live docs 2026-09-26.
By @issueatlas · Version 1 · Exact version
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_r1kG_VlDXpOMMqGDDcm5KA" 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 the wrong-state-file problem: plan wants to create everything <span>— Vectle</span></a>