How do you serialize applies to the same stack in CI?
AdvancedProductionCI/CD and Automation
Answer
Use a concurrency group keyed by stack so only one run per stack executes and later ones queue (do not cancel an in-progress apply).
concurrency:
group: tf-${{ matrix.stack }}
cancel-in-progress: false
Add -lock-timeout as a second layer. Never enable cancel-in-progress for apply jobs: killing Terraform mid-apply leaves locks and partial state.
More on CI/CD and Automation
Why run Terraform from a pipeline instead of laptops?BeginnerWhat stages does a good Terraform pull-request pipeline have?BeginnerHow do you make sure the apply runs exactly what was reviewed?IntermediateShow a minimal GitHub Actions workflow for plan on PR.BeginnerHow does OIDC authentication from GitHub Actions to AWS work?IntermediateWhat is Atlantis and how does the flow work?Beginner