Correctly set aws region if given in template along with a profile.

This commit is contained in:
Matthew Hooker 2017-12-07 11:12:57 -08:00
parent ca26ab5d5a
commit 7b5c0900ef
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 3 additions and 1 deletions

View File

@ -40,7 +40,9 @@ func (c *AccessConfig) Session() (*session.Session, error) {
if err := os.Setenv("AWS_PROFILE", c.ProfileName); err != nil {
return nil, fmt.Errorf("Set env error: %s", err)
}
} else if c.RawRegion != "" {
}
if c.RawRegion != "" {
config = config.WithRegion(c.RawRegion)
} else if region := c.metadataRegion(); region != "" {
config = config.WithRegion(region)