AWS SDK for C++

AWS SDK for C++ Version 1.11.717

Loading...
Searching...
No Matches
ClientConfiguration.h
1
6#pragma once
7
8#include <aws/core/Core_EXPORTS.h>
9#include <aws/core/Region.h>
10#include <aws/core/http/HttpTypes.h>
11#include <aws/core/http/Scheme.h>
12#include <aws/core/http/Version.h>
13#include <aws/core/utils/Array.h>
14#include <aws/core/utils/StringUtils.h>
15#include <aws/core/utils/memory/stl/AWSString.h>
16#include <aws/crt/Optional.h>
17#include <smithy/tracing/TelemetryProvider.h>
18
19#include <memory>
20
21namespace Aws
22{
23 namespace Utils
24 {
25 namespace Threading
26 {
27 class Executor;
28 } // namespace Threading
29
30 namespace RateLimits
31 {
32 class RateLimiterInterface;
33 } // namespace RateLimits
34 } // namespace Utils
35 namespace Client
36 {
37 class RetryStrategy; // forward declare
38
46 {
47 DEFAULT,
48 ALWAYS,
49 NEVER
50 };
51
56 {
57 DISABLE,
58 ENABLE,
59 };
60
69 };
70
79 };
80
87 DEFAULT,
89 };
90
94 };
100 bool shouldDisableIMDS = false;
101 };
102
107 struct AWS_CORE_API ClientConfiguration
108 {
110 {
114 std::function<std::shared_ptr<RetryStrategy>()> retryStrategyCreateFn;
120 std::function<std::shared_ptr<Utils::Threading::Executor>()> executorCreateFn;
124 std::function<std::shared_ptr<Utils::RateLimits::RateLimiterInterface>()> writeRateLimiterCreateFn;
128 std::function<std::shared_ptr<Utils::RateLimits::RateLimiterInterface>()> readRateLimiterCreateFn;
132 std::function<std::shared_ptr<smithy::components::tracing::TelemetryProvider>()> telemetryProviderCreateFn;
133
135 };
136
138
144
151 ClientConfiguration(const char* profileName, bool shouldDisableIMDS = false);
152
159 explicit ClientConfiguration(bool useSmartDefaults, const char* defaultMode = "legacy", bool shouldDisableIMDS = false);
160
164 virtual ~ClientConfiguration() = default;
165
169 ProviderFactories configFactories = ProviderFactories::defaultFactories;
170
186 bool useDualStack = false;
187
191 bool useFIPS = false;
192
196 unsigned maxConnections = 25;
202 long httpRequestTimeoutMs = 0;
210 long requestTimeoutMs = 0;
214 long connectTimeoutMs = 1000;
219 bool enableTcpKeepAlive = true;
225 unsigned long tcpKeepAliveIntervalMs = 30000;
230 unsigned long lowSpeedLimit = 1;
235 std::shared_ptr<RetryStrategy> retryStrategy = nullptr;
240
244 bool allowSystemProxy = false;
256 unsigned proxyPort = 0;
298 std::shared_ptr<Aws::Utils::Threading::Executor> executor = nullptr;
303 bool verifySSL = true;
334 std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> writeRateLimiter = nullptr;
339 std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> readRateLimiter = nullptr;
348 Aws::Http::TransferLibPerformanceMode httpLibPerfMode = Http::TransferLibPerformanceMode::LOW_LATENCY;
353
363 bool disableExpectHeader = false;
364
368 bool enableClockSkewAdjustment = true;
369
377 bool enableHostPrefixInjection = true;
378
390 Aws::Crt::Optional<bool> enableEndpointDiscovery;
391
396 bool enableHttpClientTrace = false;
397
402
409
413 bool disableIMDS = false;
414
423 Aws::Http::Version version = Http::Version::HTTP_VERSION_2TLS;
424
428 bool disableImdsV1 = false;
429
439
440 struct {
446 RequestChecksumCalculation requestChecksumCalculation = RequestChecksumCalculation::WHEN_SUPPORTED;
447
453 ResponseChecksumValidation responseChecksumValidation = ResponseChecksumValidation::WHEN_SUPPORTED;
454 } checksumConfig;
455
459 static Aws::String LoadConfigFromEnvOrProfile(const Aws::String& envKey, const Aws::String& profile,
460 const Aws::String& profileProperty, const Aws::Vector<Aws::String>& allowedValues,
461 const Aws::String& defaultValue);
469 const Aws::String& envKey, const Aws::String& profile, const Aws::String& profileProperty,
470 const Aws::Vector<Aws::String>& allowedValues, const Aws::String& defaultValue,
471 const std::function<Aws::String(const char*)>& envValueMapping = Utils::StringUtils::ToLower);
472
477 std::shared_ptr<smithy::components::tracing::TelemetryProvider> telemetryProvider;
478
488 bool useAnonymousAuth = false;
489 } winHTTPOptions;
490
498
505 Aws::String accountIdEndpointMode = "preferred";
506
511 HttpClientChunkedMode httpClientChunkedMode = HttpClientChunkedMode::CLIENT_IMPLEMENTATION;
523
528
532 struct {
536 long metadataServiceNumAttempts = 1;
537
541 long metadataServiceTimeout = 1;
542
546 std::shared_ptr<RetryStrategy> imdsRetryStrategy;
549 } imdsConfig;
550
557 : roleArn(role), sessionName(session), tokenFilePath(tokenFile) {};
570
574 std::chrono::milliseconds retrieveCredentialsFutureTimeout = std::chrono::seconds(10);
575
579 std::chrono::milliseconds credentialCacheCacheTTL = std::chrono::minutes(50);
580 } stsCredentialsProviderConfig;
585 Aws::String loginSession{};
586
591 Aws::String loginCacheOverride{};
592
596 std::chrono::milliseconds retrieveCredentialsFutureTimeout = std::chrono::seconds(10);
597 } loginCredentialProviderConfig;
598 } credentialProviderConfig;
599
605 };
606
611 AWS_CORE_API std::shared_ptr<RetryStrategy> InitRetryStrategy(Aws::String retryMode = "");
612 AWS_CORE_API std::shared_ptr<RetryStrategy> InitRetryStrategy(int maxRetries, Aws::String retryMode = "");
613
618 AWS_CORE_API Aws::String ComputeUserAgentString(ClientConfiguration const * const pConfig = nullptr);
619
620 AWS_CORE_API Aws::String FilterUserAgentToken(char const * const token);
621 } // namespace Client
622} // namespace Aws
AWS_CORE_API Aws::String FilterUserAgentToken(char const *const token)
AWS_CORE_API Aws::String ComputeUserAgentString(ClientConfiguration const *const pConfig=nullptr)
AWS_CORE_API std::shared_ptr< RetryStrategy > InitRetryStrategy(Aws::String retryMode="")
TransferLibPerformanceMode
Definition HttpTypes.h:43
std::basic_string< char, std::char_traits< char >, Aws::Allocator< char > > String
Definition AWSString.h:97
std::vector< T, Aws::Allocator< T > > Vector
Definition AWSVector.h:17
STSCredentialsCredentialProviderConfiguration(const Aws::String &role, const Aws::String &session, const String &tokenFile)
std::function< std::shared_ptr< Utils::Threading::Executor >()> executorCreateFn
std::function< std::shared_ptr< Utils::RateLimits::RateLimiterInterface >()> readRateLimiterCreateFn
std::function< std::shared_ptr< smithy::components::tracing::TelemetryProvider >()> telemetryProviderCreateFn
std::function< std::shared_ptr< Utils::RateLimits::RateLimiterInterface >()> writeRateLimiterCreateFn
std::function< std::shared_ptr< RetryStrategy >()> retryStrategyCreateFn
Aws::Crt::Optional< bool > enableEndpointDiscovery
ClientConfiguration(const char *profileName, bool shouldDisableIMDS=false)
static Aws::String LoadConfigFromEnvOrProfileCaseSensitive(const Aws::String &envKey, const Aws::String &profile, const Aws::String &profileProperty, const Aws::Vector< Aws::String > &allowedValues, const Aws::String &defaultValue, const std::function< Aws::String(const char *)> &envValueMapping=Utils::StringUtils::ToLower)
static Aws::String LoadConfigFromEnvOrProfile(const Aws::String &envKey, const Aws::String &profile, const Aws::String &profileProperty, const Aws::Vector< Aws::String > &allowedValues, const Aws::String &defaultValue)
Aws::Http::TransferLibType httpLibOverride
Aws::Vector< Aws::String > authPreferences
Aws::Client::RequestCompressionConfig requestCompressionConfig
ClientConfiguration(const ClientConfigurationInitValues &configuration)
virtual ~ClientConfiguration()=default
ClientConfiguration(bool useSmartDefaults, const char *defaultMode="legacy", bool shouldDisableIMDS=false)
Aws::Utils::Array< Aws::String > nonProxyHosts
std::shared_ptr< smithy::components::tracing::TelemetryProvider > telemetryProvider