Crate aws_config

source ·
Expand description

aws-config provides implementations of region and credential resolution.

These implementations can be used either via the default chain implementation from_env/ConfigLoader or ad-hoc individual credential and region providers.

ConfigLoader can combine different configuration sources into an AWS shared-config: SdkConfig. SdkConfig can be used configure an AWS service client.


Load default SDK configuration:

let config = aws_config::load_from_env().await;
let client = aws_sdk_dynamodb::Client::new(&config);

Load SDK configuration with a region override:

let region_provider = RegionProviderChain::default_provider().or_else("us-east-1");
let config = aws_config::from_env().region(region_provider).load().await;
let client = aws_sdk_dynamodb::Client::new(&config);

Override configuration after construction of SdkConfig:

let sdk_config = aws_config::load_from_env().await;
let custom_credentials_provider = custom_provider(&sdk_config);
let dynamo_config = aws_sdk_dynamodb::config::Builder::from(&sdk_config)
let client = aws_sdk_dynamodb::Client::from_conf(dynamo_config);


Functionality related to creating new HTTP Connectors
Credentials Provider for external process
Providers that implement the default AWS provider chain
Ecs Credentials Provider
Providers that load configuration from environment variables
IMDSv2 Client, credential, and region provider
Meta-providers that augment existing providers with new behavior
Load configuration from AWS Profiles
Configuration Options for Credential Providers
Retry configuration
SSO Credentials Provider
Credential provider augmentation through the AWS Security Token Service (STS).
Timeout configuration
Load Credentials from Web Identity Tokens


App name that can be configured with an AWS SDK client to become part of the user agent string.
Load default sources for all configuration with override support Load a cross-service SdkConfig from the environment
Error for when an app name doesn’t meet character requirements.
AWS Shared Configuration


Create an environment loader for AWS Configuration
Load a default configuration from the environment