From 34bf64d256bf5ef3a3de31ef39b04a9f531ef377 Mon Sep 17 00:00:00 2001 From: Tiger Kaovilai Date: Fri, 20 Oct 2023 14:01:26 -0400 Subject: [PATCH] kopia/repository/config/aws.go: Set session.Options profile from config Signed-off-by: Tiger Kaovilai --- pkg/repository/config/aws.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/repository/config/aws.go b/pkg/repository/config/aws.go index cc4e14f598a..a12d4587c67 100644 --- a/pkg/repository/config/aws.go +++ b/pkg/repository/config/aws.go @@ -64,7 +64,7 @@ func GetS3ResticEnvVars(config map[string]string) (map[string]string, error) { result[awsSecretKeyEnvVar] = creds.SecretAccessKey result[awsSessTokenEnvVar] = creds.SessionToken result[awsCredentialsFileEnvVar] = "" - result[awsProfileEnvVar] = "" + result[awsProfileEnvVar] = "" // profile is not needed since we have the credentials from profile via GetS3Credentials result[awsConfigFileEnvVar] = "" } @@ -87,6 +87,7 @@ func GetS3Credentials(config map[string]string) (*credentials.Value, error) { opts.SharedConfigFiles = append(opts.SharedConfigFiles, credentialsFile) opts.SharedConfigState = session.SharedConfigEnable } + opts.Profile = config[awsProfileKey] sess, err := session.NewSessionWithOptions(opts) if err != nil {