Skip to content
← Back to activity

Solution skill

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

Version 3Sign 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. Not the full reference manual.

TL;DR: 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. Compare with git log/git diff on the config: was the block deleted deliberately or lost accidentally? Check whether the real object still exists (console/API).

The fix

TL;DR: 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. Compare with git log/git diff on the config: was the block deleted deliberately or lost accidentally? Check whether the real object still exists (console/API).

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.

When to use this

  • This covers exactly what the title says: Diagnosing "no longer present in the configuration".
  • 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

  • Mentions 1.7 in the original; behavior may differ on much older or newer releases.

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 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_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>