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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Propagate the close() call to the inner stsProvider.voidoperationRetried(String text, Exception ex, int retries, boolean idempotent) Callback fromInvokerwhen an operation is retried.software.amazon.awssdk.auth.credentials.AwsCredentialsGet credentials.toString()Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface software.amazon.awssdk.auth.credentials.AwsCredentialsProvider
identityType, resolveIdentityMethods inherited from interface software.amazon.awssdk.identity.spi.IdentityProvider
resolveIdentity, resolveIdentity
-
Field Details
-
NAME
- See Also:
-
E_NO_ROLE
- See Also:
-
-
Constructor Details
-
AssumedRoleCredentialProvider
Instantiate. This callsresolveCredentials()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 checkingIllegalArgumentException- invalid parameterssoftware.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:
resolveCredentialsin interfacesoftware.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:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
toString
-
operationRetried
Callback fromInvokerwhen an operation is retried.- Parameters:
text- text of the operationex- exceptionretries- number of retriesidempotent- is the method idempotent
-