Config Reference

botocore.config

class botocore.config.Config(*args, **kwargs)

Advanced configuration for Botocore clients.

Parameters
  • region_name (str) -- The region to use in instantiating the client
  • signature_version (str) -- The signature version when signing requests.
  • user_agent (str) -- The value to use in the User-Agent header.
  • user_agent_extra (str) -- The value to append to the current User-Agent header value.
  • connect_timeout (int) -- The time in seconds till a timeout exception is thrown when attempting to make a connection. The default is 60 seconds.
  • read_timeout (int) -- The time in seconds till a timeout exception is thrown when attempting to read from a connection. The default is 60 seconds.
  • parameter_validation (bool) -- Whether parameter validation should occur when serializing requests. The default is True. You can disable parameter validation for performance reasons. Otherwise, it's recommended to leave parameter validation enabled.
  • max_pool_connections (int) -- The maximum number of connections to keep in a connection pool. If this value is not set, the default value of 10 is used.
  • proxies (dict) -- A dictionary of proxy servers to use by protocol or endpoint, e.g.: {'http': 'foo.bar:3128', 'http://hostname': 'foo.bar:4012'}. The proxies are used on each request.
  • s3 (dict) --

    A dictionary of s3 specific configurations. Valid keys are:

    • 'use_accelerate_endpoint' -- Refers to whether to use the S3 Accelerate endpoint. The value must be a boolean. If True, the client will use the S3 Accelerate endpoint. If the S3 Accelerate endpoint is being used then the addressing style will always be virtual.
    • 'payload_signing_enabled' -- Refers to whether or not to SHA256 sign sigv4 payloads. By default, this is disabled for streaming uploads (UploadPart and PutObject).
    • 'addressing_style' -- Refers to the style in which to address s3 endpoints. Values must be a string that equals:
      • auto -- Addressing style is chosen for user. Depending on the configuration of client, the endpoint may be addressed in the virtual or the path style. Note that this is the default behavior if no style is specified.
      • virtual -- Addressing style is always virtual. The name of the bucket must be DNS compatible or an exception will be thrown. Endpoints will be addressed as such: mybucket.s3.amazonaws.com
      • path -- Addressing style is always by path. Endpoints will be addressed as such: s3.amazonaws.com/mybucket
  • retries (dict) --

    A dictionary for retry specific configurations. Valid keys are:

    • 'max_attempts' -- An integer representing the maximum number of retry attempts that will be made on a single request. For example, setting this value to 2 will result in the request being retried at most two times after the initial request. Setting this value to 0 will result in no retries ever being attempted on the initial request. If not provided, the number of retries will default to whatever is modeled, which is typically four retries.
merge(other_config)

Merges the config object with another config object

This will merge in all non-default values from the provided config and return a new config object

Parameters
config (other) -- Another config object to merge with. The values in the provided config object will take precedence in the merging
Returns
A config object built from the merged values of both config objects.