Class AwsSecretsManagerConfig
java.lang.Object
codes.grow.packages.awssecretsmanager.AwsSecretsManagerConfig
Immutable configuration of a
AwsSecretsManagerClient (SPEC section 2.2 plus the AWS
fields of API.md section 5).
Build one with builder() or read it from the environment with fromEnv().
Precedence: explicit builder value > GROW_AWS_SECRETS_MANAGER_<NAME> > the standard
AWS variables (AWS_REGION, AWS_ACCESS_KEY_ID,
AWS_ENDPOINT_URL_SECRETS_MANAGER, ...) > defaults. Credentials left unset use the AWS SDK
default credential chain. toString() never prints credentials.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder of the configuration. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault recovery window of deletes in days (the AWS default).static final StringDefault STS role session name of the assume-role helper. -
Method Summary
Modifier and TypeMethodDescriptionReturns the static access key id.builder()Starts an empty builder (every field at its default).Returns the connect timeout (default 10 s).Optional<software.amazon.awssdk.auth.credentials.AwsCredentialsProvider> Returns the explicit AWS SDK credentials provider.endpoint()Returns the explicit endpoint override passed to the AWS SDK.Returns the STS external id.static AwsSecretsManagerConfigfromEnv()Reads the configuration from the process environment.static AwsSecretsManagerConfigReads the configuration from an explicit variable map (tests).headers()Returns the extra request headers.hooks()Returns the hooks.Returns the credential values that must never appear in messages or logs.logger()Returns the logger (silent by default).profile()Returns the shared config profile.proxy()Returns the explicit proxy URL.intReturns the recovery window of deletes in days (7–30, default 30).region()Returns the AWS region.Returns the per-attempt timeout (default 30 s).retry()Returns the retry policy; the AWS SDK standard retry strategy usesmaxRetries + 1attempts and the policy's backoff bounds.roleArn()Returns the IAM role assumed with STS on top of the base credentials.Returns the assumed-role session duration.Returns the STS role session name (default "grow-sdk").Optional<software.amazon.awssdk.services.secretsmanager.SecretsManagerClient> Returns the caller-supplied AWS SDK client.Returns the static secret access key.Returns the session token of temporary credentials.tls()Returns the TLS options.toString()Returns the total timeout per call including retries (default 120 s).url()Returns the effective endpoint: the override when set, otherwise the public AWS endpoint of the region (us-east-1when the region is left to the SDK).Returns the text appended to theUser-Agent.voidvalidate()Checks every rule: URL scheme, positive timeouts, TLS pairs, region format, credential pairs, exclusive options, role ARN and duration, recovery window.
-
Field Details
-
DEFAULT_RECOVERY_WINDOW_DAYS
public static final int DEFAULT_RECOVERY_WINDOW_DAYSDefault recovery window of deletes in days (the AWS default).- See Also:
-
DEFAULT_ROLE_SESSION_NAME
Default STS role session name of the assume-role helper.- See Also:
-
-
Method Details
-
builder
Starts an empty builder (every field at its default).- Returns:
- a new builder
-
fromEnv
Reads the configuration from the process environment.- Returns:
- the validated configuration
- Throws:
ConfigException- when a variable holds an invalid value (the message names the variable, never the value)
-
fromEnv
Reads the configuration from an explicit variable map (tests).- Parameters:
env- variable map- Returns:
- the validated configuration
-
validate
public void validate()Checks every rule: URL scheme, positive timeouts, TLS pairs, region format, credential pairs, exclusive options, role ARN and duration, recovery window.- Throws:
ConfigException- listing every violated rule
-
url
Returns the effective endpoint: the override when set, otherwise the public AWS endpoint of the region (us-east-1when the region is left to the SDK). Informational.- Returns:
- the URL
-
endpoint
Returns the explicit endpoint override passed to the AWS SDK.- Returns:
- the endpoint, or empty when the SDK resolves it
-
connectTimeout
Returns the connect timeout (default 10 s).- Returns:
- the timeout
-
requestTimeout
Returns the per-attempt timeout (default 30 s).- Returns:
- the timeout
-
totalTimeout
Returns the total timeout per call including retries (default 120 s).- Returns:
- the timeout
-
retry
Returns the retry policy; the AWS SDK standard retry strategy usesmaxRetries + 1attempts and the policy's backoff bounds.- Returns:
- the policy
-
tls
Returns the TLS options.- Returns:
- the options
-
proxy
Returns the explicit proxy URL.- Returns:
- the proxy, or empty
-
headers
Returns the extra request headers.- Returns:
- immutable map
-
userAgentSuffix
Returns the text appended to theUser-Agent.- Returns:
- the suffix, or empty
-
hooks
Returns the hooks.- Returns:
- the hooks
-
logger
Returns the logger (silent by default).- Returns:
- the logger
-
region
Returns the AWS region.- Returns:
- the region, or empty when the SDK chain (environment, shared config) decides
-
accessKeyId
Returns the static access key id.- Returns:
- the key id, or empty
-
secretAccessKey
Returns the static secret access key.- Returns:
- the key, or empty
-
sessionToken
Returns the session token of temporary credentials.- Returns:
- the token, or empty
-
profile
Returns the shared config profile.- Returns:
- the profile, or empty
-
credentials
Returns the explicit AWS SDK credentials provider.- Returns:
- the provider, or empty
-
roleArn
Returns the IAM role assumed with STS on top of the base credentials.- Returns:
- the role ARN, or empty
-
roleSessionName
Returns the STS role session name (default "grow-sdk").- Returns:
- the session name
-
externalId
Returns the STS external id.- Returns:
- the external id, or empty
-
roleDuration
Returns the assumed-role session duration.- Returns:
- the duration, or empty for the role's default
-
recoveryWindowDays
public int recoveryWindowDays()Returns the recovery window of deletes in days (7–30, default 30).- Returns:
- the window
-
sdkClient
Returns the caller-supplied AWS SDK client.- Returns:
- the client, or empty when the package builds its own
-
knownSecrets
Returns the credential values that must never appear in messages or logs.- Returns:
- the known secret values
-
toString
-