CredentialsFromUsernameOptions

class aws_cdk.aws_rds.CredentialsFromUsernameOptions(*, encryption_key=None, exclude_characters=None, replica_regions=None, secret_name=None, password=None)

Bases: CredentialsBaseOptions

Options for creating Credentials from a username.

Parameters:
  • encryption_key (Optional[IKey]) – KMS encryption key to encrypt the generated secret. Default: - default master key

  • exclude_characters (Optional[str]) – The characters to exclude from the generated password. Has no effect if {@link password} has been provided. Default: - the DatabaseSecret default exclude character set (” %+~`#$&*()|[]{}:;<>?!’/

  • replica_regions (Optional[Sequence[Union[ReplicaRegion, Dict[str, Any]]]]) – A list of regions where to replicate this secret. Default: - Secret is not replicated

  • secret_name (Optional[str]) – The name of the secret. Default: - A name is generated by CloudFormation.

  • password (Optional[SecretValue]) – Password. Do not put passwords in your CDK code directly. Default: - a Secrets Manager generated password

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_kms as kms
import aws_cdk.aws_rds as rds
import aws_cdk.core as cdk

# key: kms.Key
# secret_value: cdk.SecretValue

credentials_from_username_options = rds.CredentialsFromUsernameOptions(
    encryption_key=key,
    exclude_characters="excludeCharacters",
    password=secret_value,
    replica_regions=[ReplicaRegion(
        region="region",

        # the properties below are optional
        encryption_key=key
    )],
    secret_name="secretName"
)

Attributes

encryption_key

KMS encryption key to encrypt the generated secret.

Default:
  • default master key

exclude_characters

The characters to exclude from the generated password.

Has no effect if {@link password} has been provided.

Default:
  • the DatabaseSecret default exclude character set (” %+~`#$&*()|[]{}:;<>?!’/

:: “")

password

Password.

Do not put passwords in your CDK code directly.

Default:
  • a Secrets Manager generated password

replica_regions

A list of regions where to replicate this secret.

Default:
  • Secret is not replicated

secret_name

The name of the secret.

Default:
  • A name is generated by CloudFormation.