Terraform Advanced — When to Use Each
A decision matrix for choosing between workspaces, directories, and Terragrunt.
Decision Matrix
| Criteria | Workspaces | Directories | Terragrunt |
|---|---|---|---|
| Team size | 1–3 | 3–10 | 10+ |
| Environments | 2–3 identical | 3+ with differences | Any number |
| Code duplication | None | Some | None |
| Isolation | State-level | Full | Full |
| PR clarity | ❌ Low | ✅ High | ✅ High |
| Learning curve | Low | Low | Medium |
| Dependency mgmt | Manual | Manual | Automatic |
| DRY config | ❌ | ❌ | ✅ |
Quick Guide
Choose Workspaces when:
- Small team (1–3 engineers)
- All environments are nearly identical
- You want simplicity
Choose Directories when:
- Environments differ significantly (prod has WAF, dev doesn’t)
- You need clear PR diffs per environment
- Team is medium-sized
Choose Terragrunt when:
- Many environments with many services
- You want DRY config without duplication
- You need dependency ordering across stacks
- Team is large or growing
What’s Next?
Practice workspace and directory patterns.