Interview Prep/Terraform/CI/CD and Automation

How do you run only the stacks affected by a change in a monorepo?

AdvancedProductionCI/CD and Automation
Answer

Compute changed directories from git diff --name-only origin/main, map them to stacks (plus stacks depending on changed modules) and feed them to a job matrix. Tools: GitHub path filters, Atlantis when_modified, Terragrunt --terragrunt-modules-that-include, Spacelift or env0 stack triggers. Always include a full nightly plan so missed dependencies surface.

All Terraform questions Roadmap: Terraform in production

More on CI/CD and Automation