Show / Hide Table of Contents

Interface ISecretStringGenerator

Configuration to generate secrets such as passwords automatically.

Namespace: Amazon.CDK.AWS.SecretsManager
Assembly: Amazon.CDK.AWS.SecretsManager.dll
Syntax (csharp)
public interface ISecretStringGenerator
Syntax (vb)
Public Interface ISecretStringGenerator
Remarks

ExampleMetadata: infused

Examples
// Default secret
var secret = new Secret(this, "Secret");
// Using the default secret
// Using the default secret
new User(this, "User", new UserProps {
    Password = secret.SecretValue
});
// Templated secret
var templatedSecret = new Secret(this, "TemplatedSecret", new SecretProps {
    GenerateSecretString = new SecretStringGenerator {
        SecretStringTemplate = JSON.Stringify(new Dictionary<string, string> { { "username", "user" } }),
        GenerateStringKey = "password"
    }
});
// Using the templated secret
// Using the templated secret
new User(this, "OtherUser", new UserProps {
    UserName = templatedSecret.SecretValueFromJson("username").ToString(),
    Password = templatedSecret.SecretValueFromJson("password")
});

Synopsis

Properties

ExcludeCharacters

A string that includes characters that shouldn't be included in the generated password.

ExcludeLowercase

Specifies that the generated password shouldn't include lowercase letters.

ExcludeNumbers

Specifies that the generated password shouldn't include digits.

ExcludePunctuation

Specifies that the generated password shouldn't include punctuation characters.

ExcludeUppercase

Specifies that the generated password shouldn't include uppercase letters.

GenerateStringKey

The JSON key name that's used to add the generated password to the JSON structure specified by the secretStringTemplate parameter.

IncludeSpace

Specifies that the generated password can include the space character.

PasswordLength

The desired length of the generated password.

RequireEachIncludedType

Specifies whether the generated password must include at least one of every allowed character type.

SecretStringTemplate

A properly structured JSON string that the generated password can be added to.

Properties

ExcludeCharacters

A string that includes characters that shouldn't be included in the generated password.

virtual string ExcludeCharacters { get; }
Property Value

System.String

Remarks

The string can be a minimum of 0 and a maximum of 4096 characters long.

Default: no exclusions

ExcludeLowercase

Specifies that the generated password shouldn't include lowercase letters.

virtual Nullable<bool> ExcludeLowercase { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: false

ExcludeNumbers

Specifies that the generated password shouldn't include digits.

virtual Nullable<bool> ExcludeNumbers { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: false

ExcludePunctuation

Specifies that the generated password shouldn't include punctuation characters.

virtual Nullable<bool> ExcludePunctuation { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: false

ExcludeUppercase

Specifies that the generated password shouldn't include uppercase letters.

virtual Nullable<bool> ExcludeUppercase { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: false

GenerateStringKey

The JSON key name that's used to add the generated password to the JSON structure specified by the secretStringTemplate parameter.

virtual string GenerateStringKey { get; }
Property Value

System.String

Remarks

If you specify generateStringKey then secretStringTemplate must be also be specified.

IncludeSpace

Specifies that the generated password can include the space character.

virtual Nullable<bool> IncludeSpace { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: false

PasswordLength

The desired length of the generated password.

virtual Nullable<double> PasswordLength { get; }
Property Value

System.Nullable<System.Double>

Remarks

Default: 32

RequireEachIncludedType

Specifies whether the generated password must include at least one of every allowed character type.

virtual Nullable<bool> RequireEachIncludedType { get; }
Property Value

System.Nullable<System.Boolean>

Remarks

Default: true

SecretStringTemplate

A properly structured JSON string that the generated password can be added to.

virtual string SecretStringTemplate { get; }
Property Value

System.String

Remarks

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 specify secretStringTemplate then generateStringKey must be also be specified.

Back to top Generated by DocFX