Skip to content

Commit 6b29117

Browse files
Pass AWS client config when creating STSAssumeRoleCredentialsProvider. (#4616)
This fixes an issue with assume role where the client configuration was not getting passed to the `STSAssumeRoleCredentialsProvider`, which resulted in options like the CA path not being honored when the AWS SDK was making HTTP requests for assume role. --- TYPE: BUG DESC: Fix HTTP requests for AWS assume role not honoring config options. Co-authored-by: Theodore Tsirpanis <[email protected]>
1 parent a89484c commit 6b29117

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tiledb/sm/filesystem/s3.cc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@
5151
#include <aws/core/utils/memory/stl/AWSStringStream.h>
5252
#include <aws/s3/model/AbortMultipartUploadRequest.h>
5353
#include <aws/s3/model/CreateMultipartUploadRequest.h>
54+
#include <aws/sts/STSClient.h>
5455
#include <boost/interprocess/streams/bufferstream.hpp>
5556
#include <fstream>
5657
#include <iostream>
@@ -1307,8 +1308,7 @@ Status S3::init_client() const {
13071308
// check for client configuration on create, which can be slow if aws is not
13081309
// configured on a users systems due to ec2 metadata check
13091310

1310-
client_config_ = tdb_unique_ptr<Aws::Client::ClientConfiguration>(
1311-
tdb_new(Aws::Client::ClientConfiguration));
1311+
client_config_ = make_shared<Aws::Client::ClientConfiguration>(HERE());
13121312

13131313
s3_tp_executor_ = make_shared<S3ThreadPoolExecutor>(HERE(), vfs_thread_pool_);
13141314

@@ -1403,7 +1403,7 @@ Status S3::init_client() const {
14031403
session_name,
14041404
external_id,
14051405
load_frequency,
1406-
nullptr);
1406+
make_shared<Aws::STS::STSClient>(HERE(), client_config));
14071407
break;
14081408
}
14091409
case 7: {

tiledb/sm/filesystem/s3.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1240,7 +1240,7 @@ class S3 {
12401240
mutable std::mutex client_init_mtx_;
12411241

12421242
/** Configuration object used to initialize the client. */
1243-
mutable tdb_unique_ptr<Aws::Client::ClientConfiguration> client_config_;
1243+
mutable shared_ptr<Aws::Client::ClientConfiguration> client_config_;
12441244

12451245
/** The executor used by 'client_'. */
12461246
mutable shared_ptr<S3ThreadPoolExecutor> s3_tp_executor_;

0 commit comments

Comments
 (0)