So I have this structure:
.
└── project
├── dev
│ ├── env.hcl
│ └── something
│ └── terragrunt.hcl
└── project.hcl
Where project.hcl and env.hcl are just config files with locals.
I load them inside something/terragrunt.hcl with read_terragrunt_config(find_in_parent_folders("project.hcl / env.hcl "))
.
What I’m looking to achieve is to set some global local for the project based on values in the env locals. For example.
env.hcl:
locals{
env = "dev"
}
project.hcl:
locals{
env = read_terragrunt_config(???)
log_name = "${local.env.locals.name}-logs"
}
The issue is how to refer from project.hcl to the env.hcl of my current env. Since I’m calling read_terragrunt_config() from something/terragrunt.hcl which is in dev I might have the information somewhere no?
The only solution I have right now is to repeat that “log_name” local in every environment.