[][src]Struct rusoto_credential::ChainProvider

pub struct ChainProvider { /* fields omitted */ }

Provides AWS credentials from multiple possible sources using a priority order.

The following sources are checked in order for credentials when calling credentials:

  1. Environment variables: AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY
  2. credential_process command in the AWS config file, usually located at ~/.aws/config.
  3. AWS credentials file. Usually located at ~/.aws/credentials.
  4. 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.


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:

  // ...


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.


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.

impl Default for ChainProvider[src]

impl Clone for ChainProvider[src]

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

impl Debug for ChainProvider[src]

Auto Trait Implementations

impl Send for ChainProvider

impl Sync for ChainProvider

Blanket Implementations

impl<T> From for T[src]

impl<T, U> Into for T where
    U: From<T>, 

impl<T> ToOwned for T where
    T: Clone

type Owned = T

impl<T, U> TryFrom for T where
    T: From<U>, 

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized

impl<T> BorrowMut for T where
    T: ?Sized

impl<T, U> TryInto for T where
    U: TryFrom<T>, 

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized

impl<T> Erased for T