From d501530898386635867b14ae715e47814a3ba26a Mon Sep 17 00:00:00 2001 From: Rintaro Okamura Date: Tue, 16 Jun 2020 10:02:20 +0900 Subject: [PATCH] :sparkles: aws region can be specified with empty string Signed-off-by: Rintaro Okamura --- internal/db/storage/blob/s3/session/session.go | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) 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,