Skip to content

Commit

Permalink
allowing either of AWS_REGION or AWS_DEFAULT_REGION to be used fro aws.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sami Alajrami committed Feb 23, 2018
1 parent 95008f2 commit fa82a3d
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,17 @@ import (

func checkCredentialsEnvVar() bool {

if os.Getenv("AWS_ACCESS_KEY_ID") == "" || os.Getenv("AWS_SECRET_ACCESS_KEY") == "" || os.Getenv("AWS_REGION") == "" {
if os.Getenv("AWS_ACCESS_KEY_ID") == "" || os.Getenv("AWS_SECRET_ACCESS_KEY") == "" {

return false

} else if os.Getenv("AWS_REGION") == "" {

if os.Getenv("AWS_DEFAULT_REGION") == "" {
return false
}
os.Setenv("AWS_REGION", os.Getenv("AWS_DEFAULT_REGION"))

}
return true
}
Expand Down

0 comments on commit fa82a3d

Please sign in to comment.