Terragrunt run-all
Runs a Terraform command across all units in the current directory tree, respecting dependency order.
cd environments/prod terragrunt run-all plan terragrunt run-all apply terragrunt run-all destroy # reverse order
Enter fullscreen mode
Exit fullscreen mode
dependency-aware ordering
environments/prod/ ├── vpc/ ├── rds/ # depends on vpc └── eks/ # depends on vpc
Enter fullscreen mode
Exit fullscreen mode
run-all apply applies vpc first, then rds and eks in parallel.
real CI pipeline
# .github/workflows/deploy.yml - name : Plan all run : terragrunt run-all plan --terragrunt-non-interactive working-directory : environments/prod
- name : Apply all run : terragrunt run-all apply --terragrunt-non-interactive -auto-approve working-directory : environments/prod if : github.ref == 'refs/heads/main'
Enter fullscreen mode
Exit fullscreen mode
Detect drift in CI without applying:
# exit code 2 = changes detected, 0 = no changes, 1 = error terragrunt run-all plan \…