docs/src/data/flags/json-out-dir.mdx
import { Aside } from '@astrojs/starlight/components';
<Aside type="note">This flag only does anything when used with the --all flag for stack runs. It does nothing in single-unit runs.
To generate JSON plan files for a single unit run, use the standard OpenTofu/Terraform -out flag like so:
terragrunt run -- plan -out=/tmp/tfplan
terragrunt run -- show -json /tmp/tfplan > /tmp/tfplan.json
Generates machine-readable plan outputs per unit as tfplan.json by invoking show -json after the plan is created.
--out-dir).<json-out-dir>/<relative-unit-path>/tfplan.json).Examples:
# Create native plan files and JSON plans for all units
terragrunt run --all --out-dir /tmp/all --json-out-dir /tmp/all plan
# Or store JSON plans separately
terragrunt run --all --out-dir /tmp/plan --json-out-dir /tmp/json plan
See the Stacks docs for more usage examples.