Skip to content

Commit 343a1bb

Browse files
committed
fix: aws s3 config
1 parent 5d6b5a8 commit 343a1bb

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

rollup/internal/controller/blob_uploader/s3_sender.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,6 @@ type S3Uploader struct {
2525
func NewS3Uploader(cfg *config.AWSS3Config) (*S3Uploader, error) {
2626
// load AWS config
2727
var opts []func(*awsconfig.LoadOptions) error
28-
opts = append(opts, awsconfig.WithRegion(cfg.Region))
29-
3028
// if AccessKey && SecretKey provided, use it
3129
if cfg.AccessKey != "" && cfg.SecretKey != "" {
3230
opts = append(opts, awsconfig.WithCredentialsProvider(
@@ -38,6 +36,10 @@ func NewS3Uploader(cfg *config.AWSS3Config) (*S3Uploader, error) {
3836
)
3937
}
4038

39+
if cfg.Region != "" {
40+
opts = append(opts, awsconfig.WithRegion(cfg.Region))
41+
}
42+
4143
awsCfg, err := awsconfig.LoadDefaultConfig(context.Background(), opts...)
4244
if err != nil {
4345
return nil, fmt.Errorf("failed to load default config: %w", err)

0 commit comments

Comments
 (0)