diff --git a/pkg/aws/s3/s3.go b/pkg/aws/s3/s3.go index 96e59cc..3ba2d3e 100644 --- a/pkg/aws/s3/s3.go +++ b/pkg/aws/s3/s3.go @@ -307,6 +307,11 @@ func (s *service) DeleteObjects(ctx context.Context, bucketName string, objects } func newS3Client(region string, awsEndpoint string) *s3.Client { + // Default to us-east-1 if no region is provided + if region == "" { + region = "us-east-1" + } + // Initialize AWS S3 Client cfg, err := config.New(region) if err != nil { diff --git a/pkg/aws/s3/s3_test.go b/pkg/aws/s3/s3_test.go index 4b878d7..8295f70 100644 --- a/pkg/aws/s3/s3_test.go +++ b/pkg/aws/s3/s3_test.go @@ -67,7 +67,7 @@ func Test_newS3Client(t *testing.T) { if got == nil { t.Errorf("newS3Client() returned nil when it wasn't supposed to") } - if tt.args.region == "" && got.Options().Region != "us-west-2" { + if tt.args.region == "" && got.Options().Region != "us-east-1" { t.Errorf("newS3Client() returned client with region set to %s", got.Options().Region) } if got.Options().Region != tt.args.region && tt.args.region != "" {