Why my root.hcl
configuration works if find_in_parent_folders()
function suppose to find from bottom to top, but instead it actually looking for files in child folders?
root.hcl
:
locals {
account_vars = read_terragrunt_config(find_in_parent_folders("account.hcl"))
region_vars = read_terragrunt_config(find_in_parent_folders("region.hcl"))
env_vars = read_terragrunt_config(find_in_parent_folders("env.hcl"))
}
And the project structure:
├── demo
│ ├── account.hcl
│ └── us-east-1
│ ├── dev
│ │ ├── env.hcl
│ │ └── vpc
│ │ └── terragrunt.hcl
│ └── region.hcl
└── root.hcl
How does it work in such way?
My suspicion that it works in a way how include
works in C++. When I run terragrunt apply
from the bottom of some folders, it goes upward and simply copy-paste a content of config inside itself. But I didn’t find any proves of it.
1