terraform: env vars are lower priority
This commit is contained in:
parent
fe74d69852
commit
0728e25f43
|
@ -103,9 +103,6 @@ func NewContext(opts *ContextOpts) *Context {
|
|||
// Setup the variables. We first take the variables given to us.
|
||||
// We then merge in the variables set in the environment.
|
||||
variables := make(map[string]string)
|
||||
for k, v := range opts.Variables {
|
||||
variables[k] = v
|
||||
}
|
||||
for _, v := range os.Environ() {
|
||||
if !strings.HasPrefix(v, VarEnvPrefix) {
|
||||
continue
|
||||
|
@ -119,6 +116,9 @@ func NewContext(opts *ContextOpts) *Context {
|
|||
// Override the command-line set variable
|
||||
variables[k] = v
|
||||
}
|
||||
for k, v := range opts.Variables {
|
||||
variables[k] = v
|
||||
}
|
||||
|
||||
return &Context{
|
||||
destroy: opts.Destroy,
|
||||
|
|
Loading…
Reference in New Issue