PROVIDER - DRY orchestration wrapper for Terraform
Terragrunt
Terragrunt is the DRY wrapper for Terraform and OpenTofu, collapsing backend and provider configuration into 1 directory hierarchy, resolving dependencies automatically and running 20+ modules with run-all; the costs are an abstraction layer and upstream compatibility tracking.
3.8pts
Detailed Notes
Pros 5 items
Cons 4 items
Service Overview
Terragrunt is Gruntwork's open source wrapper for Terraform and OpenTofu. It does not replace Terraform; it adds directory organisation, configuration reuse and bulk execution on top, solving the duplication that large IaC repositories always accumulate.
In the development tools category it is the advanced tier of infrastructure as code: its value appears once a team grows from a few modules to dozens across several environments.
Key Strengths
- DRY configuration: backend, provider and version constraints defined once instead of per module
- Directory as architecture: environment and module relationships live in 1 hierarchy
- Dependency orchestration: apply order is derived automatically, avoiding manual sequencing errors
- Bulk execution: run-all processes 20+ modules in one pass
- Dual ecosystem: supports both Terraform and OpenTofu
Product Ecosystem
Platform capabilities
Configuration inheritance, remote state generation, dependency resolution, bulk runs, hooks and cache directory management.
Integrations
Works with Terraform, OpenTofu, Terragrunt Scale, GitHub Actions, Atlantis and any state backend.
Typical scenarios
Multi-account and multi-environment management, monorepo IaC, cross-module dependency orchestration and enterprise infrastructure platforms.
Limitations
- Ecosystem dependency: fully tied to the Terraform and OpenTofu release cadence
- Abstraction cost: newcomers learn 2 layers plus HCL extensions
- Bulk risk: partial run-all failures can leave state inconsistent and need manual fixes
- Documentation depth: official material is practice-led with no systematic beginner path
Use Cases
- Multi-environment, multi-account IaC (★★★★★): hierarchy and inheritance pay off most
- Repositories with exploding module counts (★★★★★): dramatically less duplication
- Small single-module projects (★★☆☆☆): plain Terraform is simpler
- Strong dependency ordering needs (★★★★☆): automatic sequencing removes manual work
Pricing
| Item | Price | Notes |
|---|---|---|
| Terragrunt itself | $0 | Apache 2.0 open source, commercial use allowed |
| Gruntwork subscription | Contact sales | IaC library, reference architecture and support |
| Self-hosted CI | Platform billing | Depends on concurrency and runtime |
FAQ
Does Terragrunt replace Terraform?
No. It invokes Terraform or OpenTofu for the actual plan and apply and only handles orchestration and configuration generation.
Can I skip writing backend configuration?
Yes. The remote_state block generates backend configuration, so no module needs a hand-written copy.
How does it compare with Terraform workspaces?
Workspaces suit a small number of similar environments; Terragrunt fits large divergences and many modules.
Is OpenTofu supported?
Yes. Terragrunt is adapted to OpenTofu and can use it as the execution engine.
Code Examples
# Root terragrunt.hcl: generate remote state centrally
remote_state {
backend = "s3"
generate = {
path = "backend.tf"
if_exists = "overwrite"
}
config = {
bucket = "my-tf-state"
key = "${path_relative_to_include()}/terraform.tfstate"
region = "us-east-1"
}
}
# prod/app/terragrunt.hcl: inherit the root and declare a dependency
include "root" {
path = find_in_parent_folders()
}
terraform {
source = "../../../modules/app"
}
dependency "network" {
config_path = "../network"
}
inputs = {
vpc_id = dependency.network.outputs.vpc_id
}
# Run every module in the tree, here 20+
terragrunt run-all plan
terragrunt run-all apply
Community & Resources
- Website: https://terragrunt.gruntwork.io/
- Source repository: https://github.com/gruntwork-io/terragrunt
- Documentation: https://terragrunt.gruntwork.io/docs/
Articles
- 01 GitLab CI/CD Best Practices: From Beginner to Production-Grade Pipelines 07-18
- 02 Prometheus Monitoring System Setup: From Metric Collection to Alert Notifications 07-18
- 03 Ansible Automation Ops Guide: From Configuration Management to Application Deployment 07-18
- 04 Docker Beginner Tutorial: From Installation to Containerized Web Deployment 07-18
- 05 API Integration Guide: REST vs GraphQL Comparison and Selection 07-18
- 06 GitHub Actions CI/CD Tutorial: Automated Build, Test, and Deployment 07-18
- 07 Docker Compose Multi-Container Deployment: Building Complete Application Orchestration 07-18
- 08 Kubernetes Deployment Guide for Beginners: Building a K8s Cluster from Scratch 07-18
- 09 Best VS Code Extensions 2026: Boost Your Development Productivity 07-18
- 10 Frontend Toolchain 2026: Vite / Next.js / Tailwind CSS Ecosystem 07-18