AWS SDK Version 3 for .NET
API Reference

AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.

This class is the base class of all the configurations settings to connect to a service.

Inheritance Hierarchy

System.Object
  Amazon.Runtime.ClientConfig

Namespace: Amazon.Runtime
Assembly: AWSSDK.Core.dll
Version: 3.x.y.z

Syntax

C#
public abstract class ClientConfig
         IClientConfig

The ClientConfig type exposes the following members

Constructors

NameDescription
Public Method ClientConfig()

Properties

NameTypeDescription
Public Property AllowAutoRedirect System.Boolean

This flag controls if .NET HTTP infrastructure should follow redirection responses (e.g. HTTP 307 - temporary redirect).

Public Property AuthenticationRegion System.String

Gets and sets the AuthenticationRegion property. Used in AWS4 request signing, this is an optional property; change it only if the region cannot be determined from the service endpoint.

Public Property AuthenticationServiceName System.String

Gets and sets the AuthenticationServiceName property. Used in AWS4 request signing, this is the short-form name of the service being called.

Public Property AWSTokenProvider Amazon.Runtime.IAWSTokenProvider
Public Property BufferSize System.Int32

Gets and Sets the BufferSize property. The BufferSize controls the buffer used to read in from input streams and write out to the request.

Public Property ClientAppId System.String

Customers can opt-in to provide an app id that is intended to identify their applications in the user agent header string. The value must not exceed Amazon.Runtime.Internal.EnvironmentVariableInternalConfiguration.AWS_SDK_UA_APP_ID_MAX_LENGTH characters.

Public Property ClockOffset System.TimeSpan

The calculated clock skew correction for a specific endpoint, if there is one. This field will be set if a service call resulted in an exception and the SDK has determined that there is a difference between local and server times. If CorrectForClockSkew is set to true, this value will still be set to the correction, but it will not be used by the SDK and clock skew errors will not be retried.

Public Property ConnectionLimit System.Int32

Gets and sets the connection limit set on the ServicePoint for the WebRequest. Default value is 50 connections unless ServicePointManager.DefaultConnectionLimit is set in which case ServicePointManager.DefaultConnectionLimit will be used as the default.

Public Property CorrectedUtcNow System.DateTime

Returns the current UTC now after clock correction for this endpoint.

Public Property DefaultConfigurationMode Amazon.Runtime.DefaultConfigurationMode

Specify a Amazon.Runtime.DefaultConfigurationMode to use.

Returns the Amazon.Runtime.DefaultConfigurationMode that will be used. If none is specified, than the correct one is computed by Amazon.Runtime.Internal.IDefaultConfigurationProvider.

Public Property DisableHostPrefixInjection System.Boolean

Gets and sets the DisableHostPrefixInjection flag. If true, host prefix injection will be disabled for this client, the default value of this flag is false. Host prefix injection prefixes the service endpoint with request members from APIs which use this feature. Example: for a hostPrefix of "foo-name." and a endpoint of "service.region.amazonaws.com" the default behavior is to prefix the endpoint with the hostPrefix resulting in a final endpoint of "foo-name.service.region.amazonaws.com". Setting DisableHostPrefixInjection to true will disable hostPrefix injection resulting in a final endpoint of "service.region.amazonaws.com" regardless of the value of hostPrefix. E.g. You may want to disable host prefix injection for testing against a local mock endpoint.

Public Property DisableLogging System.Boolean

Gets and sets the DisableLogging. If true logging for this client will be disabled.

Public Property DisableRequestCompression System.Boolean

Controls whether request payloads are automatically compressed for supported operations. This setting only applies to operations that support compression. The default value is "false". Set to "true" to disable compression.

Public Property EndpointDiscoveryCacheLimit System.Int32

Returns the maximum number of discovered endpoints that can be stored within the cache for the client. The default limit is 1000 cache entries.

Public Property EndpointDiscoveryEnabled System.Boolean

Returns the flag indicating if endpoint discovery should be enabled or disabled for operations that are not required to use endpoint discovery.

Public Property EndpointProvider Amazon.Runtime.Endpoints.IEndpointProvider

Gets and sets of the EndpointProvider property. This property is used for endpoints resolution. During service client creation it is set to service's default generated EndpointProvider, but can be changed to use custom user supplied EndpointProvider.

Public Property FastFailRequests System.Boolean

Under Adaptive retry mode, this flag determines if the client should wait for a send token to become available or don't block and fail the request immediately if a send token is not available.

Public Property IgnoreConfiguredEndpointUrls System.Boolean

If set to true the SDK will ignore the configured endpointUrls in the config file or in the environment variables. By default it is set to false.

Public Property IsMaxErrorRetrySet System.Boolean

Determines if MaxErrorRetry has been manually set.

Public Property LogMetrics System.Boolean

Flag on whether to log metrics for service calls. This can be set in the application's configs, as below:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <appSettings>
        <add key="AWSLogMetrics" value"true"/>
    </appSettings>
</configuration>
            

Public Property LogResponse System.Boolean

Gets and sets the LogResponse property. If this property is set to true, the service response is logged. The size of response being logged is controlled by the AWSConfigs.LoggingConfig.LogResponsesSizeLimit property.

Public Property MaxErrorRetry System.Int32

Returns the flag indicating how many retry HTTP requests an SDK should make for a single SDK operation invocation before giving up. This flag will return 4 when the RetryMode is set to "Legacy" which is the default. For RetryMode values of "Standard" or "Adaptive" this flag will return 2. In addition to the values returned that are dependent on the RetryMode, the value can be set to a specific value by using the AWS_MAX_ATTEMPTS environment variable, max_attempts in the shared configuration file, or by setting a value directly on this property. When using AWS_MAX_ATTEMPTS or max_attempts the value returned from this property will be one less than the value entered because this flag is the number of retry requests, not total requests. To learn more about the RetryMode property that affects the values returned by this flag, see Amazon.Runtime.ClientConfig.RetryMode.

Public Property MaxIdleTime System.Int32

Gets and sets the max idle time set on the ServicePoint for the WebRequest. Default value is 50 seconds (50,000 ms) unless ServicePointManager.MaxServicePointIdleTime is set, in which case ServicePointManager.MaxServicePointIdleTime will be used as the default.

Public Property Profile Amazon.Profile

Specifies the profile to be used. When this is set on the ClientConfig and that config is passed to the service client constructor the sdk will try to find the credentials associated with the Profile.Name property If set, this will override AWS_PROFILE and AWSConfigs.ProfileName.

Public Property ProgressUpdateInterval System.Int64

Gets or sets the interval at which progress update events are raised for upload operations. By default, the progress update events are raised at every 100KB of data transferred.

If the value of this property is set less than ClientConfig.BufferSize, progress updates events will be raised at the interval specified by ClientConfig.BufferSize.

Public Property ProxyBypassList System.Collections.Generic.List<System.String>

Gets and sets the ProxyBypassList property; a collection of regular expressions denoting the set of endpoints for which the configured proxy host will be bypassed.

Public Property ProxyBypassOnLocal System.Boolean

Gets and sets the ProxyBypassOnLocal property. If set true requests to local addresses bypass the configured proxy.

Public Property ProxyCredentials System.Net.ICredentials

Credentials to use with a proxy.

Public Property ProxyHost System.String

Gets and sets of the ProxyHost property.

Public Property ProxyPort System.Int32

Gets and sets the ProxyPort property.

Public Property ReadEntireResponse System.Boolean

Gets and sets the ReadEntireResponse property. NOTE: This property does not effect response processing and is deprecated. To enable response logging, the ClientConfig.LogResponse and AWSConfigs.LoggingConfig properties can be used.

Public Property ReadWriteTimeout System.Nullable<System.TimeSpan>

Overrides the default read-write timeout value.

Public Property RegionEndpoint Amazon.RegionEndpoint

Gets and sets the RegionEndpoint property. The region constant that determines the endpoint to use. Setting this property to null will force the SDK to recalculate the RegionEndpoint value based on App/WebConfig, environment variables, profile, etc.

RegionEndpoint and ServiceURL are mutually exclusive properties. Whichever property is set last will cause the other to automatically be reset to null.

Public Property RegionEndpointServiceName System.String

The constant used to lookup in the region hash the endpoint.

Public Property RequestMinCompressionSizeBytes System.Int64

Minimum size in bytes that a request body should be to trigger compression.

Public Property ResignRetries System.Boolean

Flag on whether to resign requests on retry or not. For Amazon S3 and Amazon Glacier this value will always be set to true.

Public Property RetryMode Amazon.Runtime.RequestRetryMode

Returns the flag indicating the current mode in use for request retries and influences the value returned from Amazon.Runtime.ClientConfig.MaxErrorRetry. The default value is RequestRetryMode.Legacy. This flag can be configured by using the AWS_RETRY_MODE environment variable, retry_mode in the shared configuration file, or by setting this value directly.

Public Property ServiceId System.String

The serviceId for the service, which is specified in the metadata in the ServiceModel. The transformed value of the service ID (replace any spaces in the service ID with underscores and uppercase all letters) is used to set service-specific endpoint urls. I.e: AWS_ENDPOINT_URL_ELASTIC_BEANSTALK For configuration files, replace any spaces with underscores and lowercase all letters I.e. elastic_beanstalk = endpoint_url = http://localhost:8000

Public Property ServiceURL System.String

Gets and sets of the ServiceURL property. This is an optional property; change it only if you want to try a different service endpoint.

RegionEndpoint and ServiceURL are mutually exclusive properties. Whichever property is set last will cause the other to automatically be reset to null.

Public Property ServiceVersion System.String

Gets Service Version

Public Property SignatureMethod Amazon.Runtime.SigningAlgorithm

Gets and sets of the signatureMethod property.

Public Property SignatureVersion System.String

Gets and sets of the SignatureVersion property. Note: This property exists for backward compatibility but is no longer used by any service other than S3.

Public Property TcpKeepAlive Amazon.Runtime.TcpKeepAlive

Specifies the TCP keep-alive values to use for service requests.

Public Property ThrottleRetries System.Boolean

Enable or disable the Retry Throttling feature by setting the ThrottleRetries flag to True/False respectively. Retry Throttling is a feature that intelligently throttles retry attempts when a large percentage of requests are failing and retries are unsuccessful as well. In such situations the allotted retry capacity for the service URL will be drained until requests start to succeed again. Once the requisite capacity is available, retries would be permitted again. When retries are throttled, the service enters a fail-fast behaviour as the traditional retry attempt for the request would be circumvented. Hence, errors will resurface quickly. This will result in a greater number of exceptions but prevents requests being tied up in unsuccessful retry attempts. Note: Retry Throttling is enabled by default. Set the ThrottleRetries flag to false to switch off this feature.

Public Property Timeout System.Nullable<System.TimeSpan>
Public Property UseAlternateUserAgentHeader System.Boolean

When set to true, the service client will use the x-amz-user-agent header instead of the User-Agent header to report version and environment information to the AWS service. Note: This is especially useful when using a platform like WebAssembly which doesn't allow to specify the User-Agent header.

Public Property UseDualstackEndpoint System.Boolean

Configures the endpoint calculation for a service to go to a dual stack (ipv6 enabled) endpoint for the configured region.

Public Property UseFIPSEndpoint System.Boolean

Configures the endpoint calculation to go to a FIPS (https://aws.amazon.com/compliance/fips/) endpoint for the configured region.

Public Property UseHttp System.Boolean

Gets and sets the UseHttp. If this property is set to true, the client attempts to use HTTP protocol, if the target endpoint supports it. By default, this property is set to false.

Public Property UseNagleAlgorithm System.Boolean

Gets or sets a Boolean value that determines whether the Nagle algorithm is used on connections managed by the ServicePoint object used for requests to AWS. This is defaulted to false for lower latency with responses that return small amount of data. This is the opposite default than ServicePoint.UseNagleAlgorithm which is optimized for large responses like web pages or images.

Public Property UserAgent System.String

Gets and sets of the UserAgent property.

Methods

Note:

Asynchronous operations (methods ending with Async) in the table below are for .NET 4.5 or higher. For .NET 3.5 the SDK follows the standard naming convention of BeginMethodName and EndMethodName to indicate asynchronous operations - these method pairs are not shown in the table below.

NameDescription
Public Method DetermineDnsSuffix()

Given this client configuration, return a DNS suffix for service endpoint url.

Public Method DetermineServiceURL()

Given this client configuration, return a string form ofthe service endpoint url.

Public Method GetHttpProxy()
Public Method GetHttpsProxy()
Public Method Static Method GetTimeoutValue(Nullable<TimeSpan>, Nullable<TimeSpan>)

Returns the request timeout value if its value is set, else returns client timeout value.

Public Method GetWebProxy()

Returns a WebProxy instance configured to match the proxy settings in the client configuration.

Public Method SetUseNagleIfAvailable(bool)

Enable or disable the Nagle algorithm on the underlying http client. This method is not intended to be called by consumers of the AWS SDK for .NET

Public Method SetWebProxy(WebProxy)

Unpacks the host, port and any credentials info into the instance's proxy-related fields.

Public Method Validate()

Performs validation on this config object. Throws exception if any of the required values are missing/invalid.

Public Method Static Method ValidateTimeout(Nullable<TimeSpan>)

Throw an exception if the boxed TimeSpan parameter doesn't have a value or is out of range.

Fields

NameTypeDescription
Field Static Field MaxTimeout System.TimeSpan

Version Information

.NET Core App:
Supported in: 3.1

.NET Standard:
Supported in: 2.0

.NET Framework:
Supported in: 4.5, 4.0, 3.5