-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
reorder of terraform arguments var and varFiles to reflect common usage #256
Conversation
Thanks for the PR! How did you test this? Could you add a test case that specifically verifies this behavior? |
Hi easy enough to set the variables 1 at a time, just a bit of duplication. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This fix is high priority for my test code. We need to override our global vars in a var-file with command line -var arguments.
Thank you for the PR.
we have come across a new for this as well. But this PR has been open for quite some time, is there any chance this will be reviewed and actioned upon soon ? |
I use |
Also hoping that this gets merged soon |
@robmorgan there is a chance to merge this update? |
If you locate your terraformOptions := &terraform.Options{
TerraformDir: "../location/of/terraform/module/",
Vars: tfvarsOverridesGoHere,
} |
As far as I was checking, this PR is not needed, because #1217 resolves issue with precedence - if you define terraformOptions := terraform.WithDefaultRetryableErrors(t, &terraform.Options{
TerraformDir: ".",
VarFiles: []string{"example.tfvars"},
Vars: map[string]interface{}{
"example": "value_passed_from_test",
},
SetVarsAfterVarFiles: true,
}) |
closing as resolved in #1217 |
Switching the order of Vars and VarFiles in terraformArgs to reflect a more common scenario.
It's likely that a user would like to override one or two variables from a var-file using single variables, currently the behaviour is the opposite way round.
link to terraform variable precedence documentation.