Struct aws_config::default_provider::credentials::Builder
source · pub struct Builder { /* private fields */ }
Expand description
Builder for DefaultCredentialsChain
.
Implementations§
source§impl Builder
impl Builder
sourcepub fn region(self, region: impl ProvideRegion + 'static) -> Self
pub fn region(self, region: impl ProvideRegion + 'static) -> Self
Sets the region used when making requests to AWS services
When unset, the default region resolver chain will be used.
sourcepub fn set_region(
&mut self,
region: Option<impl ProvideRegion + 'static>
) -> &mut Self
pub fn set_region( &mut self, region: Option<impl ProvideRegion + 'static> ) -> &mut Self
Sets the region used when making requests to AWS services
When unset, the default region resolver chain will be used.
sourcepub fn with_custom_credential_source(
self,
name: impl Into<Cow<'static, str>>,
provider: impl ProvideCredentials + 'static
) -> Self
pub fn with_custom_credential_source( self, name: impl Into<Cow<'static, str>>, provider: impl ProvideCredentials + 'static ) -> Self
Add an additional credential source for the ProfileProvider
Assume role profiles may specify named credential sources:
[default]
role_arn = arn:aws:iam::123456789:role/RoleA
credential_source = MyCustomProvider
Typically, these are built-in providers like Environment
, however, custom sources may
also be used.
sourcepub fn profile_name(self, name: &str) -> Self
pub fn profile_name(self, name: &str) -> Self
Override the profile name used by this provider
When unset, the value of the AWS_PROFILE
environment variable will be used.
sourcepub fn imds_client(self, client: Client) -> Self
pub fn imds_client(self, client: Client) -> Self
Override the IMDS client used for this provider
When unset, the default IMDS client will be used.
sourcepub fn configure(self, config: ProviderConfig) -> Self
pub fn configure(self, config: ProviderConfig) -> Self
Override the configuration used for this provider
sourcepub async fn build(self) -> DefaultCredentialsChain
pub async fn build(self) -> DefaultCredentialsChain
Creates a DefaultCredentialsChain
§Panics
This function will panic if no connector has been set or the rustls
feature has been disabled.