AWS SDK for C++

AWS SDK for C++ Version 1.11.440

Loading...
Searching...
No Matches
S3CrtClientConfiguration.h
1
6#pragma once
7
8#include <aws/s3-crt/S3Crt_EXPORTS.h>
9#include <aws/s3-crt/S3ExpressIdentityProvider.h>
10#include <aws/core/client/GenericClientConfiguration.h>
11#include <aws/core/auth/signer/AWSAuthV4Signer.h>
12#include <aws/crt/io/Bootstrap.h>
13#include <aws/crt/io/TlsOptions.h>
14#include <aws/io/retry_strategy.h>
15
16
17namespace Aws
18{
19 namespace S3Crt
20 {
22 {
23 NOT_SET,
24 LEGACY, //stands for using global endpoint for us-east-1,
25 REGIONAL //stands for using regional endpoint for us-east-1
26 };
27
29 {
31
33
40 S3CrtClientConfiguration(const char* profileName, bool shouldDisableIMDS = false);
41
48 S3CrtClientConfiguration(bool useSmartDefaults, const char* defaultMode = "legacy", bool shouldDisableIMDS = false);
49
54 Client::AWSAuthV4Signer::PayloadSigningPolicy iPayloadSigningPolicy = Client::AWSAuthV4Signer::PayloadSigningPolicy::Never,
55 bool iUseVirtualAddressing = true,
56 US_EAST_1_REGIONAL_ENDPOINT_OPTION iUseUSEast1RegionalEndPointOption = US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET);
57
58 bool useVirtualAddressing = true;
59 US_EAST_1_REGIONAL_ENDPOINT_OPTION useUSEast1RegionalEndPointOption = US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET;
60 bool disableMultiRegionAccessPoints = false;
61 bool useArnRegion = false;
62 Client::AWSAuthV4Signer::PayloadSigningPolicy payloadSigningPolicy = Client::AWSAuthV4Signer::PayloadSigningPolicy::RequestDependent;
63 bool disableS3ExpressAuth = false;
64 using IdentityProviderSupplier = std::function<std::shared_ptr<S3ExpressIdentityProvider> (const S3CrtClient &)>;
65 IdentityProviderSupplier identityProviderSupplier = [](const S3CrtClient &client) -> std::shared_ptr<S3ExpressIdentityProvider> {
66 return Aws::MakeShared<DefaultS3ExpressIdentityProvider>("S3CrtClientConfiguration", client);
67 };
68
69 /* S3 CRT specifics */
72
74 {
80 std::function<aws_retry_strategy*(const S3Crt::S3CrtClientConfiguration&)> retryStrategyCreateFn;
81
83 };
84
85 S3CrtConfigFactories crtConfigFactories = S3CrtConfigFactories::defaultFactories;
86
90 std::shared_ptr<Aws::Crt::Io::ClientBootstrap> clientBootstrap;
91
95 size_t partSize = 8 * 1024 * 1024;
96
100 std::shared_ptr<Aws::Crt::Io::TlsConnectionOptions> tlsConnectionOptions;
101
102 /* Throughput target in Gbps that we are trying to reach. Normally it's the NIC's throughput */
103 double throughputTargetGbps = 10.0;
104
109 size_t downloadMemoryUsageWindow = 0;
110
114 uint64_t memoryLimitBytes = 0;
115
116 /* Callback and associated user data for when the client has completed its shutdown process. */
117 std::function<void(void*)> clientShutdownCallback;
118 void *shutdownCallbackUserData = nullptr;
119
121 {
123 {
124 NOT_SET=0, /* Defaults to match SDK retry strategy. */
125 DEFAULT,
126 STANDARD,
127 EXPONENTIAL_BACKOFF,
128 NO_RETRY=-1,
129 } crtRetryStrategyType = CrtRetryStrategyType::NOT_SET;
130
132 {
136 /* Maximum number of request retries. Specifying 0 here will fall back to the default set by aws-c-io. */
137 size_t maxRetries = 0;
138
139 /* Scale factor (in milliseconds) for the back-off value. */
140 uint32_t scaleFactorMs = 500;
141
142 /* Maximum delay between retries (in seconds). Specifying 0 here will fall back to the default set by aws-c-io. */
143 uint32_t maxBackoffSecs = 20;
144 } config;
145 } crtRetryStrategyConfig;
146
155 size_t multipartUploadThreshold{0};
156 /* End of S3 CRT specifics */
157 private:
158 void LoadS3CrtSpecificConfig(const Aws::String& profileName);
159 };
160 }
161}
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::shared_ptr< Aws::Crt::Io::ClientBootstrap > clientBootstrap
S3CrtClientConfiguration(const Client::ClientConfigurationInitValues &configuration={})
std::function< std::shared_ptr< S3ExpressIdentityProvider >(const S3CrtClient &)> IdentityProviderSupplier
S3CrtClientConfiguration & operator=(const S3CrtClientConfiguration &)=default
std::function< void(void *)> clientShutdownCallback
S3CrtClientConfiguration(const S3CrtClientConfiguration &)=default
S3CrtClientConfiguration(const Client::ClientConfiguration &config, Client::AWSAuthV4Signer::PayloadSigningPolicy iPayloadSigningPolicy=Client::AWSAuthV4Signer::PayloadSigningPolicy::Never, bool iUseVirtualAddressing=true, US_EAST_1_REGIONAL_ENDPOINT_OPTION iUseUSEast1RegionalEndPointOption=US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET)
std::shared_ptr< Aws::Crt::Io::TlsConnectionOptions > tlsConnectionOptions
S3CrtClientConfiguration(const char *profileName, bool shouldDisableIMDS=false)
S3CrtClientConfiguration(bool useSmartDefaults, const char *defaultMode="legacy", bool shouldDisableIMDS=false)