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

[Enhancement] Variable Precedence #381

Closed
DWSR opened this issue Nov 23, 2017 · 2 comments
Closed

[Enhancement] Variable Precedence #381

DWSR opened this issue Nov 23, 2017 · 2 comments
Labels
enhancement New feature or request

Comments

@DWSR
Copy link

DWSR commented Nov 23, 2017

Hey there,

I would love to have the concept of variable precedence where I can override variables that are defined in e.g. a tfvars files with those "closer" to the module source (i.e. in the same file).

An example:
I have a stack of modules that define a customer environment. In this environment, I'm using a particular SSH key as the root key. If I now want to roll over the key, I now have to remove the keypair from the top level tfvars and define it in each module individually, then change them all one by one, then add it back to the top level file. Implementing the concept of precedence would remove a step and enable some scenarios where you want to have the same variable value almost everywhere.

@brikis98 brikis98 added the enhancement New feature or request label Nov 23, 2017
@brikis98
Copy link
Member

Currently, Terragrunt doesn't do anything with the variables you set outside of the terragrunt = { ... } block in your .tfvars files. Requests for this have come up quite a few times (e.g. #132), but it's nontrivial to implement.

Your best bet for now is to take advantage of extra_arguments to pass variables using -var or -var-file flags. Note that these are overridable in children .tfvars files, so it can most likely do what you want.

@brikis98
Copy link
Member

Closing in favor of #132.

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

No branches or pull requests

2 participants