pub struct ProviderConfig { /* private fields */ }
Expand description
Configuration options for Credential Providers
Most credential providers builders offer a configure
method which applies general provider configuration
options.
To use a region from the default region provider chain use ProviderConfig::with_default_region
.
Otherwise, use ProviderConfig::without_region
. Note that some credentials providers require a region
to be explicitly set.
Implementations§
Source§impl ProviderConfig
impl ProviderConfig
Sourcepub fn without_region() -> Self
pub fn without_region() -> Self
Create a default provider config with the region unset.
Using this option means that you may need to set a region manually.
This constructor will use a default value for the HTTPS connector and Sleep implementation
when they are enabled as crate features which is usually the correct option. To construct
a ProviderConfig
without these fields set, use ProviderConfig::empty
.
§Examples
use aws_config::provider_config::ProviderConfig;
use aws_sdk_sts::config::Region;
use aws_config::web_identity_token::WebIdentityTokenCredentialsProvider;
let conf = ProviderConfig::without_region().with_region(Some(Region::new("us-east-1")));
let credential_provider = WebIdentityTokenCredentialsProvider::builder().configure(&conf).build();
Sourcepub async fn with_default_region() -> Self
pub async fn with_default_region() -> Self
Create a default provider config with the region region automatically loaded from the default chain.
§Examples
use aws_config::provider_config::ProviderConfig;
use aws_sdk_sts::config::Region;
use aws_config::web_identity_token::WebIdentityTokenCredentialsProvider;
let conf = ProviderConfig::with_default_region().await;
let credential_provider = WebIdentityTokenCredentialsProvider::builder().configure(&conf).build();
}
Sourcepub fn with_region(self, region: Option<Region>) -> Self
pub fn with_region(self, region: Option<Region>) -> Self
Override the region for the configuration
Sourcepub async fn load_default_region(self) -> Self
pub async fn load_default_region(self) -> Self
Use the default region chain to set the region for this configuration
Note: the env
and fs
already set on this provider will be used when loading the default region.
Sourcepub fn with_time_source(self, time_source: impl TimeSource + 'static) -> Self
pub fn with_time_source(self, time_source: impl TimeSource + 'static) -> Self
Override the time source for this configuration
Sourcepub fn with_http_client(self, http_client: impl HttpClient + 'static) -> Self
pub fn with_http_client(self, http_client: impl HttpClient + 'static) -> Self
Override the HTTP client for this configuration
Sourcepub fn with_sleep_impl(self, sleep_impl: impl AsyncSleep + 'static) -> Self
pub fn with_sleep_impl(self, sleep_impl: impl AsyncSleep + 'static) -> Self
Override the sleep implementation for this configuration
Trait Implementations§
Source§impl Clone for ProviderConfig
impl Clone for ProviderConfig
Source§fn clone(&self) -> ProviderConfig
fn clone(&self) -> ProviderConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ProviderConfig
impl Debug for ProviderConfig
Auto Trait Implementations§
impl Freeze for ProviderConfig
impl !RefUnwindSafe for ProviderConfig
impl Send for ProviderConfig
impl Sync for ProviderConfig
impl Unpin for ProviderConfig
impl !UnwindSafe for ProviderConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more