pub struct AwsLoader { /* private fields */ }
Expand description
CredentialLoader will load credential from different methods.
Implementations§
source§impl Loader
impl Loader
sourcepub fn with_disable_ec2_metadata(self) -> Self
pub fn with_disable_ec2_metadata(self) -> Self
Disable load from ec2 metadata.
sourcepub fn with_customed_credential_loader(self, f: Box<dyn CredentialLoad>) -> Self
pub fn with_customed_credential_loader(self, f: Box<dyn CredentialLoad>) -> Self
Set customed credential loader.
This loader will be used first.
sourcepub async fn load(&self) -> Result<Option<Credential>>
pub async fn load(&self) -> Result<Option<Credential>>
Load credential.
Resolution order:
- Environment variables
- Shared config (
~/.aws/config
,~/.aws/credentials
) - Web Identity Tokens
- ECS (IAM Roles for Tasks) & General HTTP credentials:
- EC2 IMDSv2