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

Increase precedence of variable supplied by -var over -var-file #1197

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Increase precedence of variable supplied by -var over -var-file
Currenty terraform decides prcedence of variable based on their order. Having -var at higher precedence allows us to edit some of the variables quickly for testing etc.
  • Loading branch information
someshkoli authored Nov 10, 2022
commit f59882041ec8de7b546248f4c43708e99b16937a
2 changes: 1 addition & 1 deletion modules/terraform/format.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ func FormatArgs(options *Options, args ...string) []string {
terraformArgs = append(terraformArgs, args...)

if includeVars {
terraformArgs = append(terraformArgs, FormatTerraformVarsAsArgs(options.Vars)...)
terraformArgs = append(terraformArgs, FormatTerraformArgs("-var-file", options.VarFiles)...)
terraformArgs = append(terraformArgs, FormatTerraformVarsAsArgs(options.Vars)...)
}

terraformArgs = append(terraformArgs, FormatTerraformArgs("-target", options.Targets)...)
Expand Down