AWS SDK for C++

AWS SDK for C++ Version 1.11.788

Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Aws::Client::ClientConfiguration Struct Reference

#include <ClientConfiguration.h>

Inheritance diagram for Aws::Client::ClientConfiguration:
[legend]

Classes

 
 
 

Public Member Functions

 
 
 ClientConfiguration (const char *profileName, bool shouldDisableIMDS=false)
 
 ClientConfiguration (bool useSmartDefaults, const char *defaultMode="legacy", bool shouldDisableIMDS=false)
 
virtual ~ClientConfiguration ()=default
 

Static Public Member Functions

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)
 
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)
 

Public Attributes

 
 
 
 
bool useDualStack = false
 
bool useFIPS = false
 
unsigned maxConnections = 25
 
 
 
long connectTimeoutMs = 1000
 
bool enableTcpKeepAlive = true
 
unsigned long tcpKeepAliveIntervalMs = 30000
 
unsigned long lowSpeedLimit = 1
 
std::shared_ptr< RetryStrategyretryStrategy = nullptr
 
 
bool allowSystemProxy = false
 
 
 
unsigned proxyPort = 0
 
 
 
 
 
 
 
 
 
std::shared_ptr< Aws::Utils::Threading::Executorexecutor = nullptr
 
bool verifySSL = true
 
 
 
 
 
 
 
 
 
 
bool disableExpectHeader = false
 
 
 
Aws::Crt::Optional< bool > enableEndpointDiscovery
 
bool enableHttpClientTrace = false
 
 
 
bool disableIMDS = false
 
 
bool disableImdsV1 = false
 
 
struct { 
 
 
 
 
 
 
 
 
 
 
 
size_t awsChunkedBufferSize = 64UL * 1024
 

Detailed Description

This mutable structure is used to configure any of the AWS clients. Default values can only be overwritten prior to passing to the client constructors.

Definition at line 107 of file ClientConfiguration.h.

Constructor & Destructor Documentation

◆ ClientConfiguration() [1/4]

Aws::Client::ClientConfiguration::ClientConfiguration ( )

◆ ClientConfiguration() [2/4]

Aws::Client::ClientConfiguration::ClientConfiguration ( const ClientConfigurationInitValues configuration)

Create a configuration with default settings. By default IMDS calls are enabled.

Parameters
ClientConfigurationInitValuesClientConfiguration initial customizable values

◆ ClientConfiguration() [3/4]

Aws::Client::ClientConfiguration::ClientConfiguration ( const char *  profileName,
bool  shouldDisableIMDS = false 
)

Create a configuration based on settings in the aws configuration file for the given profile name. The configuration file location can be set via the environment variable AWS_CONFIG_FILE

Parameters
profileNamethe aws profile name.
shouldDisableIMDSwhether or not to disable IMDS calls.

◆ ClientConfiguration() [4/4]

Aws::Client::ClientConfiguration::ClientConfiguration ( bool  useSmartDefaults,
const char *  defaultMode = "legacy",
bool  shouldDisableIMDS = false 
)
explicit

Create a configuration with a predefined smart defaults

Parameters
useSmartDefaults,requiredto differentiate c-tors
defaultMode,defaultmode to use
shouldDisableIMDSwhether or not to disable IMDS calls.

◆ ~ClientConfiguration()

virtual Aws::Client::ClientConfiguration::~ClientConfiguration ( )
virtualdefault

Add virtual method to allow use of dynamic_cast under inheritance.

Member Function Documentation

◆ LoadConfigFromEnvOrProfile()

static Aws::String Aws::Client::ClientConfiguration::LoadConfigFromEnvOrProfile ( const Aws::String envKey,
const Aws::String profile,
const Aws::String profileProperty,
const Aws::Vector< Aws::String > &  allowedValues,
const Aws::String defaultValue 
)
static

A helper function to read config value from env variable or aws profile config

◆ LoadConfigFromEnvOrProfileCaseSensitive()

static Aws::String Aws::Client::ClientConfiguration::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

A helper function to read config value from env variable or aws profile config. Addresses a problem in LoadConfigFromEnvOrProfile where env variables values are always mapped to their lower case equivalent. This fails for cases where ENV vars need to be case sensitive in instances like AWS_ROLE_ARN can have camel case values.

Member Data Documentation

◆ accountId

Aws::String Aws::Client::ClientConfiguration::accountId

The AWS account ID. Used for account-based endpoint routing. An AWS account ID has a format like 111122223333. Account-based endpoint routing provides better request performance for some services.

https://docs.aws.amazon.com/sdkref/latest/guide/feature-account-endpoints.html

Definition at line 497 of file ClientConfiguration.h.

◆ accountIdEndpointMode

Aws::String Aws::Client::ClientConfiguration::accountIdEndpointMode = "preferred"

This setting is used to turn off account-based endpoint routing if necessary, and bypass account-based rules. Can be the case sensitive string values "required", "disabled", or "preferred". Defaults to "preferred".

https://docs.aws.amazon.com/sdkref/latest/guide/feature-account-endpoints.html

Definition at line 505 of file ClientConfiguration.h.

◆ allowSystemProxy

bool Aws::Client::ClientConfiguration::allowSystemProxy = false

Allow HTTP client to discover system proxy setting. Off by default for legacy reasons.

Definition at line 244 of file ClientConfiguration.h.

◆ appId

Aws::String Aws::Client::ClientConfiguration::appId

AppId is an optional application specific identifier that can be set. When set it will be appended to the User-Agent header of every request in the form of App/{AppId}. This variable is sourced from environment variable AWS_SDK_UA_APP_ID or the shared config profile attribute sdk_ua_app_id. See https://docs.aws.amazon.com/sdkref/latest/guide/settings-reference.html for more information on environment variables and shared config settings.

Definition at line 438 of file ClientConfiguration.h.

◆ authPreferences

Aws::Vector<Aws::String> Aws::Client::ClientConfiguration::authPreferences

Authentication scheme preferences in order of preference. First available auth scheme will be used for each operation.

Definition at line 604 of file ClientConfiguration.h.

◆ awsChunkedBufferSize

size_t Aws::Client::ClientConfiguration::awsChunkedBufferSize = 64UL * 1024

Buffer size in bytes that will be used to content encode bodies using aws-chunked. Changing this is useful when you want to minimize memory use while uploading to S3. Size MUST be greater than 8KB otherwise S3 will reject the request.

Defaults to 64KiB.

https://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html

Definition at line 616 of file ClientConfiguration.h.

◆ caFile

Aws::String Aws::Client::ClientConfiguration::caFile

If you certificate file is different from the default, you can tell clients that aren't using the default trust store where to find your ca file. If you are on windows or apple, you likely don't want this.

Definition at line 322 of file ClientConfiguration.h.

◆ caPath

Aws::String Aws::Client::ClientConfiguration::caPath

If your Certificate Authority path is different from the default, you can tell clients that aren't using the default trust store where to find your CA trust store. If you are on windows or apple, you likely don't want this.

Definition at line 309 of file ClientConfiguration.h.

◆ [struct]

struct { ... } Aws::Client::ClientConfiguration::checksumConfig

◆ configFactories

ProviderFactories Aws::Client::ClientConfiguration::configFactories = ProviderFactories::defaultFactories

Client configuration factory methods to init client utility classes such as Executor, Retry Strategy

Definition at line 169 of file ClientConfiguration.h.

◆ connectTimeoutMs

long Aws::Client::ClientConfiguration::connectTimeoutMs = 1000

Socket connect timeout. Default 1000 ms. Unless you are very far away from your the data center you are talking to, 1000ms is more than sufficient.

Definition at line 214 of file ClientConfiguration.h.

◆ credentialProviderConfig

struct Aws::Client::ClientConfiguration::CredentialProviderConfiguration Aws::Client::ClientConfiguration::credentialProviderConfig

◆ disableExpectHeader

bool Aws::Client::ClientConfiguration::disableExpectHeader = false

Only works for Curl http client. Curl will by default add "Expect: 100-Continue" header in a Http request so as to avoid sending http payload to wire if server respond error immediately after receiving the header. Set this option to true will tell Curl to send http request header and body together. This can save one round-trip time and especially useful when the payload is small and network latency is more important. But be careful when Http request has large payload such S3 PutObject. You don't want to spend long time sending a large payload just getting a error response for server. The default value will be false.

Definition at line 363 of file ClientConfiguration.h.

◆ disableIMDS

bool Aws::Client::ClientConfiguration::disableIMDS = false

Disable all internal IMDS Calls

Definition at line 413 of file ClientConfiguration.h.

◆ disableImdsV1

bool Aws::Client::ClientConfiguration::disableImdsV1 = false

Disable all internal IMDSV1 Calls

Definition at line 428 of file ClientConfiguration.h.

◆ enableClockSkewAdjustment

bool Aws::Client::ClientConfiguration::enableClockSkewAdjustment = true

If set to true clock skew will be adjusted after each http attempt, default to true.

Definition at line 368 of file ClientConfiguration.h.

◆ enableEndpointDiscovery

Aws::Crt::Optional<bool> Aws::Client::ClientConfiguration::enableEndpointDiscovery

Enable endpoint discovery For some services to dynamically set up their endpoints for different requests. By default, service clients will decide if endpoint discovery is enabled or not. If disabled, regional or overridden endpoint will be used instead. If a request requires endpoint discovery but you disabled it. The request will never succeed. A boolean value is either true of false, use Optional here to have an instance does not contain a value, such that SDK will decide the default behavior as stated before, if no value specified.

Deprecated in API v. 1.10. Please set in service-specific client configuration.

Definition at line 390 of file ClientConfiguration.h.

◆ enableHostPrefixInjection

bool Aws::Client::ClientConfiguration::enableHostPrefixInjection = true

Enable host prefix injection. For services whose endpoint is injectable. e.g. servicediscovery, you can modify the http host's prefix so as to add "data-" prefix for DiscoverInstances request. Default to true, enabled. You can disable it for testing purpose.

Deprecated in API v. 1.10. Please set in service-specific client configuration.

Definition at line 377 of file ClientConfiguration.h.

◆ enableHttpClientTrace

bool Aws::Client::ClientConfiguration::enableHttpClientTrace = false

Enable http client (WinHTTP or CURL) traces. Defaults to false, it's an optional feature.

Definition at line 396 of file ClientConfiguration.h.

◆ enableTcpKeepAlive

bool Aws::Client::ClientConfiguration::enableTcpKeepAlive = true

Enable TCP keep-alive. Default true; No-op for WinHTTP, WinINet and IXMLHTTPRequest2 client.

Definition at line 219 of file ClientConfiguration.h.

◆ endpointOverride

Aws::String Aws::Client::ClientConfiguration::endpointOverride

Override the http endpoint used to talk to a service.

Definition at line 239 of file ClientConfiguration.h.

◆ executor

std::shared_ptr<Aws::Utils::Threading::Executor> Aws::Client::ClientConfiguration::executor = nullptr

Threading Executor implementation. Default uses std::thread::detach() Provide executor here or via a factory method.

Definition at line 298 of file ClientConfiguration.h.

◆ followRedirects

FollowRedirectsPolicy Aws::Client::ClientConfiguration::followRedirects

Sets the behavior how http stack handles 30x redirect codes.

Definition at line 352 of file ClientConfiguration.h.

◆ httpClientChunkedMode

HttpClientChunkedMode Aws::Client::ClientConfiguration::httpClientChunkedMode = HttpClientChunkedMode::CLIENT_IMPLEMENTATION

Control HTTP client chunking implementation mode. Default is set automatically: CLIENT_IMPLEMENTATION for custom clients, DEFAULT for AWS clients.

Definition at line 511 of file ClientConfiguration.h.

◆ httpLibOverride

Aws::Http::TransferLibType Aws::Client::ClientConfiguration::httpLibOverride

Override the http implementation the default factory returns.

Definition at line 343 of file ClientConfiguration.h.

◆ httpLibPerfMode

Aws::Http::TransferLibPerformanceMode Aws::Client::ClientConfiguration::httpLibPerfMode = Http::TransferLibPerformanceMode::LOW_LATENCY

Configure low latency or low cpu consumption http client operation mode. Currently applies only to streaming APIs and libCurl. Defaults to LOW_LATENCY

Definition at line 348 of file ClientConfiguration.h.

◆ httpRequestTimeoutMs

long Aws::Client::ClientConfiguration::httpRequestTimeoutMs = 0

This is currently only applicable for Curl to set the http request level timeout, including possible dns lookup time, connection establish time, ssl handshake time and actual data transmission time. the corresponding Curl option is CURLOPT_TIMEOUT_MS defaults to 0, no http request level timeout.

Definition at line 202 of file ClientConfiguration.h.

◆ lowSpeedLimit

unsigned long Aws::Client::ClientConfiguration::lowSpeedLimit = 1

Average transfer speed in bytes per second that the transfer should be below during the request timeout interval for it to be considered too slow and abort. Default 1 byte/second. Only for CURL client currently.

Definition at line 230 of file ClientConfiguration.h.

◆ maxConnections

unsigned Aws::Client::ClientConfiguration::maxConnections = 25

Max concurrent tcp connections for a single http client to use. Default 25.

Definition at line 196 of file ClientConfiguration.h.

◆ nonProxyHosts

Aws::Utils::Array<Aws::String> Aws::Client::ClientConfiguration::nonProxyHosts

Calls to hosts in this vector will not use proxy configuration

Definition at line 293 of file ClientConfiguration.h.

◆ profileName

Aws::String Aws::Client::ClientConfiguration::profileName

profileName in config file that will be used by this object to resolve more configurations.

Definition at line 401 of file ClientConfiguration.h.

◆ proxyCaFile

Aws::String Aws::Client::ClientConfiguration::proxyCaFile

Same as caFile, but used when verifying an HTTPS proxy. Used to set CURLOPT_PROXY_CAINFO in libcurl and proxy tls settings in crt HTTP client. Does nothing on windows.

Definition at line 329 of file ClientConfiguration.h.

◆ proxyCaPath

Aws::String Aws::Client::ClientConfiguration::proxyCaPath

Same as caPath, but used when verifying an HTTPS proxy. Used to set CURLOPT_PROXY_CAPATH in libcurl and proxy tls settings in crt HTTP client. Does nothing on windows.

Definition at line 316 of file ClientConfiguration.h.

◆ proxyHost

Aws::String Aws::Client::ClientConfiguration::proxyHost

If you have users going through a proxy, set the host here.

Definition at line 252 of file ClientConfiguration.h.

◆ proxyPassword

Aws::String Aws::Client::ClientConfiguration::proxyPassword

If you have users going through a proxy, set the password here.

Definition at line 264 of file ClientConfiguration.h.

◆ proxyPort

unsigned Aws::Client::ClientConfiguration::proxyPort = 0

If you have users going through a proxy, set the port here.

Definition at line 256 of file ClientConfiguration.h.

◆ proxyScheme

Aws::Http::Scheme Aws::Client::ClientConfiguration::proxyScheme

If you have users going through a proxy, set the proxy scheme here. Default HTTP

Definition at line 248 of file ClientConfiguration.h.

◆ proxySSLCertPath

Aws::String Aws::Client::ClientConfiguration::proxySSLCertPath

SSL Certificate file to use for connecting to an HTTPS proxy. Used to set CURLOPT_PROXY_SSLCERT in libcurl. Example: client.pem

Definition at line 269 of file ClientConfiguration.h.

◆ proxySSLCertType

Aws::String Aws::Client::ClientConfiguration::proxySSLCertType

Type of proxy client SSL certificate. Used to set CURLOPT_PROXY_SSLCERTTYPE in libcurl. Example: PEM

Definition at line 274 of file ClientConfiguration.h.

◆ proxySSLKeyPassword

Aws::String Aws::Client::ClientConfiguration::proxySSLKeyPassword

Passphrase to the private key file used to connect to an HTTPS proxy. Used to set CURLOPT_PROXY_KEYPASSWD in libcurl. Example: password1

Definition at line 289 of file ClientConfiguration.h.

◆ proxySSLKeyPath

Aws::String Aws::Client::ClientConfiguration::proxySSLKeyPath

Private key file to use for connecting to an HTTPS proxy. Used to set CURLOPT_PROXY_SSLKEY in libcurl. Example: key.pem

Definition at line 279 of file ClientConfiguration.h.

◆ proxySSLKeyType

Aws::String Aws::Client::ClientConfiguration::proxySSLKeyType

Type of private key file used to connect to an HTTPS proxy. Used to set CURLOPT_PROXY_SSLKEYTYPE in libcurl. Example: PEM

Definition at line 284 of file ClientConfiguration.h.

◆ proxyUserName

Aws::String Aws::Client::ClientConfiguration::proxyUserName

If you have users going through a proxy, set the username here.

Definition at line 260 of file ClientConfiguration.h.

◆ readRateLimiter

std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> Aws::Client::ClientConfiguration::readRateLimiter = nullptr

Rate Limiter implementation for incoming bandwidth. Default is wide-open. Provide limiter here or via a factory method.

Definition at line 339 of file ClientConfiguration.h.

◆ region

Aws::String Aws::Client::ClientConfiguration::region

AWS Region to use in signing requests. Default US_EAST_1

Definition at line 182 of file ClientConfiguration.h.

◆ requestChecksumCalculation

RequestChecksumCalculation Aws::Client::ClientConfiguration::requestChecksumCalculation = RequestChecksumCalculation::WHEN_SUPPORTED

Setting on whether to calculate a checksum for a payload only when it is required. i.e. when setting WHEN_REQUIRED the SDK will NOT calculate a checksum for an endpoint where it is supported but is NOT required.

Definition at line 446 of file ClientConfiguration.h.

◆ requestCompressionConfig

Aws::Client::RequestCompressionConfig Aws::Client::ClientConfiguration::requestCompressionConfig

Request compression configuration To use this feature, the service needs to provide the support, and the compression algorithms needs to be available at SDK build time.

Definition at line 408 of file ClientConfiguration.h.

◆ requestTimeoutMs

long Aws::Client::ClientConfiguration::requestTimeoutMs = 0

Socket read timeouts for HTTP clients on Windows. Default 3000 ms. This should be more than adequate for most services. However, if you are transferring large amounts of data or are worried about higher latencies, you should set to something that makes more sense for your use case. For Curl, it's the low speed time, which contains the time in number milliseconds that transfer speed should be below "lowSpeedLimit" for the library to consider it too slow and abort. Note that for Curl this config is converted to seconds by rounding down to the nearest whole second except when the value is greater than 0 and less than 1000. In this case it is set to one second. When it's 0, low speed limit check will be disabled. Note that for Windows when this config is 0, the behavior is not specified by Windows.

Definition at line 210 of file ClientConfiguration.h.

◆ responseChecksumValidation

ResponseChecksumValidation Aws::Client::ClientConfiguration::responseChecksumValidation = ResponseChecksumValidation::WHEN_SUPPORTED

Setting on whether to client side response validate a content body that had a checksum associated with it. Response validation right now cannot be modeled as required but rely on an associated model configuration.

Definition at line 453 of file ClientConfiguration.h.

◆ retryStrategy

std::shared_ptr<RetryStrategy> Aws::Client::ClientConfiguration::retryStrategy = nullptr

Strategy to use in case of failed requests. Default is DefaultRetryStrategy (i.e. exponential backoff). Provide retry strategy here or via a factory method.

Definition at line 235 of file ClientConfiguration.h.

◆ scheme

Aws::Http::Scheme Aws::Client::ClientConfiguration::scheme

Http scheme to use. E.g. Http or Https. Default HTTPS

Definition at line 178 of file ClientConfiguration.h.

◆ tcpKeepAliveIntervalMs

unsigned long Aws::Client::ClientConfiguration::tcpKeepAliveIntervalMs = 30000

Interval to send a keep-alive packet over the connection. Default 30 seconds. Minimum 15 seconds. WinHTTP & libcurl support this option. Note that for Curl, this value will be rounded to an integer with second granularity. No-op for WinINet and IXMLHTTPRequest2 client.

Definition at line 225 of file ClientConfiguration.h.

◆ telemetryProvider

std::shared_ptr<smithy::components::tracing::TelemetryProvider> Aws::Client::ClientConfiguration::telemetryProvider

A wrapper for interfacing with telemetry functionality. Defaults to Noop provider. Provide TelemetryProvider here or via a factory method.

Definition at line 477 of file ClientConfiguration.h.

◆ useDualStack

bool Aws::Client::ClientConfiguration::useDualStack = false

Use dual stack endpoint in the endpoint calculation. It is your responsibility to verify that the service supports ipv6 in the region you select.

Definition at line 186 of file ClientConfiguration.h.

◆ useFIPS

bool Aws::Client::ClientConfiguration::useFIPS = false

Use FIPS endpoint in the endpoint calculation. Please check first that the service supports FIPS in a selected region.

Definition at line 191 of file ClientConfiguration.h.

◆ userAgent

Aws::String Aws::Client::ClientConfiguration::userAgent

User Agent string user for http calls. This is filled in for you in the constructor. Don't override this unless you have a really good reason.

Definition at line 174 of file ClientConfiguration.h.

◆ verifySSL

bool Aws::Client::ClientConfiguration::verifySSL = true

If you need to test and want to get around TLS validation errors, do that here. You probably shouldn't use this flag in a production scenario.

Definition at line 303 of file ClientConfiguration.h.

◆ version

Aws::Http::Version Aws::Client::ClientConfiguration::version = Http::Version::HTTP_VERSION_2TLS

Request HTTP client to use specific http version. Currently supported for only Curl. More or less is a one to one conversion of the CURLOPT_HTTP_VERSION configuration option.

Default to Version 2 TLS which is the default after curl version 7.62.0. Will fall back to 1.1 if compiled against a earlier version of curl.

Definition at line 423 of file ClientConfiguration.h.

◆ winHTTPOptions

struct Aws::Client::ClientConfiguration::WinHTTPOptions Aws::Client::ClientConfiguration::winHTTPOptions

◆ writeRateLimiter

std::shared_ptr<Aws::Utils::RateLimits::RateLimiterInterface> Aws::Client::ClientConfiguration::writeRateLimiter = nullptr

Rate Limiter implementation for outgoing bandwidth. Default is wide-open. Provide limiter here or via a factory method.

Definition at line 334 of file ClientConfiguration.h.


The documentation for this struct was generated from the following file: