Directory that encloses graph discovery for filters, instead of the git repository root
Filter expressions that traverse the dependency graph reach beyond the working directory. Dependents (...{unit}) can live anywhere, so Terragrunt searches from the working directory up to the git repository root; dependencies ({unit}...) are declared by path and can point anywhere.
The --discovery-boundary flag is a single enclosure for that traversal: it replaces the git repository root as the outer limit, and a configuration that traversal reaches outside it is not returned, so find does not list it and run --all does not run it. Configurations inside the boundary are discovered as usual.
The boundary decides which configurations a command acts on, not which ones Terragrunt may read. A unit inside the boundary can declare a dependency outside it, and that dependency is still read and parsed: Terragrunt needs its configuration to fetch the outputs the dependent unit consumes, and it needs the dependency edge to order the units that do run. What the boundary withholds is the unit itself, which is left for a separate run to apply, the same way a dependency outside the working directory is treated today.
This matters in monorepos where environments are isolated from each other. When sibling environments cannot be parsed independently, the default search fails or wastes work reaching into them:
environments/
staging/
production/
test/
root.hcl
Bounding the traversal to the current environment keeps discovery inside it:
The boundary must be an existing directory. Relative paths are resolved against the working directory.
The boundary applies to what traversal reaches, so a command that names no filter keeps every configuration under the working directory even when the boundary sits below it. Narrow the working directory itself, with --working-dir, to change where discovery starts.
Where the boundary may sit depends on the directions the filters traverse. Dependent traversal searches upward from the working directory, so a boundary that excludes the working directory could never take effect; filters that traverse dependents require the boundary to be the working directory or one of its parents. Dependency traversal follows declared paths outward from the units a filter matched and never consults the working directory, so filters that traverse only dependencies accept any directory, including one below the working directory. That is the same rule the inline (dir) operand follows.
Type: string
Environment Variables:
TG_DISCOVERY_BOUNDARY
--no-cas
Disable the CAS (Content Addressable Storage) feature.
When this flag is set, Terragrunt skips all CAS operations and clones sources directly.
Generation or runs error when update_source_with_cas = true is set on any unit, stack, or terraform block reachable from the current invocation, since relative sources rewritten by CAS cannot be resolved without it.
Type: bool
Environment Variables:
TG_NO_CAS
--cas-clone-depth
When using CAS, pass this value to git clone --depth (default 1; -1 clones full history).
This flag has no effect when the CAS is disabled with --no-cas.
Controls the --depth value the CAS (Content Addressable Storage) uses when cloning a Git source. The default of 1 performs a shallow clone of the latest commit. Negative values clone the full history by omitting --depth entirely; zero is rejected because Git requires a positive depth.
When passing a negative value, use the --cas-clone-depth=-1 form so the leading dash isn’t parsed as a flag.
This flag sets the depth for all CAS Git clones. A depth query parameter on a source URL (for example ...vpc.git?depth=1) is stripped before Terragrunt invokes git, and never changes the depth, which always comes from this flag.
Type: integer
Default: 1
Environment Variables:
TG_CAS_CLONE_DEPTH
--cas-offline
When using CAS, never contact a remote; resolve every source from the local store and fail on anything missing.
Forbids the CAS from contacting any remote. Each source is resolved locally instead: a source pinned to a specific revision that the store already holds is looked up there, and everything else is answered from the most recent probe the probe cache recorded for it, however old that result is. The content is then linked from the store as usual.
A source with no recorded answer, or whose content is not in the store, fails with an error naming it instead of being fetched. Run once without this flag to populate the store, then rerun with it.
Any other CAS failure on a source, such as a store file that cannot be read, also fails the run. Without this flag Terragrunt falls back to the standard downloader, which fetches from the remote.
Terminal window
terragruntrun--all--cas-offline--plan
Every source the CAS resolves through a cheap probe is covered: Git, HTTP and HTTPS, S3, GCS, OCI, the OpenTofu/Terraform registry, and Mercurial. A source with no cheap probe, such as an SMB share, has nothing recorded and is still fetched. Local paths are copied as usual. The flag has no effect when the CAS is disabled with --no-cas, and it cannot be combined with --cas-refresh.
Type: bool
Environment Variables:
TG_CAS_OFFLINE
--cas-refresh
When using CAS, ignore recorded probe results and ask every remote again.
Skips the probe cache for this run, so every source is resolved with a fresh probe. Units that resolve the same source at the same time still share one probe; a unit that starts later asks the remote again. The fresh results are recorded for later runs.
A source pinned to a specific revision, such as a semantic version tag or an S3 object version, is trusted for 24 hours by default, so a tag that has been moved keeps resolving to its previous revision until that window passes. This flag picks up the new one right away.
Terminal window
terragruntrun--all--cas-refresh--plan
The flag has no effect when the CAS is disabled with --no-cas, and it cannot be combined with --cas-offline.
Type: bool
Environment Variables:
TG_CAS_REFRESH
--cas-probe-ttl
When using CAS, trust a recorded probe of a source that can change upstream for this long before asking the remote again.
Sets how long the CAS serves a recorded probe of a source that can change upstream in place of a fresh one. That covers a Git branch or HEAD, a Git tag that is not a semantic version, an HTTP endpoint, a GCS object, an OCI tag, and a Mercurial branch name. The value is a duration such as 30s, 10m, or 1h. Negative values are rejected.
The default of 0 probes these sources on every run, so a push or an upload followed by a run sees the new revision. Raise it when a burst of runs against the same sources should not each pay for a probe, accepting that a change made inside the window is not seen until it passes.
Terminal window
terragruntrun--all--cas-probe-ttl10m--plan
A source pinned to a specific revision is trusted for 24 hours regardless of this flag; see Recorded probes for which sources count as pinned. Use --cas-refresh to bypass every recorded result for one run.