Class AwsSecretsManagerClient.Builder
java.lang.Object
codes.grow.packages.awssecretsmanager.AwsSecretsManagerClient.Builder
- Enclosing class:
AwsSecretsManagerClient
Builder that configures and creates a client in one chain.
-
Method Summary
Modifier and TypeMethodDescriptionaccessKeyId(String accessKeyId) Sets the static access key id.build()Builds the configuration and the client.Sets the connect timeout.credentials(String accessKeyId, String secretAccessKey) Sets static credentials.credentials(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentials) Sets an AWS SDK credentials provider.externalId(String externalId) Sets the STS external id.Fills unset fields from an environment reader whenbuild()runs.Adds a header.Sets hooks.Sets the logger.Sets the shared config profile.Sets the proxy URL.recoveryWindowDays(int days) Sets the recovery window of deletes.Sets the AWS region.Sets the per-attempt timeout.retry(RetryPolicy retry) Sets the retry policy.Assumes an IAM role with STS.roleDuration(Duration duration) Sets the assumed-role session duration.roleSessionName(String name) Sets the STS role session name.sdkClient(software.amazon.awssdk.services.secretsmanager.SecretsManagerClient sdkClient) Wraps an existing AWS SDK client.secretAccessKey(Secret secretAccessKey) Sets the static secret access key.sessionToken(Secret sessionToken) Sets the session token.tls(TlsOptions tls) Sets the TLS options.Sets the total timeout.Sets the endpoint override.userAgentSuffix(String suffix) Sets the user agent suffix.
-
Method Details
-
fromEnv
Fills unset fields from an environment reader whenbuild()runs.- Parameters:
env- reader, e.g.EnvReader.system()- Returns:
- this builder
-
url
Sets the endpoint override.- Parameters:
url- URL- Returns:
- this builder
-
region
Sets the AWS region.- Parameters:
region- region- Returns:
- this builder
-
credentials
Sets static credentials.- Parameters:
accessKeyId- key idsecretAccessKey- secret key- Returns:
- this builder
-
accessKeyId
Sets the static access key id.- Parameters:
accessKeyId- key id- Returns:
- this builder
-
secretAccessKey
Sets the static secret access key.- Parameters:
secretAccessKey- key- Returns:
- this builder
-
sessionToken
Sets the session token.- Parameters:
sessionToken- token- Returns:
- this builder
-
profile
Sets the shared config profile.- Parameters:
profile- profile- Returns:
- this builder
-
credentials
public AwsSecretsManagerClient.Builder credentials(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider credentials) Sets an AWS SDK credentials provider.- Parameters:
credentials- provider- Returns:
- this builder
-
roleArn
Assumes an IAM role with STS.- Parameters:
roleArn- role ARN- Returns:
- this builder
-
roleSessionName
Sets the STS role session name.- Parameters:
name- session name- Returns:
- this builder
-
externalId
Sets the STS external id.- Parameters:
externalId- external id- Returns:
- this builder
-
roleDuration
Sets the assumed-role session duration.- Parameters:
duration- duration- Returns:
- this builder
-
recoveryWindowDays
Sets the recovery window of deletes.- Parameters:
days- 7–30- Returns:
- this builder
-
sdkClient
public AwsSecretsManagerClient.Builder sdkClient(software.amazon.awssdk.services.secretsmanager.SecretsManagerClient sdkClient) Wraps an existing AWS SDK client.- Parameters:
sdkClient- client- Returns:
- this builder
-
connectTimeout
Sets the connect timeout.- Parameters:
d- duration- Returns:
- this builder
-
requestTimeout
Sets the per-attempt timeout.- Parameters:
d- duration- Returns:
- this builder
-
totalTimeout
Sets the total timeout.- Parameters:
d- duration- Returns:
- this builder
-
retry
Sets the retry policy.- Parameters:
retry- policy- Returns:
- this builder
-
tls
Sets the TLS options.- Parameters:
tls- options- Returns:
- this builder
-
proxy
Sets the proxy URL.- Parameters:
proxy- URL- Returns:
- this builder
-
header
Adds a header.- Parameters:
name- namevalue- value- Returns:
- this builder
-
userAgentSuffix
Sets the user agent suffix.- Parameters:
suffix- suffix- Returns:
- this builder
-
hooks
Sets hooks.- Parameters:
hooks- hooks- Returns:
- this builder
-
logger
Sets the logger.- Parameters:
logger- logger- Returns:
- this builder
-
build
Builds the configuration and the client.- Returns:
- a new client
- Throws:
ConfigException- when the configuration is invalid
-