Skip to content
Latchkey

terragrunt run-all: Apply Across Many Units

terragrunt run-all runs one Terragrunt command against every unit under the current directory, in dependency order.

run-all is how you plan or apply a whole stack at once. Terragrunt builds a dependency graph from the dependency and dependencies blocks and walks it in the right order.

What it does

terragrunt run-all <cmd> finds every terragrunt.hcl below the working directory, builds a DAG from their dependencies, and runs <cmd> against each unit. For apply it walks the DAG so dependencies apply before dependents; for destroy it reverses the order. It replaces the older terragrunt apply-all/plan-all aliases.

Common usage

Terminal
terragrunt run-all plan
terragrunt run-all apply --terragrunt-non-interactive
# limit to part of the tree
terragrunt run-all apply --terragrunt-working-dir ./prod
# destroy in reverse dependency order
terragrunt run-all destroy --terragrunt-non-interactive

Options

FlagWhat it does
--terragrunt-non-interactiveRequired for unattended run-all apply/destroy
--terragrunt-include-dir <glob>Only run units matching the glob
--terragrunt-exclude-dir <glob>Skip units matching the glob
--terragrunt-ignore-dependency-errorsContinue even if a dependency fails
--terragrunt-parallelism <n>Cap concurrent units

In CI

run-all apply will create remote state backends on first use, so add --terragrunt-non-interactive or it blocks waiting for a yes/no. run-all plan against units whose dependencies have never been applied prints "mock outputs" warnings rather than failing, which is expected on a fresh environment. Cap --terragrunt-parallelism if your provider hits API rate limits.

Common errors in CI

"Detected a dependency cycle" means two units depend on each other; break the cycle. "is not a valid path to a unit" usually means a dependency config_path is wrong. With run-all plan, "dependency ... has not been applied" shows when downstream outputs are unavailable; use mock_outputs in the dependency block to let plan proceed.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →