@ComponentProfile(summary="Create a set of credentials via STS", tag="amazon,aws,sts,assumerole", since="4.0.0") public class STSAssumeroleCredentialsBuilder extends java.lang.Object implements AWSCredentialsProviderBuilder
AWS Security Token Service (STS) enables you to request temporary, limited-privilege credentials for AWS Identity and Access Management (IAM) users or for users that you authenticate (federated users). For more information about using this service, see Temporary Security Credentials.
In the adapter configuration file this class is aliased as aws-sts-assumerole-credentials-builder which is the preferred alternative to the fully qualified classname when building your configuration.
AWSCredentialsProviderBuilder.BuilderConfig
Constructor and Description |
---|
STSAssumeroleCredentialsBuilder() |
Modifier and Type | Method and Description |
---|---|
com.amazonaws.auth.AWSCredentialsProvider |
build() |
com.amazonaws.auth.AWSCredentialsProvider |
build(AWSCredentialsProviderBuilder.BuilderConfig conf) |
AWSCredentialsProviderBuilder |
getCredentials()
The underlying credentials used to access STS.
|
@NonNull java.lang.String |
getRoleArn()
The required roleArn parameter when starting a session.
|
java.lang.Integer |
getRoleDurationSeconds()
The duration for which we want to have an assumed role session to be active
|
java.lang.String |
getRoleExternalId()
An external id used in the service call used to retrieve session credentials
|
@NonNull java.lang.String |
getRoleSessionName()
The required roleSessionName when starting a session.
|
java.lang.String |
getScopeDownPolicy()
An IAM policy in JSON format to scope down permissions granted from the assume role.
|
KeyValuePairSet |
getSessionTags()
The collection of tags which we want to pass to the assume role request
|
java.util.List<java.lang.String> |
getTransitiveTagKeys()
The transitive tag keys we want to pass to the assume role request
|
void |
setCredentials(AWSCredentialsProviderBuilder credentials)
The underlying credentials used to access STS.
|
void |
setRoleArn(@NonNull java.lang.String roleArn)
The required roleArn parameter when starting a session.
|
void |
setRoleDurationSeconds(java.lang.Integer roleDurationSeconds)
The duration for which we want to have an assumed role session to be active
|
void |
setRoleExternalId(java.lang.String roleExternalId)
An external id used in the service call used to retrieve session credentials
|
void |
setRoleSessionName(@NonNull java.lang.String roleSessionName)
The required roleSessionName when starting a session.
|
void |
setScopeDownPolicy(java.lang.String scopeDownPolicy)
An IAM policy in JSON format to scope down permissions granted from the assume role.
|
void |
setSessionTags(KeyValuePairSet sessionTags)
The collection of tags which we want to pass to the assume role request
|
void |
setTransitiveTagKeys(java.util.List<java.lang.String> transitiveTagKeys)
The transitive tag keys we want to pass to the assume role request
|
STSAssumeroleCredentialsBuilder |
withCredentials(AWSCredentialsProviderBuilder a) |
STSAssumeroleCredentialsBuilder |
withRoleArn(java.lang.String s) |
STSAssumeroleCredentialsBuilder |
withRoleExternalId(java.lang.String s) |
STSAssumeroleCredentialsBuilder |
withRoleSessionName(java.lang.String s) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
defaultIfNull
public com.amazonaws.auth.AWSCredentialsProvider build() throws java.lang.Exception
build
in interface AWSCredentialsProviderBuilder
java.lang.Exception
public com.amazonaws.auth.AWSCredentialsProvider build(AWSCredentialsProviderBuilder.BuilderConfig conf) throws java.lang.Exception
build
in interface AWSCredentialsProviderBuilder
java.lang.Exception
public STSAssumeroleCredentialsBuilder withCredentials(AWSCredentialsProviderBuilder a)
public STSAssumeroleCredentialsBuilder withRoleArn(java.lang.String s)
public STSAssumeroleCredentialsBuilder withRoleSessionName(java.lang.String s)
public STSAssumeroleCredentialsBuilder withRoleExternalId(java.lang.String s)
public AWSCredentialsProviderBuilder getCredentials()
public void setCredentials(AWSCredentialsProviderBuilder credentials)
@NonNull public @NonNull java.lang.String getRoleArn()
public void setRoleArn(@NonNull @NonNull java.lang.String roleArn)
@NonNull public @NonNull java.lang.String getRoleSessionName()
public void setRoleSessionName(@NonNull @NonNull java.lang.String roleSessionName)
public java.lang.String getRoleExternalId()
public void setRoleExternalId(java.lang.String roleExternalId)
public java.util.List<java.lang.String> getTransitiveTagKeys()
This defaults to null
to avoid configuration clutter
public void setTransitiveTagKeys(java.util.List<java.lang.String> transitiveTagKeys)
This defaults to null
to avoid configuration clutter
public KeyValuePairSet getSessionTags()
This defaults to null
to avoid configuration clutter
public void setSessionTags(KeyValuePairSet sessionTags)
This defaults to null
to avoid configuration clutter
public java.lang.Integer getRoleDurationSeconds()
This defaults to null
to avoid configuration clutter
public void setRoleDurationSeconds(java.lang.Integer roleDurationSeconds)
This defaults to null
to avoid configuration clutter
public java.lang.String getScopeDownPolicy()
This is passed though to
STSAssumeRoleSessionCredentialsProvider.Builder#withScopeDownPolicy(String)
as-is with
no checking, is completely optional and defaults to null
to avoid configuration clutter
public void setScopeDownPolicy(java.lang.String scopeDownPolicy)
This is passed though to
STSAssumeRoleSessionCredentialsProvider.Builder#withScopeDownPolicy(String)
as-is with
no checking, is completely optional and defaults to null
to avoid configuration clutter