Skip to content

Commit

Permalink
When the provider assumes a given role, don't use the default profile…
Browse files Browse the repository at this point in the history
… if the profile is not given, but allow aws-sdk-go to find the credentials using the default credential provider chain (#86)

Signed-off-by: Massimo Battestini <[email protected]>
  • Loading branch information
massimob76 committed Sep 25, 2023
1 parent 585761c commit b113bb3
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions provider/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -397,9 +397,7 @@ func getClient(conf *ProviderConf) (*elastic7.Client, error) {

func assumeRoleCredentials(region, roleARN, roleExternalID, profile string) *awscredentials.Credentials {
sessOpts := awsSessionOptions(region)
if profile == "" {
sessOpts.Profile = "default"
} else {
if profile != "" {
sessOpts.Profile = profile
}

Expand Down

0 comments on commit b113bb3

Please sign in to comment.