Skip to content

Commit ed7c302

Browse files
authored
Merge pull request #1803 from adamjohnson01/aws-session
Use session.NewSession in order to use AssumeRoleWithWebIdentity
2 parents 4f626a6 + 89527da commit ed7c302

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

pkg/chunk/aws/dynamodb_storage_client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -861,5 +861,5 @@ func awsSessionFromURL(awsURL *url.URL) (client.ConfigProvider, error) {
861861
return nil, err
862862
}
863863
config = config.WithMaxRetries(0) // We do our own retries, so we can monitor them
864-
return session.New(config), nil
864+
return session.NewSession(config)
865865
}

pkg/chunk/aws/s3_storage_client.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,11 @@ func NewS3ObjectClient(cfg StorageConfig, schemaCfg chunk.SchemaConfig) (chunk.O
5151
s3Config = s3Config.WithS3ForcePathStyle(cfg.S3ForcePathStyle) // support for Path Style S3 url if has the flag
5252

5353
s3Config = s3Config.WithMaxRetries(0) // We do our own retries, so we can monitor them
54-
s3Client := s3.New(session.New(s3Config))
54+
sess, err := session.NewSession(s3Config)
55+
if err != nil {
56+
return nil, err
57+
}
58+
s3Client := s3.New(sess)
5559
bucketNames := []string{strings.TrimPrefix(cfg.S3.URL.Path, "/")}
5660
if cfg.BucketNames != "" {
5761
bucketNames = strings.Split(cfg.BucketNames, ",") // comma separated list of bucket names

0 commit comments

Comments
 (0)