Skip to main content

Shared Configuration

Configuration values will be loaded automatically from the AWS shared configuration file. The shared configuration file is an INI file made up of a default section and profile sections for each configured profile. An example configuration with defaults and a configured profile:

[default]
region=eu-west-2

[profile usa]
region=us-east-1

NOTE: The presence of the profile keyword in the [profile usa] profile section name. This differs from the shared credentials file that expects an associated section to be named [usa].

File Location

Shared configuration files are normally located at ~/.aws/config but that can be overridden with the use of the environment variable AWS_CONFIG_FILE.

Service-specific endpoints

Service-specific endpoints can be specified in configuration. Here is an example of specifying custom endpoints for all services:

[default]
endpoint_url=https://my-default.example.com

[profile my-other-endpoint]
endpoint_url=https://my-other.example.com

As you can see, the endpoint_url specified directly in either the default section or a profile section sets the endpoint URL for any service calls made under that configuration. To specify service-specific endpoints you can provide endpoint_url values nested under the service configuration identifier:

[default]
s3=
endpoint_url=https://my-default-s3.example.com

[profile my-custom-sqs]
sqs=
endpoint_url=https://my-sqs.example.com

If endpoints need to be shared across profiles, they can be placed into a services section:

[profile a]
services=my-services

[profile b]
services=my-services

[services my-services]
s3=
endpoint_url=https://my-default-s3.example.com
sqs=
endpoint_url=https://my-sqs.example.com

You cannot specify a plain endpoint_url in a services section, you must specify the value nested under the service identifier.

Service identifiers are documented in the official AWS reference.