Skip to content

Commit

Permalink
Use correct env var (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
holtwilkins committed Nov 21, 2017
1 parent c43f236 commit eb4b48b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion aws/asg.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ func (c *Clients) GetASG(asgName *string) (*autoscaling.Group, error) {
}

if len(asgs) != 1 {
return nil, errors.Errorf("ASG Name '%s' matched '%v' ASGs, expecting it to match 1 (looking in region %s, have you set AWS_REGION?)", *asgName, len(asgs), c.ASGClient.SigningRegion)
return nil, errors.Errorf("ASG Name '%s' matched '%v' ASGs, expecting it to match 1 (looking in region %s, have you set AWS_DEFAULT_REGION?)", *asgName, len(asgs), c.ASGClient.SigningRegion)
}

return asgs[0], nil
Expand Down
7 changes: 2 additions & 5 deletions aws/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,9 @@ func GetAWSClients() (*Clients, error) {
return nil, errors.Errorf("Your AWS Credentials are expired")
}

region := os.Getenv("AWS_REGION")
region := os.Getenv("AWS_DEFAULT_REGION")
if region == "" {
region = os.Getenv("AWS_DEFAULT_REGION")
if region == "" {
region = "us-east-1"
}
region = "us-east-1"
}

awsConf := aws.Config{
Expand Down

0 comments on commit eb4b48b

Please sign in to comment.