From b113bb371995d525bbb3850d9946052509319985 Mon Sep 17 00:00:00 2001 From: Massimo Battestini Date: Mon, 25 Sep 2023 18:34:58 +0200 Subject: [PATCH] When the provider assumes a given role, don't use the default profile 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 --- provider/provider.go | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/provider/provider.go b/provider/provider.go index 036b06b..53288bc 100644 --- a/provider/provider.go +++ b/provider/provider.go @@ -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 }