Terragrunt
Terragrunt is a thin wrapper around Terraform that reduces repetition across environments. It generates backend and provider configuration, shares settings through inheritance, and runs many modules in dependency order.
What Is Terragrunt?
It calls Terraform for you after extra setup. One remote_state block at the repo root replaces dozens of copied backend files.
HCL
# environments/prod/ecs-service/terragrunt.hclinclude "root" { path = find_in_parent_folders("root.hcl") # inherit shared remote_state} terraform { source = "../../../modules//ecs-service"} inputs = { service_name = "orders-api"}
Bash
terragrunt run --all plan # all modules in dependency orderOlder repos use run-all, the previous form of the same command.
TipRead the combined plan across all modules before applying across all modules.
Frequently Asked Questions
What does Terragrunt do that plain Terraform cannot?
It avoids repeating backend and provider config through inheritance and generated files, and runs many root modules in dependency order.
When should I skip Terragrunt?
With only a few environments, where a shared module plus tfvars is simpler than adding a second tool.
Found a mistake, an outdated step or a broken link?