Struct aws_config::sts::AssumeRoleProvider
source · 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_credential_types::Credentials;
use aws_config::sts::{AssumeRoleProvider};
use aws_types::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§
source§impl AssumeRoleProvider
impl AssumeRoleProvider
sourcepub fn builder(role: impl Into<String>) -> AssumeRoleProviderBuilder
pub fn builder(role: impl Into<String>) -> AssumeRoleProviderBuilder
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§
source§impl Debug for AssumeRoleProvider
impl Debug for AssumeRoleProvider
source§impl ProvideCredentials for AssumeRoleProvider
impl ProvideCredentials for AssumeRoleProvider
source§fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a>where
Self: 'a,
fn provide_credentials<'a>(&'a self) -> ProvideCredentials<'a>where Self: 'a,
Returns a future that provides credentials.