pub struct AssumeRoleProvider { /* private fields */ }
Expand description

Credentials provider that uses credentials provided by another provider to assume a role through the AWS Security Token Service (STS).

When asked to provide credentials, this provider will first invoke the inner credentials provider to get AWS credentials for STS. Then, it will call STS to get assumed credentials for the desired role.

Examples

use aws_config::sts::{AssumeRoleProvider};
use aws_types::{Credentials, region::Region};
use aws_config::environment;
use aws_config::environment::credentials::EnvironmentVariableCredentialsProvider;
use std::sync::Arc;

let provider = AssumeRoleProvider::builder("arn:aws:iam::123456789012:role/demo")
  .region(Region::from_static("us-east-2"))
  .session_name("testAR")
  .build(Arc::new(EnvironmentVariableCredentialsProvider::new()) as Arc<_>);

Implementations

Build a new role-assuming provider for the given role.

The role argument should take the form an Amazon Resource Name (ARN) like

arn:aws:iam::123456789012:role/example

Trait Implementations

Formats the value using the given formatter. Read more

Returns a future that provides credentials.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more