diff --git a/src/uFWManager.cpp b/src/uFWManager.cpp index c93a68e..26c8677 100644 --- a/src/uFWManager.cpp +++ b/src/uFWManager.cpp @@ -59,12 +59,13 @@ namespace uCentral::FWManager { S3Key_ = uCentral::ServiceConfig::GetString("s3.key"); S3Retry_ = uCentral::ServiceConfig::GetInt("s3.retry",60); + AwsConfig_ = std::make_unique(); if(!S3Region_.empty()) - AwsConfig_.region = S3Region_; - - AwsCreds_.SetAWSAccessKeyId(S3Key_.c_str()); - AwsCreds_.SetAWSSecretKey(S3Secret_.c_str()); - S3Client_ = std::make_unique(AwsCreds_,AwsConfig_); + AwsConfig_->region = S3Region_; + AwsCreds_ = std::make_unique(); + AwsCreds_->SetAWSAccessKeyId(S3Key_.c_str()); + AwsCreds_->SetAWSSecretKey(S3Secret_.c_str()); + S3Client_ = std::make_unique(*AwsCreds_,*AwsConfig_); Logger_.information("Starting "); Worker_.start(*this); diff --git a/src/uFWManager.h b/src/uFWManager.h index 816e39a..48dbd12 100644 --- a/src/uFWManager.h +++ b/src/uFWManager.h @@ -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 S3Client_; + std::unique_ptr AwsConfig_; + std::unique_ptr AwsCreds_; + std::unique_ptr S3Client_; int Start() override; void Stop() override;