#[non_exhaustive]pub struct TgContext {
pub workspace_root: Arc<Path>,
pub environment: Option<Arc<str>>,
pub env_var_mode: EnvVarMode,
pub allowed_env: Arc<BTreeSet<Arc<str>>>,
pub max_include_depth: u32,
}Expand description
Read-only inputs to a single crate::terragrunt::TerragruntResolver::resolve call.
allowed_env is wrapped in Arc<BTreeSet<Arc<str>>> per
[14-terragrunt.md § 9 CLAUDE.md anchoring] so it’s cheap to share across
rayon worker threads. max_include_depth defaults to 32, matching the
spec’s pin.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.workspace_root: Arc<Path>Canonical absolute workspace root. Every Terragrunt-function-resolved
path must remain underneath this; the resolver enforces it via the
internal canonicalize_inside helper.
environment: Option<Arc<str>>Pinned environment name (e.g. Some("staging")). Surfaces as
terraform.workspace in downstream evaluator scopes; the resolver
itself does not consult it for get_env.
env_var_mode: EnvVarModeHow get_env(name, default?) reads the process environment. Default
is EnvVarMode::Strict with an empty allowlist (off by default).
allowed_env: Arc<BTreeSet<Arc<str>>>Allowlist of environment-variable names visible to get_env. Same
shape as crate::eval::EvalContext’s field; kept separate to
allow tighter Terragrunt-only policy.
max_include_depth: u32Maximum include-chain depth before crate::terragrunt::TerragruntError::DepthExceeded
fires. Default: 32.