Struct aws_config::provider_config::ProviderConfig
source · 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 more