Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
If you are interested in working on this issue or have submitted a pull request, please leave a comment.
If a plan has 5 resources to create and then an apply creates 4 resources and fails on the 5th, you may be tempted to run another atlantis apply. If you do, it will say that the original plan is stale.
Ran Apply for dir: terraform/redacted workspace: defaultApply Error
exit status 1: running "terraform apply -no-color $PLANFILE" in "/atlantis/repos/redacted/redacted/18/default/terraform/redacted":
Error: Saved plan is stale
The given plan file can no longer be applied because the state was changed by another operation after the plan was created.
Describe the solution you'd like
Instead, when the apply fails, detect the failure, re-plan it and post the new plan, then if another atlantis apply is submitted, it should not fail with a stale plan.
This feature will be extremely useful when there is a terragrunt monorepo with mocks. That's the only thing that is currently missing to implement a "run-all apply" style workflow.
Community Note
Describe the user story
If a plan has 5 resources to create and then an apply creates 4 resources and fails on the 5th, you may be tempted to run another
atlantis apply
. If you do, it will say that the original plan is stale.Describe the solution you'd like
Instead, when the apply fails, detect the failure, re-plan it and post the new plan, then if another
atlantis apply
is submitted, it should not fail with a stale plan.Perhaps we can have a new input?
or a new hook
Describe the drawbacks of your solution
I cannot think of any.
Describe alternatives you've considered
Try to remember to always run
atlantis plan
oratlantis plan -d xyz
after a failed apply so I can run a subsequentatlantis apply