Class StsWebIdentityTokenFileCredentialsProvider.Builder
- java.lang.Object
-
- software.amazon.awssdk.services.sts.auth.StsCredentialsProvider.BaseBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,StsWebIdentityTokenFileCredentialsProvider>
-
- software.amazon.awssdk.services.sts.auth.StsWebIdentityTokenFileCredentialsProvider.Builder
-
- All Implemented Interfaces:
Buildable
,CopyableBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,StsWebIdentityTokenFileCredentialsProvider>
,SdkBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,StsWebIdentityTokenFileCredentialsProvider>
- Enclosing class:
- StsWebIdentityTokenFileCredentialsProvider
public static final class StsWebIdentityTokenFileCredentialsProvider.Builder extends StsCredentialsProvider.BaseBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,StsWebIdentityTokenFileCredentialsProvider>
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StsWebIdentityTokenFileCredentialsProvider
build()
Build the credentials provider using the configuration applied to this builder.StsWebIdentityTokenFileCredentialsProvider.Builder
refreshRequest(Consumer<AssumeRoleWithWebIdentityRequest.Builder> assumeRoleWithWebIdentityRequest)
Similar torefreshRequest(AssumeRoleWithWebIdentityRequest)
, but takes a lambda to configure a newAssumeRoleWithWebIdentityRequest.Builder
.StsWebIdentityTokenFileCredentialsProvider.Builder
refreshRequest(Supplier<AssumeRoleWithWebIdentityRequest> assumeRoleWithWebIdentityRequestSupplier)
Similar torefreshRequest(AssumeRoleWithWebIdentityRequest)
, but takes aSupplier
to supply the request to STS.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.StsWebIdentityTokenFileCredentialsProvider.Builder
roleArn(String roleArn)
The Amazon Resource Name (ARN) of the IAM role that is associated with the Sts.StsWebIdentityTokenFileCredentialsProvider.Builder
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)
StsWebIdentityTokenFileCredentialsProvider.Builder
stsClient(StsClient stsClient)
The CustomStsClient
that will be used to fetch AWS service credentials.StsWebIdentityTokenFileCredentialsProvider.Builder
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
clone, equals, finalize, 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 Detail
-
stsClient
public StsWebIdentityTokenFileCredentialsProvider.Builder stsClient(StsClient 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
public StsWebIdentityTokenFileCredentialsProvider.Builder roleArn(String 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
public void setRoleArn(String roleArn)
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
public StsWebIdentityTokenFileCredentialsProvider.Builder roleSessionName(String 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
public void setRoleSessionName(String 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.
-
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
public void setWebIdentityTokenFile(Path webIdentityTokenFile)
-
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
public StsWebIdentityTokenFileCredentialsProvider 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>
-
-