Skip to content

Commit

Permalink
added region switch
Browse files Browse the repository at this point in the history
  • Loading branch information
Shaun committed Mar 25, 2017
1 parent 87c8c9e commit e7a1828
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion commands/aws.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,18 @@ func awsSession() (*session.Session, error) {

// Using sync.Once to ensure session is created only once.
once.Do(func() {
// set region
var r string
switch config.Region {
case "":
r = region
default:
r = config.Region
}

//define session options
options := session.Options{
Config: aws.Config{Region: aws.String(config.Region)},
Config: aws.Config{Region: &r},
Profile: job.profile,
SharedConfigState: session.SharedConfigEnable,
}
Expand Down

0 comments on commit e7a1828

Please sign in to comment.