nameoptional(string)
The label of the include block to measure to. A unit with more than one include block needs it. In the included file, it has no effect.
path_relative_from_include([name: string]) --> stringpath_relative_from_include is the reverse of path_relative_to_include. Together, they let an included file build a relative path for each unit, e.g. a source in a sibling folder:
locals { to_root = path_relative_from_include() to_unit = path_relative_to_include()}
terraform { source = "${local.to_root}/../sources//${local.to_unit}"}The source is ../../sources//mysql for terragrunt/mysql and ../../../sources//secrets/mysql for terragrunt/secrets/mysql. Without an include block, the function returns ..
For an absolute path to the included file’s directory, use get_parent_terragrunt_dir.
The label of the include block to measure to. A unit with more than one include block needs it. In the included file, it has no effect.
When prod/mysql/terragrunt.hcl includes this file.
locals { root_path = path_relative_from_include() # "../.."}