Skip to content

Find, verify, and analyze leaked credentials

test(sources/s3): fix missing region error (#4131)

Eng Zer Jun90190deac642
diff --git a/pkg/sources/s3/s3.go b/pkg/sources/s3/s3.go
index 5d20675cb..782171318 100644
--- a/pkg/sources/s3/s3.go
+++ b/pkg/sources/s3/s3.go
@@ -158,7 +158,7 @@ func (s *Source) newClient(ctx context.Context, region, roleArn string) (*s3.Cli
if roleArn != "" {
// The config loaded here will be used to retrieve and refresh temporary credentials from AssumeRole
- cfg, err := config.LoadDefaultConfig(ctx, config.WithCredentialsProvider(credsProvider))
+ cfg, err := config.LoadDefaultConfig(ctx, config.WithRegion(region), config.WithCredentialsProvider(credsProvider))
if err != nil {
return nil, err
}