Struct rusoto_credential::ChainProvider [−][src]
Provides AWS credentials from multiple possible sources using a priority order.
The following sources are checked in order for credentials when calling credentials
:
- Environment variables:
AWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
credential_process
command in the AWS config file, usually located at~/.aws/config
.- AWS credentials file. Usually located at
~/.aws/credentials
. - IAM instance profile. Will only work if running on an EC2 instance with an instance profile/role.
If the sources are exhausted without finding credentials, an error is returned.
The provider has a default timeout of 30 seconds. While it should work well for most setups,
you can change the timeout using the set_timeout
method.
Example
use std::time::Duration; use rusoto_credential::ChainProvider; let mut provider = ChainProvider::new(); // you can overwrite the default timeout like this: provider.set_timeout(Duration::from_secs(60));
Warning
This provider allows the credential_process
option in the AWS config
file (~/.aws/config
), a method of sourcing credentials from an external process. This can
potentially be dangerous, so proceed with caution. Other credential providers should be
preferred if at all possible. If using this option, you should make sure that the config file
is as locked down as possible using security best practices for your operating system.
Implementations
impl ChainProvider
[src]
pub fn set_timeout(&mut self, duration: Duration)
[src]
Set the timeout on the provider to the specified duration.
impl ChainProvider
[src]
pub fn new() -> ChainProvider
[src]
Create a new ChainProvider
using a ProfileProvider
with the default settings.
pub fn with_profile_provider(profile_provider: ProfileProvider) -> ChainProvider
[src]
Create a new ChainProvider
using the provided ProfileProvider
.
Trait Implementations
impl Clone for ChainProvider
[src]
fn clone(&self) -> ChainProvider
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for ChainProvider
[src]
impl Default for ChainProvider
[src]
impl ProvideAwsCredentials for ChainProvider
[src]
fn credentials<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<AwsCredentials, CredentialsError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<AwsCredentials, CredentialsError>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Auto Trait Implementations
impl !RefUnwindSafe for ChainProvider
impl Send for ChainProvider
impl Sync for ChainProvider
impl Unpin for ChainProvider
impl !UnwindSafe for ChainProvider
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,