Login

class aws_cdk.aws_docdb.Login(*, username, exclude_characters=None, kms_key=None, password=None, secret_name=None)

Bases: object

Login credentials for a database cluster.

Parameters
  • username (str) – Username.

  • exclude_characters (Optional[str]) – Specifies characters to not include in generated passwords. Default: “”

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

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

  • secret_name (Optional[str]) – The physical name of the secret, that will be generated. Default: Secretsmanager will generate a physical name for the secret

ExampleMetadata

infused

Example:

# vpc: ec2.Vpc

cluster = docdb.DatabaseCluster(self, "Database",
    master_user=docdb.Login(
        username="myuser",  # NOTE: 'admin' is reserved by DocumentDB
        exclude_characters=""@/:",  # optional, defaults to the set ""@/" and is also used for eventually created rotations
        secret_name="/myapp/mydocdb/masteruser"
    ),
    instance_type=ec2.InstanceType.of(ec2.InstanceClass.R5, ec2.InstanceSize.LARGE),
    vpc_subnets=ec2.SubnetSelection(
        subnet_type=ec2.SubnetType.PUBLIC
    ),
    vpc=vpc
)

Attributes

exclude_characters

Specifies characters to not include in generated passwords.

Default

“”

:: /”

Return type

Optional[str]

kms_key

KMS encryption key to encrypt the generated secret.

Default

default master key

Return type

Optional[IKey]

password

Password.

Do not put passwords in your CDK code directly.

Default

a Secrets Manager generated password

Return type

Optional[SecretValue]

secret_name

The physical name of the secret, that will be generated.

Default

Secretsmanager will generate a physical name for the secret

Return type

Optional[str]

username

Username.

Return type

str