The pipeline fails with "Saved plan is stale" after approval. Why did it happen and is it a bug?
AdvancedScenarioWorkflow and Providers
Answer
Situation read → Not a bug; it's the protection working.
What I'd do →
- Check what changed state between plan and apply: another run, a manual
stateedit, or a refresh by a second pipeline. - Re-run the plan job on the current commit and get a new approval.
- Prevent recurrence with a CI concurrency group so only one run per stack executes.
concurrency:
group: tf-prod-network
cancel-in-progress: false
Why → A plan records the state serial and lineage it was built from. If state moved, applying it could undo someone else's change.
Interview tip → Short gaps between plan and apply reduce this; long-lived approvals make it worse.
More on Workflow and Providers
A new teammate is about to run Terraform for the first time against a shared dev account. Which commands do you walk them through, and in what order?BeginnerYour manager asks why we bother with `terraform plan` when `apply` shows the same diff before asking for confirmation. What do you say?BeginnerTwo engineers get different provider versions and see different plans for the same code. How do you stop this?BeginnerSomeone committed the `.terraform/` directory to the repo. What should be in version control and what should not?BeginnerThe same configuration must create a VPC in `us-east-1` and a DR copy of a bucket in `eu-west-1`. How do you do it with one root module?IntermediateYou must deploy the same stack into 12 AWS accounts. How do you handle credentials and provider configuration?Intermediate