ClientConfig
This class is the base class of all the configurations settings to connect
to a service.
This flag controls if .NET HTTP infrastructure should follow redirection
responses (e.g. HTTP 307 - temporary redirect).
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.
Gets and sets the AuthenticationServiceName property.
Used in AWS4 request signing, this is the short-form
name of the service being called.
Gets and Sets the BufferSize property.
The BufferSize controls the buffer used to read in from input streams and write
out to the request.
This is a switch used for performance testing and is not intended for production applications
to change. This switch may be removed in a future version of the SDK as the .NET Core platform matures.
If true, the HttpClient is cached and reused for every request made by the service client
and shared with other service clients.
For the .NET Core platform this is default to true because the HttpClient manages the connection
pool.
ClientAppId 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/{ClientAppId}.
If the ClientAppId is not set on the object the SDK will search the environment variable AWS_SDK_UA_APP_ID and the shared config profile attribute sdk_ua_app_id for a potential value for the ClientAppId.
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.
Returns the current UTC now after clock correction for this endpoint.
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.
Gets and sets the DisableLogging. If true logging for this client will be disabled.
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.
Returns the maximum number of discovered endpoints that can be stored within the cache for the client. The default limit is 1000 cache entries.
Returns the flag indicating if endpoint discovery should be enabled or disabled for operations that are not required to use endpoint discovery.
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.
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.
If CacheHttpClient is set to true then HttpClientCacheSize controls the number of HttpClients cached.
The default value is 1 which is suitable for Windows and for all other platforms that have HttpClient
implementations using System.Net.Http.SocketsHttpHandler (.NET Core 2.1 and higher).
HttpClientFactory used to create new HttpClients.
If null, an HttpClient will be created by the SDK.
Note that IClientConfig members such as ProxyHost, ProxyPort, GetWebProxy, and AllowAutoRedirect
will have no effect unless they're used explicitly by the HttpClientFactory implementation.
See https://docs.microsoft.com/en-us/xamarin/cross-platform/macios/http-stack?context=xamarin/ios and
https://learn.microsoft.com/en-us/xamarin/android/app-fundamentals/http-stack?context=xamarin%2Fcross-platform
for guidance on creating HttpClients for your platform.
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.
Determines if MaxErrorRetry has been manually set.
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>
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.
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
RetryMode.
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.
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.
Credentials to use with a proxy.
Gets and sets of the ProxyHost property.
Gets and sets of the ProxyPort property.
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.
Overrides the default read-write timeout value.
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.
The constant used to lookup in the region hash the endpoint.
Minimum size in bytes that a request body should be to trigger compression.
Flag on whether to resign requests on retry or not.
For Amazon S3 and Amazon Glacier this value will always be set to true.
Returns the flag indicating the current mode in use for request
retries and influences the value returned from
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.
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
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.
Gets Service Version
Gets and sets of the signatureMethod property.
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.
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.
.NET Framework 3.5
------------------
Overrides the default request timeout value.
This field does not impact Begin*/End* calls. A manual timeout must be implemented.
.NET Framework 4.5
------------------
Overrides the default request timeout value.
This field does not impact *Async calls. A manual timeout (for instance, using CancellationToken) must be implemented.
public bool { get; set; }
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.
Configures the endpoint calculation for a service to go to a dual stack (ipv6 enabled) endpoint
for the configured region.
Configures the endpoint calculation to go to a FIPS (https://aws.amazon.com/compliance/fips/) endpoint
for the configured region.
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.
Gets and sets of the UserAgent property.
Returns the request timeout value if its value is set,
else returns client timeout value.
Throw an exception if the boxed TimeSpan parameter doesn't have a value or is out of range.
Given this client configuration, return a DNS suffix for service endpoint url.
Given this client configuration, return a string form ofthe service endpoint url.
Returns a WebProxy instance configured to match the proxy settings
in the client configuration.
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
Unpacks the host, port and any credentials info into the instance's
proxy-related fields.
Unlike the SetWebProxy implementation on .NET 3.5/4.5,the Host and the Port are not reconstructed from the
input proxyuri
Performs validation on this config object.
Throws exception if any of the required values are missing/invalid.