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
sourceimpl 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::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::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_http_connector(self, connector: DynConnector) -> Self
pub fn with_http_connector(self, connector: DynConnector) -> Self
Override the HTTPS connector for this configuration
Warning: Use of this method will prevent you from taking advantage of the HTTP connect timeouts.
Consider ProviderConfig::with_tcp_connector
.
Stability
This method is expected to change to support HTTP configuration.
sourcepub fn with_tcp_connector<C>(self, connector: C) -> Self where
C: Clone + Send + Sync + 'static,
C: Service<Uri>,
C::Response: Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
C::Future: Unpin + Send + 'static,
C::Error: Into<Box<dyn Error + Send + Sync + 'static>>,
pub fn with_tcp_connector<C>(self, connector: C) -> Self where
C: Clone + Send + Sync + 'static,
C: Service<Uri>,
C::Response: Connection + AsyncRead + AsyncWrite + Send + Unpin + 'static,
C::Future: Unpin + Send + 'static,
C::Error: Into<Box<dyn Error + Send + Sync + 'static>>,
Override the TCP connector for this configuration
This connector MUST provide an HTTPS encrypted connection.
Stability
This method may change to support HTTP configuration.
sourcepub fn with_sleep(self, sleep: impl AsyncSleep + 'static) -> Self
pub fn with_sleep(self, sleep: impl AsyncSleep + 'static) -> Self
Override the sleep implementation for this configuration
Trait Implementations
sourceimpl Clone for ProviderConfig
impl Clone for ProviderConfig
sourcefn clone(&self) -> ProviderConfig
fn clone(&self) -> ProviderConfig
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for ProviderConfig
impl Debug for ProviderConfig
Auto Trait Implementations
impl !RefUnwindSafe for ProviderConfig
impl Send for ProviderConfig
impl Sync for ProviderConfig
impl Unpin for ProviderConfig
impl !UnwindSafe for ProviderConfig
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more