Skip to content

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 reads
locals {
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