WebIdentityProvider

Struct WebIdentityProvider 

Source
pub struct WebIdentityProvider {
    pub web_identity_token: Variable<Secret, CredentialsError>,
    pub role_arn: Variable<String, CredentialsError>,
    pub role_session_name: Option<Variable<Option<String>, CredentialsError>>,
    pub duration_seconds: Option<i64>,
    pub policy: Option<String>,
    pub policy_arns: Option<Vec<PolicyDescriptorType>>,
}
Expand description

WebIdentityProvider using OpenID Connect bearer token to retrieve AWS IAM credentials.

See https://docs.aws.amazon.com/STS/latest/APIReference/API_AssumeRoleWithWebIdentity.html for more details.

Fields§

§web_identity_token: Variable<Secret, CredentialsError>

The OAuth 2.0 access token or OpenID Connect ID token that is provided by the identity provider. Your application must get this token by authenticating the user who is using your application with a web identity provider before the application makes an AssumeRoleWithWebIdentity call.

§role_arn: Variable<String, CredentialsError>

The Amazon Resource Name (ARN) of the role that the caller is assuming.

§role_session_name: Option<Variable<Option<String>, CredentialsError>>

An identifier for the assumed role session. Typically, you pass the name or identifier that is associated with the user who is using your application. That way, the temporary security credentials that your application will use are associated with that user. This session name is included as part of the ARN and assumed role ID in the AssumedRoleUser response element.

§duration_seconds: Option<i64>

The duration, in seconds, of the role session. The value can range from 900 seconds (15 minutes) up to the maximum session duration setting for the role.

§policy: Option<String>

An IAM policy in JSON format that you want to use as an inline session policy.

§policy_arns: Option<Vec<PolicyDescriptorType>>

The Amazon Resource Names (ARNs) of the IAM managed policies that you want to use as managed session policies.

Implementations§

Source§

impl WebIdentityProvider

Source

pub fn new<A, B, C>( web_identity_token: A, role_arn: B, role_session_name: Option<C>, ) -> Self

Create new WebIdentityProvider by explicitly passing its configuration.

Source

pub fn from_k8s_env() -> Self

Creat a WebIdentityProvider from the following environment variables:

  • AWS_WEB_IDENTITY_TOKEN_FILE path to the web identity token file.
  • AWS_ROLE_ARN ARN of the role to assume.
  • AWS_ROLE_SESSION_NAME (optional) name applied to the assume-role session.

See https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts-technical-overview.html for more information about how IAM Roles for Kubernetes Service Accounts works.

Trait Implementations§

Source§

impl Clone for WebIdentityProvider

Source§

fn clone(&self) -> WebIdentityProvider

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for WebIdentityProvider

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl ProvideAwsCredentials for WebIdentityProvider

Source§

fn credentials<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = Result<AwsCredentials, CredentialsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Produce a new AwsCredentials future.

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

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

fn in_current_span(self) -> Instrumented<Self>

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

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> ErasedDestructor for T
where T: 'static,