What is Terragrunt and why you need it
the multi-env problem
With plain Terraform, managing multiple environments means duplicating config - same modules, different variable files, same backend boilerplate repeated everywhere.
environments/ ├── dev/ │ ├── main.tf # copy │ ├── variables.tf # copy │ └── backend.tf # copy with different key ├── staging/ │ ├── main.tf # copy │ ├── variables.tf # copy │ └── backend.tf # copy with different key └── prod/ ├── main.tf # copy ├── variables.tf # copy └── backend.tf # copy with different key
Enter fullscreen mode
Exit fullscreen mode
Any change to the module requires updating all three.
what Terragrunt does
Terragrunt is a thin wrapper around Terraform that adds:
DRY backend config - define once, inherit everywhere
dependency blocks - wire modules together without a monolith
run-all - apply/plan/destroy across multiple modules in one command
generate blocks - auto-generate files (provider configs, backend configs)
mock_outputs - unblock plan in CI when…