Skip to main content
Knowledge Base

behavior if read_terragrunt_config(find_in_parent_folders("xxxx.hcl")) found multiple values

Answer

whats the behavior for these function `terragrunt.hcl` ```hcl locals { service_vars = read_terragrunt_config(find_in_parent_folders("service.hcl")) } ``` `service.hcl` ```hcl locals { service = basename(get_path_from_repo_root()) } ``` if we have multiple service.hcl, with same key but different value? lets say we have directory structure like : ``` vault ├── service.hcl <-- return `vault` as value └── vault-client ├── asg | └── terragrunt.hcl └─service.hcl <-- return `vault-client` as value ``` if its like that whats the `local.service_vars.locals.service` actual value? can anyone enlighten me related to this case? --- <ins datetime="2022-08-05T11:04:55Z"> <p><a href="https://support.gruntwork.io/hc/requests/109103">Tracked in ticket #109103</a></p> </ins>

This is documented in our [Built-in functions](https://terragrunt.gruntwork.io/docs/reference/built-in-functions/#find_in_parent_folders) secion of our Terragrunt documentation.