AWS SDK for C++

AWS SDK for C++ Version 1.11.678

Loading...
Searching...
No Matches
S3CrtClientConfiguration.h
1
6#pragma once
7
8#include <aws/core/auth/signer/AWSAuthV4Signer.h>
9#include <aws/core/client/GenericClientConfiguration.h>
10#include <aws/crt/io/Bootstrap.h>
11#include <aws/crt/io/TlsOptions.h>
12#include <aws/io/retry_strategy.h>
13#include <aws/s3-crt/S3Crt_EXPORTS.h>
14#include <aws/s3-crt/S3ExpressIdentityProvider.h>
15
16namespace Aws {
17namespace S3Crt {
19 NOT_SET,
20 LEGACY, // stands for using global endpoint for us-east-1,
21 REGIONAL // stands for using regional endpoint for us-east-1
22};
23
26
28
35 S3CrtClientConfiguration(const char* profileName, bool shouldDisableIMDS = false);
36
43 S3CrtClientConfiguration(bool useSmartDefaults, const char* defaultMode = "legacy", bool shouldDisableIMDS = false);
44
49 const Client::ClientConfiguration& config,
50 Client::AWSAuthV4Signer::PayloadSigningPolicy iPayloadSigningPolicy = Client::AWSAuthV4Signer::PayloadSigningPolicy::Never,
51 bool iUseVirtualAddressing = true,
52 US_EAST_1_REGIONAL_ENDPOINT_OPTION iUseUSEast1RegionalEndPointOption = US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET);
53
54 bool useVirtualAddressing = true;
55 US_EAST_1_REGIONAL_ENDPOINT_OPTION useUSEast1RegionalEndPointOption = US_EAST_1_REGIONAL_ENDPOINT_OPTION::NOT_SET;
56 bool disableMultiRegionAccessPoints = false;
57 bool useArnRegion = false;
58 Client::AWSAuthV4Signer::PayloadSigningPolicy payloadSigningPolicy = Client::AWSAuthV4Signer::PayloadSigningPolicy::RequestDependent;
59 bool disableS3ExpressAuth = false;
60 using IdentityProviderSupplier = std::function<std::shared_ptr<S3ExpressIdentityProvider>(const S3CrtClient&)>;
61 IdentityProviderSupplier identityProviderSupplier = [](const S3CrtClient& client) -> std::shared_ptr<S3ExpressIdentityProvider> {
62 return Aws::MakeShared<DefaultS3ExpressIdentityProvider>("S3CrtClientConfiguration", client);
63 };
64
65 /* S3 CRT specifics */
68
75 std::function<aws_retry_strategy*(const S3Crt::S3CrtClientConfiguration&)> retryStrategyCreateFn;
76
78 };
79
80 S3CrtConfigFactories crtConfigFactories = S3CrtConfigFactories::defaultFactories;
81
85 std::shared_ptr<Aws::Crt::Io::ClientBootstrap> clientBootstrap;
86
90 size_t partSize = 8 * 1024 * 1024;
91
95 std::shared_ptr<Aws::Crt::Io::TlsConnectionOptions> tlsConnectionOptions;
96
97 /* Throughput target in Gbps that we are trying to reach. Normally it's the NIC's throughput */
98 double throughputTargetGbps = 10.0;
99
104 size_t downloadMemoryUsageWindow = 0;
105
109 uint64_t memoryLimitBytes = 0;
110
111 /* Callback and associated user data for when the client has completed its shutdown process. */
112 std::function<void(void*)> clientShutdownCallback;
113 void* shutdownCallbackUserData = nullptr;
114
117 NOT_SET = 0, /* Defaults to match SDK retry strategy. */
118 DEFAULT,
119 STANDARD,
120 EXPONENTIAL_BACKOFF,
121 NO_RETRY = -1,
122 } crtRetryStrategyType = CrtRetryStrategyType::NOT_SET;
123
128 /* Maximum number of request retries. Specifying 0 here will fall back to the default set by aws-c-io. */
129 size_t maxRetries = 0;
130
131 /* Scale factor (in milliseconds) for the back-off value. */
132 uint32_t scaleFactorMs = 500;
133
134 /* Maximum delay between retries (in seconds). Specifying 0 here will fall back to the default set by aws-c-io. */
135 uint32_t maxBackoffSecs = 20;
136 } config;
137 } crtRetryStrategyConfig;
138
147 size_t multipartUploadThreshold{0};
148
155
162 SEEK_STREAM,
163 SKIP_CONTENT_LENGTH,
164 } contentLengthConfiguration{CONTENT_LENGTH_CONFIGURATION::SEEK_STREAM};
165 /* End of S3 CRT specifics */
166 private:
167 void LoadS3CrtSpecificConfig(const Aws::String& profileName);
168};
169} // namespace S3Crt
170} // namespace Aws
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
std::vector< T, Aws::Allocator< T > > Vector
std::shared_ptr< Aws::Crt::Io::ClientBootstrap > clientBootstrap
S3CrtClientConfiguration(const Client::ClientConfigurationInitValues &configuration={})
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::function< std::shared_ptr< S3ExpressIdentityProvider >(const S3CrtClient &)> IdentityProviderSupplier
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)