Skip to content

Commit

Permalink
Add withRegion
Browse files Browse the repository at this point in the history
  • Loading branch information
hupe1980 committed Oct 5, 2021
1 parent 58bd632 commit a61bf3c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func NewConfig(profile string, region string, timeout time.Duration) (*Config, e

awsCfg, err := config.LoadDefaultConfig(
context.TODO(),
config.WithRegion(region),
config.WithSharedConfigProfile(profile),
config.WithAssumeRoleCredentialOptions(func(aro *stscreds.AssumeRoleOptions) {
aro.TokenProvider = stscreds.StdinTokenProvider
Expand All @@ -39,10 +40,6 @@ func NewConfig(profile string, region string, timeout time.Duration) (*Config, e
return nil, err
}

if region != "" {
awsCfg.Region = region
}

pluginPath, err := exec.LookPath("session-manager-plugin")
if err != nil {
return nil, fmt.Errorf(`session-manager-plugin not found
Expand Down

0 comments on commit a61bf3c

Please sign in to comment.