terragrunt
Terraform wrapper for DRY configurations
TLDR
Initialize modules
SYNOPSIS
terragrunt [init] [plan] [apply] [destroy] [run-all] [options]
DESCRIPTION
terragrunt is a thin wrapper for Terraform that provides extra tools for keeping configurations DRY and managing multiple modules.
DRY configuration avoids repetition across environments. Common settings are defined once and inherited by modules.
Remote state configuration is centralized. Backend settings don't need repetition in every module.
Dependencies between modules are managed automatically. run-all executes commands across multiple modules in dependency order.
Before and after hooks run custom commands around Terraform operations. This enables validation, notifications, and cleanup.
Lock file management handles concurrent access. Multiple team members can work safely on shared infrastructure.
PARAMETERS
init
Initialize Terraform.plan
Show execution plan.apply
Apply changes.destroy
Destroy infrastructure.output
Show outputs.run-all CMD
Run command on all modules.graph-dependencies
Show dependency graph.--terragrunt-config FILE
Config file.--terragrunt-working-dir DIR
Working directory.--terragrunt-source SOURCE
Module source override.--terragrunt-non-interactive
Non-interactive mode.--terragrunt-parallelism N
Parallel operations.
CONFIGURATION
terragrunt.hcl
Module-level configuration file defining Terraform source, inputs, dependencies, and backend settingsTERRAGRUNT_CONFIG
Environment variable to override the default configuration file pathTERRAGRUNT_DOWNLOAD
Environment variable to set the directory where Terragrunt downloads Terraform source code
CAVEATS
Adds complexity over plain Terraform. Learning curve for configuration syntax. Some Terraform features need workarounds.
HISTORY
Terragrunt was created by Gruntwork around 2016 to address pain points in managing Terraform at scale. It's widely used for multi-environment, multi-account infrastructure management.
