SecretStringGenerator

class aws_cdk.aws_secretsmanager.SecretStringGenerator(*, exclude_characters=None, exclude_lowercase=None, exclude_numbers=None, exclude_punctuation=None, exclude_uppercase=None, generate_string_key=None, include_space=None, password_length=None, require_each_included_type=None, secret_string_template=None)

Bases: object

Configuration to generate secrets such as passwords automatically.

Parameters
  • exclude_characters (Optional[str]) – 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 of 4096 characters long. Default: no exclusions

  • exclude_lowercase (Optional[bool]) – Specifies that the generated password shouldn’t include lowercase letters. Default: false

  • exclude_numbers (Optional[bool]) – Specifies that the generated password shouldn’t include digits. Default: false

  • exclude_punctuation (Optional[bool]) – Specifies that the generated password shouldn’t include punctuation characters. Default: false

  • exclude_uppercase (Optional[bool]) – Specifies that the generated password shouldn’t include uppercase letters. Default: false

  • generate_string_key (Optional[str]) – The JSON key name that’s used to add the generated password to the JSON structure specified by the secretStringTemplate parameter. If you specify generateStringKey then secretStringTemplate must be also be specified.

  • include_space (Optional[bool]) – Specifies that the generated password can include the space character. Default: false

  • password_length (Union[int, float, None]) – The desired length of the generated password. Default: 32

  • require_each_included_type (Optional[bool]) – Specifies whether the generated password must include at least one of every allowed character type. Default: true

  • secret_string_template (Optional[str]) – 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 specify secretStringTemplate then generateStringKey must be also be specified.

Attributes

exclude_characters

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 of 4096 characters long.

Default

no exclusions

Return type

Optional[str]

exclude_lowercase

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

Default

false

Return type

Optional[bool]

exclude_numbers

Specifies that the generated password shouldn’t include digits.

Default

false

Return type

Optional[bool]

exclude_punctuation

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

Default

false

Return type

Optional[bool]

exclude_uppercase

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

Default

false

Return type

Optional[bool]

generate_string_key

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

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

Return type

Optional[str]

include_space

Specifies that the generated password can include the space character.

Default

false

Return type

Optional[bool]

password_length

The desired length of the generated password.

Default

32

Return type

Union[int, float, None]

require_each_included_type

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

Default

true

Return type

Optional[bool]

secret_string_template

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

Return type

Optional[str]