namestring
The file or directory to find, e.g. root.hcl or prod/env.hcl. Searching for a root terragrunt.hcl is deprecated. See Migrating from root terragrunt.hcl.
find_in_parent_folders(name: string, [fallback: string]) --> stringA unit uses find_in_parent_folders to find the file it includes:
include "root" { path = find_in_parent_folders("root.hcl")}The search starts in the folder above the unit or stack file and moves up until it finds name.
The search starts from the unit that includes the file. Here, root.hcl finds prod/env.hcl when prod/mysql includes it:
locals { env = read_terragrunt_config(find_in_parent_folders("env.hcl"))}The file or directory to find, e.g. root.hcl or prod/env.hcl. Searching for a root terragrunt.hcl is deprecated. See Migrating from root terragrunt.hcl.
The value to return, as given, when no folder above has name. Without it, the function fails.
Falls back to a default file when no folder above the unit has region.hcl.
locals { default = "${get_repo_root()}/defaults/region.hcl" region_file = find_in_parent_folders("region.hcl", local.default)}