path
unitstack
Usage
Each field of path is the absolute path of one location. path.unit and path.download have the same value in every file that Terragrunt evaluates for a unit. path.include and path.read name the file that Terragrunt evaluates.
A field is defined only where its location exists. A reference to a field that is not defined returns an error. Use try to supply a fallback:
# common.hcl, which a unit includes or readslocals { common_dir = dirname(try(path.include, path.read))}An autoinclude block is a part of terragrunt.stack.hcl. Terragrunt resolves path in that block when it generates the stack, so path.stack is defined there, and path.unit and path.download are not.
Fields
path.downloadThe absolute path of the directory in which Terragrunt runs OpenTofu/Terraform for the unit.
path.includeThe absolute path of the included file, e.g. `/path/to/root.hcl`.
path.readThe absolute path of the file that `read_terragrunt_config` reads, e.g. `/path/to/env.hcl`.
path.stackThe absolute path of the directory of the `terragrunt.stack.hcl` that Terragrunt evaluates.
path.unitThe absolute path of the directory of the unit, which holds its `terragrunt.hcl`.