terraform: env vars are lower priority

This commit is contained in:
Mitchell Hashimoto 2015-05-14 09:58:30 -07:00
parent fe74d69852
commit 0728e25f43
1 changed files with 3 additions and 3 deletions

View File

@ -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,