Package org.apache.hadoop.fs.s3a.auth

Class AssumedRoleCredentialProvider

java.lang.Object
org.apache.hadoop.fs.s3a.auth.AssumedRoleCredentialProvider
All Implemented Interfaces:
Closeable, AutoCloseable, software.amazon.awssdk.auth.credentials.AwsCredentialsProvider, software.amazon.awssdk.identity.spi.IdentityProvider<software.amazon.awssdk.identity.spi.AwsCredentialsIdentity>

@Public @Evolving public final class AssumedRoleCredentialProvider extends Object implements software.amazon.awssdk.auth.credentials.AwsCredentialsProvider, Closeable
Support IAM Assumed roles by instantiating an instance of STSAssumeRoleSessionCredentialsProvider from configuration properties, including wiring up the inner authenticator, and, unless overridden, creating a session name from the current user. Classname is used in configuration files; do not move.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    Instantiate.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Propagate the close() call to the inner stsProvider.
    void
    operationRetried(String text, Exception ex, int retries, boolean idempotent)
    Callback from Invoker when an operation is retried.
    software.amazon.awssdk.auth.credentials.AwsCredentials
    Get credentials.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface software.amazon.awssdk.auth.credentials.AwsCredentialsProvider

    identityType, resolveIdentity

    Methods inherited from interface software.amazon.awssdk.identity.spi.IdentityProvider

    resolveIdentity, resolveIdentity
  • Field Details

  • Constructor Details

    • AssumedRoleCredentialProvider

      public AssumedRoleCredentialProvider(@Nullable URI fsUri, Configuration conf) throws IOException
      Instantiate. This calls resolveCredentials() to fail fast on the inner role credential retrieval.
      Parameters:
      fsUri - possibly null URI of the filesystem.
      conf - configuration
      Throws:
      IOException - on IO problems and some parameter checking
      IllegalArgumentException - invalid parameters
      software.amazon.awssdk.services.sts.model.StsException - problems getting credentials
  • Method Details

    • resolveCredentials

      @RetryRaw public software.amazon.awssdk.auth.credentials.AwsCredentials resolveCredentials()
      Get credentials.
      Specified by:
      resolveCredentials in interface software.amazon.awssdk.auth.credentials.AwsCredentialsProvider
      Returns:
      the credentials
      Throws:
      software.amazon.awssdk.services.sts.model.StsException - if none could be obtained.
    • close

      public void close()
      Propagate the close() call to the inner stsProvider.
      Specified by:
      close in interface AutoCloseable
      Specified by:
      close in interface Closeable
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • operationRetried

      public void operationRetried(String text, Exception ex, int retries, boolean idempotent)
      Callback from Invoker when an operation is retried.
      Parameters:
      text - text of the operation
      ex - exception
      retries - number of retries
      idempotent - is the method idempotent