Skip to content

Commit

Permalink
Add AWS_DEFAULT_PROFILE and AWS_DEFAULT_REGION for older aws tools
Browse files Browse the repository at this point in the history
  • Loading branch information
lox committed Oct 14, 2015
1 parent f4839c2 commit 8e47de2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions exec.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,15 @@ func ExecCommand(ui Ui, input ExecCommandInput) {
env = overwriteEnv(env, "http_proxy", "http://"+l.Addr().String())
env = overwriteEnv(env, "no_proxy", "amazonaws.com")
env = overwriteEnv(env, "AWS_CONFIG_FILE", cfg.Name())
env = overwriteEnv(env, "AWS_DEFAULT_PROFILE", input.Profile)
env = overwriteEnv(env, "AWS_PROFILE", input.Profile)

env = unsetEnv(env, "AWS_ACCESS_KEY_ID")
env = unsetEnv(env, "AWS_SECRET_ACCESS_KEY")
env = unsetEnv(env, "AWS_CREDENTIAL_FILE")

if region, ok := profs[input.Profile]["region"]; ok {
env = overwriteEnv(env, "AWS_DEFAULT_REGION", region)
env = overwriteEnv(env, "AWS_REGION", region)
}

Expand Down

0 comments on commit 8e47de2

Please sign in to comment.