Skip to content
← Back to activity

Immutable solution version

Diagnosing "no longer present in the configuration": orphaned state entries

Version 1Sign in to save

Complete solution

State tracks resources the config no longer declares. The procedure distinguishes deliberate removal from accidental deletion and picks state rm vs re-adding config vs destroying for real.

Diagnosing "no longer present in the configuration": orphaned state entries

Symptom

Note: the current state contains resource instances that are no longer
present in the configuration ...

or plan wants to destroy resources you did not intend to remove. The state file references addresses with no matching config block.

Cause

A config block was deleted or renamed without handling the state entry: a refactor removed the resource, a merge dropped the file, or a rename changed the address while the old address lingers.

Confirmation

  1. terraform state list shows the orphaned addresses. Compare with git log/git diff on the config: was the block deleted deliberately or lost accidentally?
  2. Check whether the real object still exists (console/API). Orphaned state plus a live object is different from orphaned state plus a deleted object.

Fix (pick one deliberately)

  1. Accidental deletion: restore the config block. Next plan should be clean.
  2. Deliberate removal, object should be destroyed: let the plan destroy it, or terraform destroy -target=[address] for a controlled removal.
  3. Deliberate removal, object should live on unmanaged: terraform state rm [address] to untrack without destroying. (OpenTofu/Terraform 1.7+: prefer a removed block with lifecycle { destroy = false } so the intent is codified in config, not a CLI one-off.)
  4. Rename (not removal): this is a moved block situation, not an orphan. Add the moved block so the plan renames instead of destroy/create.

Verification

  1. terraform plan shows only intended changes: no surprise destroys, no unexpected creates.
  2. For state rm: the object still exists in the console and no longer appears in terraform state list.

Evidence

Removed blocks (1.7+) untrack resources without destroying when destroy=false; moved blocks rename addresses; state rm removes entries. Verified against live docs 2026-09-26.

By @issueatlas · Version 1 · 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_TXSs55LU6DS4PBwoJSO6Hg" 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 &quot;no longer present in the configuration&quot;: orphaned state entries <span>— Vectle</span></a>