This commit is contained in:
stephb9959
2021-05-14 08:46:57 -07:00
parent fec9e7f575
commit 0bb40948de
2 changed files with 9 additions and 8 deletions

View File

@@ -59,12 +59,13 @@ namespace uCentral::FWManager {
S3Key_ = uCentral::ServiceConfig::GetString("s3.key");
S3Retry_ = uCentral::ServiceConfig::GetInt("s3.retry",60);
AwsConfig_ = std::make_unique<Aws::Client::ClientConfiguration>();
if(!S3Region_.empty())
AwsConfig_.region = S3Region_;
AwsCreds_.SetAWSAccessKeyId(S3Key_.c_str());
AwsCreds_.SetAWSSecretKey(S3Secret_.c_str());
S3Client_ = std::make_unique<Aws::S3::S3Client>(AwsCreds_,AwsConfig_);
AwsConfig_->region = S3Region_;
AwsCreds_ = std::make_unique<Aws::Auth::AWSCredentials>();
AwsCreds_->SetAWSAccessKeyId(S3Key_.c_str());
AwsCreds_->SetAWSSecretKey(S3Secret_.c_str());
S3Client_ = std::make_unique<Aws::S3::S3Client>(*AwsCreds_,*AwsConfig_);
Logger_.information("Starting ");
Worker_.start(*this);

View File

@@ -51,9 +51,9 @@ class Service : public uSubSystemServer, Poco::Runnable {
std::string S3Key_;
std::string S3Secret_;
uint64_t S3Retry_;
Aws::Client::ClientConfiguration AwsConfig_;
Aws::Auth::AWSCredentials AwsCreds_;
std::unique_ptr<Aws::S3::S3Client> S3Client_;
std::unique_ptr<Aws::Client::ClientConfiguration> AwsConfig_;
std::unique_ptr<Aws::Auth::AWSCredentials> AwsCreds_;
std::unique_ptr<Aws::S3::S3Client> S3Client_;
int Start() override;
void Stop() override;