diff --git a/flow/connectors/utils/aws.go b/flow/connectors/utils/aws.go index 27bae6e63a..e936ea6192 100644 --- a/flow/connectors/utils/aws.go +++ b/flow/connectors/utils/aws.go @@ -6,7 +6,6 @@ import ( "strings" "github.com/aws/aws-sdk-go/aws" - "github.com/aws/aws-sdk-go/aws/credentials/stscreds" "github.com/aws/aws-sdk-go/aws/session" "github.com/aws/aws-sdk-go/service/s3" ) @@ -73,21 +72,10 @@ func CreateS3Client() (*s3.S3, error) { return nil, fmt.Errorf("failed to get AWS secrets: %w", err) } - if awsSecrets.AwsRoleArn != "" { - sess := session.Must(session.NewSession(&aws.Config{ - Region: aws.String(awsSecrets.Region), - })) + sess := session.Must(session.NewSession(&aws.Config{ + Region: aws.String(awsSecrets.Region), + })) - creds := stscreds.NewCredentials(sess, awsSecrets.AwsRoleArn) - - s3svc := s3.New(sess, &aws.Config{Credentials: creds}) - return s3svc, nil - } else { - sess := session.Must(session.NewSession(&aws.Config{ - Region: aws.String(awsSecrets.Region), - })) - - s3svc := s3.New(sess) - return s3svc, nil - } + s3svc := s3.New(sess) + return s3svc, nil }