aws-crt-cpp
C++ wrapper around the aws-c-* libraries. Provides Cross-Platform Transport Protocols and SSL/TLS implementations for C++.
Loading...
Searching...
No Matches
Classes | Public Member Functions | List of all members
Aws::Crt::S3::S3ClientConfig Class Referencefinal

#include <S3.h>

Classes

struct  Impl
 

Public Member Functions

 S3ClientConfig (const S3ClientConfig &)=delete
 
 S3ClientConfig (S3ClientConfig &&)=delete
 
S3ClientConfigoperator= (const S3ClientConfig &)=delete
 
S3ClientConfigoperator= (S3ClientConfig &&)=delete
 
 S3ClientConfig (const std::shared_ptr< Auth::ICredentialsProvider > &credentialsProvider) noexcept
 
 ~S3ClientConfig () noexcept
 
S3ClientConfigSetRegion (const Crt::String &region) noexcept
 
S3ClientConfigSetThroughputTargetGbps (double gbps) noexcept
 
S3ClientConfigSetPartSize (uint64_t bytes) noexcept
 
S3ClientConfigSetMultipartUploadThreshold (uint64_t bytes) noexcept
 
S3ClientConfigSetMemoryLimit (uint64_t bytes) noexcept
 
S3ClientConfigSetClientBootstrap (Io::ClientBootstrap &bootstrap) noexcept
 
S3ClientConfigSetConnectTimeoutMs (uint32_t timeoutMs) noexcept
 
S3ClientConfigSetReadBackpressure (bool enable, uint64_t initialReadWindow) noexcept
 
S3ClientConfigSetEnableS3Express (bool enable) noexcept
 
S3ClientConfigSetTlsMode (S3TlsMode mode) noexcept
 
S3ClientConfigSetTlsConnectionOptions (const Io::TlsConnectionOptions &options) noexcept
 
S3ClientConfigSetProxyOptions (const Http::HttpClientConnectionProxyOptions &proxyOptions) noexcept
 
S3ClientConfigSetTcpKeepAlive (uint16_t keepAliveIntervalSec, uint16_t keepAliveTimeoutSec) noexcept
 
S3ClientConfigSetConnectionMonitoring (uint64_t minimumThroughputBytesPerSecond, uint32_t allowableThroughputFailureIntervalSeconds) noexcept
 
S3ClientConfigSetNetworkInterfaceNames (const Vector< String > &networkInterfaceNames) noexcept
 
S3ClientConfigSetRetryStrategy (S3RetryStrategyType type, const S3RetryStrategyExponentialBackoffOptions &options={}) noexcept
 
S3ClientConfigSetRetryStrategyFactory (std::function< S3RetryStrategy(const S3ClientConfig &)> factory) noexcept
 
S3ClientConfigSetClientShutdownCallback (std::function< void()> callback) noexcept
 
S3RetryStrategyType GetRetryStrategyType () const noexcept
 
const S3RetryStrategyExponentialBackoffOptionsGetRetryStrategyOptions () const noexcept
 
const std::function< S3RetryStrategy(const S3ClientConfig &)> & GetRetryStrategyFactory () const noexcept
 
const Vector< String > & GetNetworkInterfaceNames () const noexcept
 
const std::function< void()> & GetClientShutdownCallback () const noexcept
 

Detailed Description

Configuration object used to construct an S3Client. The credentials provider is required at construction; every other setting is optional and set through the fluent Set* setters. The object owns backing storage for string-valued fields, the credentials provider reference, and the internally-built signing config, so it must outlive the S3Client construction call.

Constructor & Destructor Documentation

◆ S3ClientConfig() [1/3]

Aws::Crt::S3::S3ClientConfig::S3ClientConfig ( const S3ClientConfig )
delete

◆ S3ClientConfig() [2/3]

Aws::Crt::S3::S3ClientConfig::S3ClientConfig ( S3ClientConfig &&  )
delete

◆ S3ClientConfig() [3/3]

Aws::Crt::S3::S3ClientConfig::S3ClientConfig ( const std::shared_ptr< Auth::ICredentialsProvider > &  credentialsProvider)
explicitnoexcept

Construct a config. The credentials provider is required (no defensible default - the SDK can't guess credentials). The signing config is built internally via S3Client::MakeDefaultSigningConfig, which wraps aws_s3_init_default_signing_config and additionally clears use_double_uri_encode and should_normalize_uri_path (both required for S3 request signing; without either, keys with reserved characters or "//" fail with SignatureDoesNotMatch). Region defaults to "us-east-1"; override via SetRegion. S3 Express is enabled by default; override via SetEnableS3Express.

Parameters
credentialsProviderthe credentials provider used to source SigV4 credentials. The config retains a shared reference; the provider must remain valid at least until the S3Client is constructed (aws_s3_client_new deep-copies the signing config and acquires its own reference to the provider).

◆ ~S3ClientConfig()

Aws::Crt::S3::S3ClientConfig::~S3ClientConfig ( )
defaultnoexcept

Member Function Documentation

◆ GetClientShutdownCallback()

const std::function< void()> & Aws::Crt::S3::S3ClientConfig::GetClientShutdownCallback ( ) const
inlinenoexcept
Returns
the client-shutdown callback, or an empty function if none was installed via SetClientShutdownCallback.

◆ GetNetworkInterfaceNames()

const Vector< String > & Aws::Crt::S3::S3ClientConfig::GetNetworkInterfaceNames ( ) const
inlinenoexcept
Returns
the configured network interface names, or an empty vector if none were set.

◆ GetRetryStrategyFactory()

const std::function< S3RetryStrategy(const S3ClientConfig &)> & Aws::Crt::S3::S3ClientConfig::GetRetryStrategyFactory ( ) const
inlinenoexcept
Returns
the retry-strategy factory, or an empty function if none was installed via SetRetryStrategyFactory.

◆ GetRetryStrategyOptions()

const S3RetryStrategyExponentialBackoffOptions & Aws::Crt::S3::S3ClientConfig::GetRetryStrategyOptions ( ) const
inlinenoexcept
Returns
the exponential-backoff tuning knobs; only meaningful when the strategy type is ExponentialBackoff.

◆ GetRetryStrategyType()

S3RetryStrategyType Aws::Crt::S3::S3ClientConfig::GetRetryStrategyType ( ) const
inlinenoexcept
Returns
the configured retry-strategy flavor (Default if unset).

◆ operator=() [1/2]

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::operator= ( const S3ClientConfig )
delete

◆ operator=() [2/2]

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::operator= ( S3ClientConfig &&  )
delete

◆ SetClientBootstrap()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetClientBootstrap ( Io::ClientBootstrap bootstrap)
noexcept

Set the client bootstrap used for connection establishment. If not set, the process-global default bootstrap is used (see Aws::Crt::ApiHandle::GetOrCreateStaticDefaultClientBootstrap).

Parameters
bootstrapthe client bootstrap.
Returns
this object, to allow chaining.

◆ SetClientShutdownCallback()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetClientShutdownCallback ( std::function< void()>  callback)
noexcept

Install a callback invoked once the underlying CRT client has finished its asynchronous shutdown. aws_s3_client_release (called from ~S3Client) only starts teardown; the client's threads and connection pool may still be winding down after the destructor returns. This callback is the signal that teardown is complete and it is safe to release dependencies the client borrowed (event loop group, client bootstrap, credentials provider). It fires on a CRT thread, after the S3Client object may already be gone.

Parameters
callbackthe callback to invoke on shutdown completion.
Returns
this object, to allow chaining.

◆ SetConnectionMonitoring()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetConnectionMonitoring ( uint64_t  minimumThroughputBytesPerSecond,
uint32_t  allowableThroughputFailureIntervalSeconds 
)
noexcept

Enable connection health monitoring. A connection is shut down if its throughput falls below the minimum for longer than the allowable failure interval.

Parameters
minimumThroughputBytesPerSecondminimum acceptable throughput.
allowableThroughputFailureIntervalSecondsgrace interval in seconds.
Returns
this object, to allow chaining.

◆ SetConnectTimeoutMs()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetConnectTimeoutMs ( uint32_t  timeoutMs)
noexcept
Parameters
timeoutMsconnection timeout in milliseconds.
Returns
this object, to allow chaining.

◆ SetEnableS3Express()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetEnableS3Express ( bool  enable)
noexcept

Enable or disable S3 Express support. Enabled by default to match the AWS SDK S3 client. When enabled and no provider factory is set, the CRT creates a default S3 Express provider.

Parameters
enablewhether to enable S3 Express support.
Returns
this object, to allow chaining.

◆ SetMemoryLimit()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetMemoryLimit ( uint64_t  bytes)
noexcept

Set the upper bound on memory the CRT may buffer for in-flight parts across all meta requests created with this client.

Parameters
bytesmemory ceiling in bytes.
Returns
this object, to allow chaining.

◆ SetMultipartUploadThreshold()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetMultipartUploadThreshold ( uint64_t  bytes)
noexcept
Parameters
bytesthreshold in bytes above which an upload is split into a multipart upload.
Returns
this object, to allow chaining.

◆ SetNetworkInterfaceNames()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetNetworkInterfaceNames ( const Vector< String > &  networkInterfaceNames)
noexcept

Set the network interface names the client distributes its connections across, allowing it to saturate multiple NICs. If any interface name is invalid or its link goes down, you will see connection failures.

Experimental and only supported on Linux, macOS, and platforms with SO_BINDTODEVICE or IP_BOUND_IF; not supported on Windows (AWS_ERROR_PLATFORM_NOT_SUPPORTED is raised on unsupported platforms). The config owns a copy of the names.

Parameters
networkInterfaceNamesthe interface names, ex. "eth0".
Returns
this object, to allow chaining.

◆ SetPartSize()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetPartSize ( uint64_t  bytes)
noexcept

Set the target part size for multipart transfers (downloads and uploads). For uploads, the CRT may increase the effective part size if the target would require more than 10,000 parts (the S3 service limit), and will also raise it to the 5 MiB minimum upload part size.

Parameters
bytestarget part size in bytes.
Returns
this object, to allow chaining.

◆ SetProxyOptions()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetProxyOptions ( const Http::HttpClientConnectionProxyOptions proxyOptions)
noexcept

Set the HTTP proxy options used for connections. The config owns a copy of the options.

Parameters
proxyOptionsthe proxy options.
Returns
this object, to allow chaining.

◆ SetReadBackpressure()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetReadBackpressure ( bool  enable,
uint64_t  initialReadWindow 
)
noexcept

Enable read backpressure and set the initial read window, in bytes, for downloads. When backpressure is enabled the CRT pauses delivering body data once the window is exhausted until the application increments it. A window of 0 with backpressure enabled means no data is read until the window is incremented.

Parameters
enablewhether to enable read backpressure.
initialReadWindowinitial read window in bytes.
Returns
this object, to allow chaining.

◆ SetRegion()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetRegion ( const Crt::String region)
noexcept

Override the AWS region the client signs requests for. Defaults to "us-east-1" if not set.

Parameters
regionthe region string, ex. "us-east-1".
Returns
this object, to allow chaining.

◆ SetRetryStrategy()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetRetryStrategy ( S3RetryStrategyType  type,
const S3RetryStrategyExponentialBackoffOptions options = {} 
)
noexcept

Select a network-level retry strategy by flavor. This is the common path: the matching aws_retry_strategy is built when the S3Client is constructed (the point at which the event loop group is known). S3RetryStrategyType::Default leaves the choice to the CRT. Overrides any factory set via SetRetryStrategyFactory.

Parameters
typethe retry strategy flavor.
optionsbackoff knobs, used only for ExponentialBackoff.
Returns
this object, to allow chaining.

◆ SetRetryStrategyFactory()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetRetryStrategyFactory ( std::function< S3RetryStrategy(const S3ClientConfig &)>  factory)
noexcept

Install a factory for fine-grained control over the retry strategy. Invoked once, at S3Client construction, with this config; it returns the S3RetryStrategy binding the client should use. Use this when the flavors exposed by SetRetryStrategy are not sufficient. Overrides any flavor set via SetRetryStrategy.

Parameters
factorycallback that produces the retry strategy.
Returns
this object, to allow chaining.

◆ SetTcpKeepAlive()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetTcpKeepAlive ( uint16_t  keepAliveIntervalSec,
uint16_t  keepAliveTimeoutSec 
)
noexcept

Configure TCP keep-alive for connections. Both values are in seconds; a value of 0 leaves the corresponding setting at the operating-system default.

Parameters
keepAliveIntervalSecinterval between keep-alive probes.
keepAliveTimeoutSectimeout before a connection is considered dead.
Returns
this object, to allow chaining.

◆ SetThroughputTargetGbps()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetThroughputTargetGbps ( double  gbps)
noexcept

Set the target aggregate throughput the client will tune toward, in gigabits per second. This drives the CRT's pool sizing.

Parameters
gbpstarget throughput in Gbps.
Returns
this object, to allow chaining.

◆ SetTlsConnectionOptions()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetTlsConnectionOptions ( const Io::TlsConnectionOptions options)
noexcept

Set the TLS connection options used for connections. Pair with SetTlsMode(S3TlsMode::Enabled); the options are ignored when TLS mode is Disabled. The config owns a copy of the options.

Parameters
optionsthe TLS connection options.
Returns
this object, to allow chaining.

◆ SetTlsMode()

S3ClientConfig & Aws::Crt::S3::S3ClientConfig::SetTlsMode ( S3TlsMode  mode)
noexcept

Set whether the client establishes connections over TLS. The configured TLS connection options are only consulted when the mode is Enabled.

Parameters
modethe TLS mode.
Returns
this object, to allow chaining.

The documentation for this class was generated from the following files: