-
-
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
terraform variable precedence #255
Comments
Are you expecting The docs say:
"The order they are provided" doesn't really make much sense in a |
Having |
As far as I was checking, #1217 resolves that issue. 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,
}) |
perfect thanks @sebastianczech , I'll close this issue in that case. |
When setting the same variable (for example
"example_var"
) in bothVarFiles
andVars
terraformOptions, ordering is not honoured and therefore the variable precedence is incorrect. The value of the variable in the VarFile will always be applied despite the ordering inside of the test.For example:
and
varfile.tfvars
containedexample_var
would always be set totest456
looks like https://github.com/gruntwork-io/terratest/blob/master/modules/terraform/format.go#L14-L15 is causing this behaviour.
The text was updated successfully, but these errors were encountered: