docs/src/content/docs/03-features/02-stacks/02-implicit.mdx
import FileTree from '@components/vendored/starlight/FileTree.astro';
The simplest way to create a stack is to organize your units in a directory structure in your repository. When you have multiple units in a directory, Terragrunt automatically treats that directory as a stack for the purposes of commands like terragrunt run --all apply.
Let's say your infrastructure is defined across multiple OpenTofu/Terraform root modules:
<FileTree>To convert these to Terragrunt units, simply add a terragrunt.hcl file to each directory:
Now you have an implicit stack! The root directory contains all your units and can be managed as a single stack.
Use the --all flag to run an OpenTofu/Terraform command on all units in the implicit stack in the current working directory:
# Deploy all units discovered in the current working directory
terragrunt run --all apply
# Plan changes across all units discovered in the current working directory
terragrunt run --all plan
# Destroy all units discovered in the current working directory
terragrunt run --all destroy
# View outputs from all units discovered in the current working directory
terragrunt run --all output
You can also use the --graph flag to run an OpenTofu/Terraform command on all units in the DAG of the unit in the current working directory.
# Run an OpenTofu/Terraform command on all units in the DAG of the unit in the current working directory
terragrunt run --graph apply