pub struct DefaultCredentialsChain(_);
Expand description

Default AWS Credential Provider Chain

Resolution order:

  1. Environment variables: EnvironmentVariableCredentialsProvider
  2. Shared config (~/.aws/config, ~/.aws/credentials): SharedConfigCredentialsProvider
  3. Web Identity Tokens
  4. ECS (IAM Roles for Tasks) & General HTTP credentials: ecs
  5. EC2 IMDSv2

The outer provider is wrapped in a refreshing cache.

More providers are a work in progress.

Examples

Create a default chain with a custom region:

use aws_types::region::Region;
use aws_config::default_provider::credentials::DefaultCredentialsChain;
let credentials_provider = DefaultCredentialsChain::builder()
    .region(Region::new("us-west-1"))
    .build();

Create a default chain with no overrides:

use aws_config::default_provider::credentials::DefaultCredentialsChain;
let credentials_provider = DefaultCredentialsChain::builder().build();

Create a default chain that uses a different profile:

use aws_config::default_provider::credentials::DefaultCredentialsChain;
let credentials_provider = DefaultCredentialsChain::builder()
    .profile_name("otherprofile")
    .build();

Implementations§

Builder for DefaultCredentialsChain

Trait Implementations§

Formats the value using the given formatter. Read more
Returns a future that provides credentials.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more