Class StsWebIdentityTokenFileCredentialsProvider.Builder
- All Implemented Interfaces:
Buildable
,CopyableBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,
,StsWebIdentityTokenFileCredentialsProvider> SdkBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,
StsWebIdentityTokenFileCredentialsProvider>
- Enclosing class:
StsWebIdentityTokenFileCredentialsProvider
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Build the credentials provider using the configuration applied to this builder.refreshRequest
(Consumer<AssumeRoleWithWebIdentityRequest.Builder> assumeRoleWithWebIdentityRequest) Similar torefreshRequest(AssumeRoleWithWebIdentityRequest)
, but takes a lambda to configure a newAssumeRoleWithWebIdentityRequest.Builder
.refreshRequest
(Supplier<AssumeRoleWithWebIdentityRequest> assumeRoleWithWebIdentityRequestSupplier) Similar torefreshRequest(AssumeRoleWithWebIdentityRequest)
, but takes aSupplier
to supply the request to STS.refreshRequest
(AssumeRoleWithWebIdentityRequest assumeRoleWithWebIdentityRequest) Configure theAssumeRoleWithWebIdentityRequest
that should be periodically sent to the STS service to update the session token when it gets close to expiring.The Amazon Resource Name (ARN) of the IAM role that is associated with the Sts.roleSessionName
(String roleSessionName) Sets the role session name that should be used by this credentials provider.void
setRoleArn
(String roleArn) Sets Amazon Resource Name (ARN) of the IAM role that is associated with the Sts.void
setRoleSessionName
(String roleSessionName) Sets the role session name that should be used by this credentials provider.void
setWebIdentityTokenFile
(Path webIdentityTokenFile) The CustomStsClient
that will be used to fetch AWS service credentials.webIdentityTokenFile
(Path webIdentityTokenFile) Sets the absolute path to the web identity token file that should be used by this credentials provider.Methods inherited from class software.amazon.awssdk.services.sts.auth.StsCredentialsProvider.BaseBuilder
asyncCredentialUpdateEnabled, prefetchTime, staleTime
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface software.amazon.awssdk.utils.builder.CopyableBuilder
copy
Methods inherited from interface software.amazon.awssdk.utils.builder.SdkBuilder
applyMutation
-
Method Details
-
stsClient
The CustomStsClient
that will be used to fetch AWS service credentials.- This SDK client must be closed by the caller when it is ready to be disposed.
- This SDK client's retry policy should handle IdpCommunicationErrorException
- Overrides:
stsClient
in classStsCredentialsProvider.BaseBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,
StsWebIdentityTokenFileCredentialsProvider> - Parameters:
stsClient
- The STS client to use for communication with STS. Make sure IdpCommunicationErrorException is retried in the retry policy for this client. Make sure the custom STS client is closed when it is ready to be disposed.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
roleArn
The Amazon Resource Name (ARN) of the IAM role that is associated with the Sts. If not provided this will be read from SdkSystemSetting.AWS_ROLE_ARN.
- Parameters:
roleArn
- The Amazon Resource Name (ARN) of the IAM role that is associated with the Sts cluster.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setRoleArn
Sets Amazon Resource Name (ARN) of the IAM role that is associated with the Sts. By default this will be read from SdkSystemSetting.AWS_ROLE_ARN.
- Parameters:
roleArn
- The Amazon Resource Name (ARN) of the IAM role that is associated with the Sts cluster.
-
roleSessionName
Sets the role session name that should be used by this credentials provider. By default this is read from SdkSystemSetting.AWS_ROLE_SESSION_NAME
- Parameters:
roleSessionName
- role session name that should be used by this credentials provider- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setRoleSessionName
Sets the role session name that should be used by this credentials provider. By default this is read from SdkSystemSetting.AWS_ROLE_SESSION_NAME
- Parameters:
roleSessionName
- role session name that should be used by this credentials provider.
-
webIdentityTokenFile
public StsWebIdentityTokenFileCredentialsProvider.Builder webIdentityTokenFile(Path webIdentityTokenFile) Sets the absolute path to the web identity token file that should be used by this credentials provider. By default this will be read from SdkSystemSetting.AWS_WEB_IDENTITY_TOKEN_FILE.
- Parameters:
webIdentityTokenFile
- absolute path to the web identity token file that should be used by this credentials provider.- Returns:
- Returns a reference to this object so that method calls can be chained together.
-
setWebIdentityTokenFile
-
refreshRequest
public StsWebIdentityTokenFileCredentialsProvider.Builder refreshRequest(AssumeRoleWithWebIdentityRequest assumeRoleWithWebIdentityRequest) Configure theAssumeRoleWithWebIdentityRequest
that should be periodically sent to the STS service to update the session token when it gets close to expiring.- Parameters:
assumeRoleWithWebIdentityRequest
- The request to send to STS whenever the assumed session expires.- Returns:
- This object for chained calls.
-
refreshRequest
public StsWebIdentityTokenFileCredentialsProvider.Builder refreshRequest(Supplier<AssumeRoleWithWebIdentityRequest> assumeRoleWithWebIdentityRequestSupplier) Similar torefreshRequest(AssumeRoleWithWebIdentityRequest)
, but takes aSupplier
to supply the request to STS.- Parameters:
assumeRoleWithWebIdentityRequestSupplier
- A supplier- Returns:
- This object for chained calls.
-
refreshRequest
public StsWebIdentityTokenFileCredentialsProvider.Builder refreshRequest(Consumer<AssumeRoleWithWebIdentityRequest.Builder> assumeRoleWithWebIdentityRequest) Similar torefreshRequest(AssumeRoleWithWebIdentityRequest)
, but takes a lambda to configure a newAssumeRoleWithWebIdentityRequest.Builder
. This removes the need to callAssumeRoleWithWebIdentityRequest.builder()
andStsRequest.Builder.build()
. -
build
Description copied from class:StsCredentialsProvider.BaseBuilder
Build the credentials provider using the configuration applied to this builder.- Specified by:
build
in interfaceBuildable
- Specified by:
build
in interfaceSdkBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,
StsWebIdentityTokenFileCredentialsProvider> - Overrides:
build
in classStsCredentialsProvider.BaseBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,
StsWebIdentityTokenFileCredentialsProvider> - Returns:
- an instance of T
-