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 StsWebIdentityTokenFileCredentialsProviderbuild()Build the credentials provider using the configuration applied to this builder.StsWebIdentityTokenFileCredentialsProvider.BuilderrefreshRequest(Consumer<AssumeRoleWithWebIdentityRequest.Builder> assumeRoleWithWebIdentityRequest)Similar torefreshRequest(AssumeRoleWithWebIdentityRequest), but takes a lambda to configure a newAssumeRoleWithWebIdentityRequest.Builder.StsWebIdentityTokenFileCredentialsProvider.BuilderrefreshRequest(Supplier<AssumeRoleWithWebIdentityRequest> assumeRoleWithWebIdentityRequestSupplier)Similar torefreshRequest(AssumeRoleWithWebIdentityRequest), but takes aSupplierto supply the request to STS.StsWebIdentityTokenFileCredentialsProvider.BuilderrefreshRequest(AssumeRoleWithWebIdentityRequest assumeRoleWithWebIdentityRequest)Configure theAssumeRoleWithWebIdentityRequestthat should be periodically sent to the STS service to update the session token when it gets close to expiring.StsWebIdentityTokenFileCredentialsProvider.BuilderroleArn(String roleArn)The Amazon Resource Name (ARN) of the IAM role that is associated with the Sts.StsWebIdentityTokenFileCredentialsProvider.BuilderroleSessionName(String roleSessionName)Sets the role session name that should be used by this credentials provider.voidsetRoleArn(String roleArn)Sets Amazon Resource Name (ARN) of the IAM role that is associated with the Sts.voidsetRoleSessionName(String roleSessionName)Sets the role session name that should be used by this credentials provider.voidsetWebIdentityTokenFile(Path webIdentityTokenFile)StsWebIdentityTokenFileCredentialsProvider.BuilderstsClient(StsClient stsClient)The CustomStsClientthat will be used to fetch AWS service credentials.StsWebIdentityTokenFileCredentialsProvider.BuilderwebIdentityTokenFile(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 CustomStsClientthat 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:
stsClientin 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 theAssumeRoleWithWebIdentityRequestthat 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 aSupplierto 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.BaseBuilderBuild the credentials provider using the configuration applied to this builder.- Specified by:
buildin interfaceBuildable- Specified by:
buildin interfaceSdkBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,StsWebIdentityTokenFileCredentialsProvider>- Overrides:
buildin classStsCredentialsProvider.BaseBuilder<StsWebIdentityTokenFileCredentialsProvider.Builder,StsWebIdentityTokenFileCredentialsProvider>
-
-