docs/src/data/flags/all.mdx
import { Aside } from '@astrojs/starlight/components';
When this flag is set, Terragrunt will run the specified OpenTofu/Terraform command against all units in the current stack. This is useful when you want to apply changes across multiple units at once.
For example:
terragrunt run --all plan
This will run the plan command against all units in the current stack.
To learn more about how to use this flag, see the Stacks feature documentation.
<Aside type="note"> Terragrunt has a notion of "external dependencies". These are units that are not part of the current stack, from the perspective of the current working directory, but are dependencies of units that are part of the current stack.When running an --all command, Terragrunt will discover any external dependencies and prompt you to confirm that you want to run them as well.
If you would like to suppress this prompt, you can use the --non-interactive flag. You can also prevent this behavior by setting --queue-exclude-external.
If you wish to prevent external dependencies from being destroyed, add the --queue-exclude-external flag, or use the --exclude-dir flag once for each directory you wish to exclude.
If you have a stack of Terragrunt units with dependencies between them via dependency blocks
and you've never deployed them, then commands like run --all plan will fail,
as it won't be possible to resolve outputs of dependency blocks without applying them first.
The solution for this is to take advantage of mock outputs in dependency blocks.
</Aside> <Aside type="note"> Using `run --all` with `apply` or `destroy` silently adds the `-auto-approve` flag to the command line arguments passed to OpenTofu/Terraform due to issues with shared `stdin` making individual approvals impossible. </Aside> <Aside type="note"> Using the OpenTofu/Terraform [-detailed-exitcode](https://opentofu.org/docs/cli/commands/plan/#other-options) flag with the `run --all` command results in an aggregate exit code being returned, rather than the exit code of any particular unit.The algorithm for determining the aggregate exit code is as follows: