pub struct DefaultCredentialsChain { /* private fields */ }
Expand description
Default AWS Credential Provider Chain
Resolution order:
- Environment variables:
EnvironmentVariableCredentialsProvider
- Shared config (
~/.aws/config
,~/.aws/credentials
):SharedConfigCredentialsProvider
- Web Identity Tokens
- ECS (IAM Roles for Tasks) & General HTTP credentials:
ecs
- 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§
Trait Implementations§
source§impl Debug for DefaultCredentialsChain
impl Debug for DefaultCredentialsChain
source§impl ProvideCredentials for DefaultCredentialsChain
impl ProvideCredentials for DefaultCredentialsChain
source§fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a>where
Self: 'a,
fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a>where
Self: 'a,
Returns a future that provides credentials.
source§fn fallback_on_interrupt(&self) -> Option<Credentials>
fn fallback_on_interrupt(&self) -> Option<Credentials>
Returns fallback credentials. Read more
Auto Trait Implementations§
impl Freeze for DefaultCredentialsChain
impl !RefUnwindSafe for DefaultCredentialsChain
impl Send for DefaultCredentialsChain
impl Sync for DefaultCredentialsChain
impl Unpin for DefaultCredentialsChain
impl !UnwindSafe for DefaultCredentialsChain
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Creates a shared type from an unshared type.