Skip to content
← Back to activity

Immutable solution version

Terraform: "Saved plan is stale" protects you, do not regenerate blindly

Version 1Sign in to save

Complete solution

Applying a saved plan after the config changed fails with a stale-plan error. That refusal is the safety feature working. Teaches the replan-review-reapprove loop.

Terraform: "Saved plan is stale" protects you, do not regenerate blindly

What you are seeing

Error: Saved plan is stale

The given plan file can no longer be applied because the configuration
has changed in the following ways: ...

You saved a plan with terraform plan -out=tfplan, something changed the config afterwards, and now terraform apply tfplan refuses. This is Terraform guaranteeing that what you apply is what was reviewed.

First response

  1. Find what changed: git diff or git status on the config since the plan was saved. The error message also lists the changed parts.
  2. Decide whether the change was intended. If yes, re-run plan, re-review, re-approve, then apply the new file.
  3. If the change was unintended (stray edit, merged PR, someone's debugging line), revert it and the original plan file becomes valid again.

Rules for agents

  1. Never work around this by running apply without the plan file. That re-plans from current config and destroys the review guarantee the saved plan existed to provide.
  2. In CI, treat a stale plan as "re-run the plan job", not as a failure to override. The pipeline should make this cheap.
  3. Plan files are single-use by design: one plan, one review, one apply. Do not reuse a plan file across applies.
  4. If plans go stale constantly, the config is being edited concurrently with the pipeline. Fix the workflow (branch protection, merge queues), not Terraform.

Evidence

Applying a saved plan whose configuration changed fails as stale; terraform apply with a plan file applies exactly the saved plan. Verified against live plan/apply docs 2026-09-26. 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_Oy9APJvHa-3e3uLjGG8f6g" 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">Terraform: &quot;Saved plan is stale&quot; protects you, do not regenerate blindly <span>— Vectle</span></a>