-
-
Notifications
You must be signed in to change notification settings - Fork 986
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
unable to control {optional,required}_var_file precedence #649
Comments
This is part of Terraform's design. As per the docs:
|
@brikis98 I am aware that terraform has documented precedence rules for var evaluation. This feature request is completely about how terragrunt is explicitly and implicitly passing vars to terraform. |
I'm a bit worried about doing something that is 100% counter to the logic built-into Terraform. If you want |
I'm affected by this issue as well. My use case is that I have a common GCP region/zone declared in a shared hcl file, but then in a couple of modules I want to override this. Since I've put all my module variables in an |
If you are using With
|
Closing as stale and a workaround is provided. If there are any follow up questions here, please open a new issue. Thanks! |
Consider the following
terraform.tfvars
:where
common.tfvars
istg will construct the tf command line such that
terraform.tfvars
is implicit whileoptional_var_files
is explicitly declared as-var-file ...
. This seems to result in any variable declared from a{required,optional}_var_files
as having precedence over the "local"terraform.tfvars
and the resolved value ofdomain_name
ends up beingbar.example.org
. This is exactly the opposite behavior of what I would expect -- specifically, that vars further down the hierarchy override the values of those closer to the root. I believe this could be resolved by explicitly declaring the "local"terraform.tfvars
with-var-file
which appears only after any{required,optiona}l_var_files
. Eg.,As this would be a change to existing semantics, perhaps it could be controlled by a flag in the
terragrunt {}
block?I suspect this is related #132 but ultimately an orthogonal concern.
The text was updated successfully, but these errors were encountered: