diff --git a/internal/db/storage/blob/s3/session/session.go b/internal/db/storage/blob/s3/session/session.go index ac0082f171..02d87e038d 100644 --- a/internal/db/storage/blob/s3/session/session.go +++ b/internal/db/storage/blob/s3/session/session.go @@ -60,16 +60,12 @@ func New(opts ...Option) Session { } func (s *sess) Session() (*session.Session, error) { - cfg := aws.NewConfig() + cfg := aws.NewConfig().WithRegion(s.region) if s.endpoint != "" { cfg = cfg.WithEndpoint(s.endpoint) } - if s.region != "" { - cfg = cfg.WithRegion(s.region) - } - if s.accessKey != "" && s.secretAccessKey != "" { creds := credentials.NewStaticCredentials( s.accessKey,