[−][src]Struct rusoto_credential::ChainProvider
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
extern crate rusoto_credential; use std::time::Duration; use rusoto_credential::ChainProvider; fn main() { 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.
Methods
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 ProvideAwsCredentials for ChainProvider
[src]
type Future = ChainProviderFuture
The future response value.
fn credentials(&self) -> Self::Future
[src]
impl Default for ChainProvider
[src]
impl Clone for ChainProvider
[src]
fn clone(&self) -> ChainProvider
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for ChainProvider
[src]
Auto Trait Implementations
impl Sync for ChainProvider
impl Send for ChainProvider
impl Unpin for ChainProvider
impl !RefUnwindSafe for ChainProvider
impl !UnwindSafe for ChainProvider
Blanket Implementations
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.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> From<T> for 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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,