Skip to main content

DefaultCredentialProviderBuilder

Struct DefaultCredentialProviderBuilder 

Source
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

Source

pub fn new() -> Self

Create a new builder with default state.

Source

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.

Source

pub fn env(self, provider: EnvCredentialProvider) -> Self

Override the environment credential provider slot.

Source

pub fn no_env(self) -> Self

Remove the environment credential provider from the chain.

Source

pub fn profile(self, provider: ProfileCredentialProvider) -> Self

Override the profile credential provider slot.

Source

pub fn no_profile(self) -> Self

Remove the profile credential provider from the chain.

Source

pub fn sso(self, provider: SSOCredentialProvider) -> Self

Override the SSO credential provider slot.

Source

pub fn no_sso(self) -> Self

Remove the SSO credential provider from the chain.

Source

pub fn web_identity( self, provider: AssumeRoleWithWebIdentityCredentialProvider, ) -> Self

Override the web-identity credential provider slot.

Source

pub fn no_web_identity(self) -> Self

Remove the web-identity credential provider from the chain.

Source

pub fn process(self, provider: ProcessCredentialProvider) -> Self

Override the external process credential provider slot.

Source

pub fn no_process(self) -> Self

Remove the external process credential provider from the chain.

Source

pub fn ecs(self, provider: ECSCredentialProvider) -> Self

Override the ECS credential provider slot.

Source

pub fn no_ecs(self) -> Self

Remove the ECS credential provider from the chain.

Source

pub fn imds(self, provider: IMDSv2CredentialProvider) -> Self

Override the EC2 IMDSv2 credential provider slot.

Source

pub fn no_imds(self) -> Self

Remove the EC2 IMDSv2 credential provider from the chain.

Source

pub fn build(self) -> DefaultCredentialProvider

Build the DefaultCredentialProvider with the configured options.

Trait Implementations§

Source§

impl Default for DefaultCredentialProviderBuilder

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> MaybeSend for T
where T: Send,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V