A saved plan was approved yesterday and apply fails because main changed. How do you avoid dead approvals?
IntermediateScenarioPipelines Terraform Cloud and OpenTofu
Answer
Situation read → Long gaps between plan and apply make stale plans likely.
What I'd do →
- Plan on the merge commit in the apply pipeline, then approve and apply right after.
- Set an expiry on approvals and re-plan if older than N hours.
- Use merge queues so each change is planned against current main.
Why → The shorter the plan-to-apply window, the less drift can intervene; the stale-plan check is the safety net, not the workflow.
Interview tip → Distinguish "PR plan" (informational) from "apply plan" (binding).
More on Pipelines Terraform Cloud and OpenTofu
Build a basic GitHub Actions pipeline: plan on pull request, apply on merge to main.BeginnerReviewers can't read raw plan logs. How do you present the plan in the PR?IntermediateTwo PRs merge close together and both apply to the same stack. What prevents trouble?IntermediateHow do you add a manual approval before prod applies?IntermediateCompare Atlantis, HCP Terraform and a hand-built GitHub Actions pipeline.IntermediateExplain HCP Terraform workflows: VCS-driven, CLI-driven and API-driven.Beginner