Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to access global variables from application/service layer #70

Open
archenroot opened this issue Nov 2, 2021 · 3 comments
Open

How to access global variables from application/service layer #70

archenroot opened this issue Nov 2, 2021 · 3 comments

Comments

@archenroot
Copy link

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
Copy link
Author

I have found another way to do it via imports, but that is traversing the other way trough a tree:
#70

@archenroot
Copy link
Author

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
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants