[][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.

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.

impl Clone for ChainProvider[src]

impl Default for ChainProvider[src]

impl Debug for ChainProvider[src]

Auto Trait Implementations

Blanket Implementations

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

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