pub struct DefaultCredentialProviderBuilder { /* private fields */ }Expand description
Builder for DefaultCredentialProvider.
Use slot(provider) to override a default slot and no_slot() to remove it
from the default chain. Call build() to construct the provider.
Implementations§
Source§impl DefaultCredentialProviderBuilder
impl DefaultCredentialProviderBuilder
Sourcepub fn with_profile(self, profile: impl Into<String>) -> Self
pub fn with_profile(self, profile: impl Into<String>) -> Self
Select the AWS profile used by all profile-aware provider slots.
The explicit profile is applied to the shared profile, SSO, and process
providers that are still enabled. Other settings on those providers are
preserved, and slots removed with no_profile(), no_sso(), or
no_process() remain removed.
An explicitly selected profile takes precedence over AWS_PROFILE.
Slot-level methods called after this method can still replace or remove
individual providers.
Sourcepub fn env(self, provider: EnvCredentialProvider) -> Self
pub fn env(self, provider: EnvCredentialProvider) -> Self
Override the environment credential provider slot.
Sourcepub fn profile(self, provider: ProfileCredentialProvider) -> Self
pub fn profile(self, provider: ProfileCredentialProvider) -> Self
Override the profile credential provider slot.
Sourcepub fn no_profile(self) -> Self
pub fn no_profile(self) -> Self
Remove the profile credential provider from the chain.
Sourcepub fn sso(self, provider: SSOCredentialProvider) -> Self
pub fn sso(self, provider: SSOCredentialProvider) -> Self
Override the SSO credential provider slot.
Sourcepub fn web_identity(
self,
provider: AssumeRoleWithWebIdentityCredentialProvider,
) -> Self
pub fn web_identity( self, provider: AssumeRoleWithWebIdentityCredentialProvider, ) -> Self
Override the web-identity credential provider slot.
Sourcepub fn no_web_identity(self) -> Self
pub fn no_web_identity(self) -> Self
Remove the web-identity credential provider from the chain.
Sourcepub fn process(self, provider: ProcessCredentialProvider) -> Self
pub fn process(self, provider: ProcessCredentialProvider) -> Self
Override the external process credential provider slot.
Sourcepub fn no_process(self) -> Self
pub fn no_process(self) -> Self
Remove the external process credential provider from the chain.
Sourcepub fn ecs(self, provider: ECSCredentialProvider) -> Self
pub fn ecs(self, provider: ECSCredentialProvider) -> Self
Override the ECS credential provider slot.
Sourcepub fn imds(self, provider: IMDSv2CredentialProvider) -> Self
pub fn imds(self, provider: IMDSv2CredentialProvider) -> Self
Override the EC2 IMDSv2 credential provider slot.
Sourcepub fn build(self) -> DefaultCredentialProvider
pub fn build(self) -> DefaultCredentialProvider
Build the DefaultCredentialProvider with the configured options.