What is Terragrunt?
Answer
Terragrunt is a thin wrapper around Terraform that provides extra tooling for working with multiple Terraform modules and environments. Key features: DRY (Don't Repeat Yourself): define backend configuration and provider settings once in a parent terragrunt.hcl and inherit in all child configs. Dependency management: explicitly declare dependencies between Terraform modules and automatically pass outputs: dependency "vpc" { config_path = "../vpc"; inputs = { vpc_id = dependency.vpc.outputs.vpc_id } }. run-all: apply all modules in a directory respecting dependency order: terragrunt run-all apply. Hooks: run scripts before/after Terraform commands. Generate blocks: dynamically generate HCL files (backend configs, provider configs). Terragrunt is popular in large organizations running Terraform at scale across dozens of environments and regions, where Terraform's native module and workspace support becomes unwieldy.
Previous
How do you structure Terraform code for large teams?
Next
What are Terraform modules best practices?
More Terraform / IaC Questions
View all →- Intermediate What is the Terraform state locking mechanism?
- Intermediate How do you handle sensitive values in Terraform?
- Intermediate What are Terraform Provisioners and when should you avoid them?
- Intermediate What is Terraform import?
- Intermediate How do you structure Terraform code for large teams?