Skip to content
🎉 Terragrunt v1.0 is here! Read the announcement to learn more.

Stacks

A stack in Terragrunt is a collection of related units that can be managed together. Stacks provide a way to:

  • Deploy multiple infrastructure components with a single command
  • Manage dependencies between units automatically
  • Control the blast radius of changes
  • Organize infrastructure into logical groups

Terragrunt supports two approaches to defining stacks:

  1. Implicit Stacks: Created by organizing units in a directory structure.
  2. Explicit Stacks: Defined using terragrunt.stack.hcl files.

Choosing Between Implicit and Explicit Stacks

Section titled “Choosing Between Implicit and Explicit Stacks”
  • You have a small number of units.
  • Each unit is unique and not repeated across environments.
  • You don’t mind a high file count.
  • You’re just getting started with Terragrunt.
  • You need maximum explicitness and transparency.
  • You have multiple environments (dev, staging, prod).
  • You want to reuse collections of related infrastructure patterns.
  • You have many similar units that differ only in values.
  • You want to version collections of infrastructure patterns.
  • You’re building infrastructure catalogs or templates.

For detailed examples, see the Gruntwork Terragrunt Infrastructure Catalog Stack Examples. These have full-featured examples of stacks that deploy real, stateful infrastructure in an AWS account.