How to access global variables from application/service layer
Opened this issue · 3 comments
archenroot commented
In main terragrunt.hcl file are merged following:
# Configure root level variables that all resources can inherit. This is especially helpful with multi-account configs
# where terraform_remote_state data sources are placed directly into the modules.
inputs = merge(
local.account_vars.locals,
local.region_vars.locals,
local.environment_vars.locals,
)
But in the example they are never accessed, how to access them from subdirs?
archenroot commented
I have found another way to do it via imports, but that is traversing the other way trough a tree:
#70
archenroot commented
No, it works via inputs, while in this directory the region and account hcl files defines locals instead of inputs, so it won't work..hm..
yorinasub17 commented
Checkout https://terragrunt.gruntwork.io/docs/features/keep-your-terragrunt-architecture-dry/, in particular the section on exposed includes. I believe that is what you are looking for.