Skip to content

Commit 143b21c

Browse files
committed
Allow direct configuration of AWSCredentialsProvider
Summary: That way we can share the provider among different instances of RocksDB-Cloud Test Plan: Compiles Reviewers: hieu Differential Revision: https://rockset.phacility.com/D10068
1 parent b73440f commit 143b21c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

cloud/aws/aws_env.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ Status AwsCloudAccessCredentials::GetCredentialsProvider(
115115
std::shared_ptr<Aws::Auth::AWSCredentialsProvider>* result) const {
116116
result->reset();
117117

118+
if (provider) {
119+
*result = provider;
120+
return Status::OK();
121+
}
122+
118123
AwsAccessType aws_type = GetAccessType();
119124
Status status = CheckCredentials(aws_type);
120125
if (status.ok()) {

include/rocksdb/cloud/cloud_env_options.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@ class AwsCloudAccessCredentials {
8181
std::string secret_key;
8282
std::string config_file;
8383
AwsAccessType type{AwsAccessType::kUndefined};
84+
85+
// If non-nullptr, all of the above options are ignored.
86+
std::shared_ptr<Aws::Auth::AWSCredentialsProvider> provider;
8487
};
8588

8689
// Defines parameters required to connect to Kafka

0 commit comments

Comments
 (0)