Interface SecretStringGenerator
- All Superinterfaces:
software.amazon.jsii.JsiiSerializable
- All Known Implementing Classes:
SecretStringGenerator.Jsii$Proxy
@Generated(value="jsii-pacmak/1.84.0 (build 5404dcf)",
date="2023-06-19T16:30:41.314Z")
@Stability(Stable)
public interface SecretStringGenerator
extends software.amazon.jsii.JsiiSerializable
Configuration to generate secrets such as passwords automatically.
Example:
// Default secret Secret secret = new Secret(this, "Secret"); // Using the default secret // Using the default secret User.Builder.create(this, "User") .password(secret.getSecretValue()) .build(); // Templated secret Secret templatedSecret = Secret.Builder.create(this, "TemplatedSecret") .generateSecretString(SecretStringGenerator.builder() .secretStringTemplate(JSON.stringify(Map.of("username", "user"))) .generateStringKey("password") .build()) .build(); // Using the templated secret // Using the templated secret User.Builder.create(this, "OtherUser") .userName(templatedSecret.secretValueFromJson("username").toString()) .password(templatedSecret.secretValueFromJson("password")) .build();
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final class
A builder forSecretStringGenerator
static final class
An implementation forSecretStringGenerator
-
Method Summary
Modifier and TypeMethodDescriptionbuilder()
default String
A string that includes characters that shouldn't be included in the generated password.default Boolean
Specifies that the generated password shouldn't include lowercase letters.default Boolean
Specifies that the generated password shouldn't include digits.default Boolean
Specifies that the generated password shouldn't include punctuation characters.default Boolean
Specifies that the generated password shouldn't include uppercase letters.default String
The JSON key name that's used to add the generated password to the JSON structure specified by thesecretStringTemplate
parameter.default Boolean
Specifies that the generated password can include the space character.default Number
The desired length of the generated password.default Boolean
Specifies whether the generated password must include at least one of every allowed character type.default String
A properly structured JSON string that the generated password can be added to.Methods inherited from interface software.amazon.jsii.JsiiSerializable
$jsii$toJson
-
Method Details
-
getExcludeCharacters
A string that includes characters that shouldn't be included in the generated password.The string can be a minimum of
0
and a maximum of4096
characters long.Default: no exclusions
-
getExcludeLowercase
Specifies that the generated password shouldn't include lowercase letters.Default: false
-
getExcludeNumbers
Specifies that the generated password shouldn't include digits.Default: false
-
getExcludePunctuation
Specifies that the generated password shouldn't include punctuation characters.Default: false
-
getExcludeUppercase
Specifies that the generated password shouldn't include uppercase letters.Default: false
-
getGenerateStringKey
The JSON key name that's used to add the generated password to the JSON structure specified by thesecretStringTemplate
parameter.If you specify
generateStringKey
thensecretStringTemplate
must be also be specified. -
getIncludeSpace
Specifies that the generated password can include the space character.Default: false
-
getPasswordLength
The desired length of the generated password.Default: 32
-
getRequireEachIncludedType
Specifies whether the generated password must include at least one of every allowed character type.Default: true
-
getSecretStringTemplate
A properly structured JSON string that the generated password can be added to.The
generateStringKey
is combined with the generated random string and inserted into the JSON structure that's specified by this parameter. The merged JSON string is returned as the completed SecretString of the secret. If you specifysecretStringTemplate
thengenerateStringKey
must be also be specified. -
builder
- Returns:
- a
SecretStringGenerator.Builder
ofSecretStringGenerator
-