aws-cdk-lib.aws_docdb.DatabaseSecretProps

interface DatabaseSecretProps

LanguageType name
.NETAmazon.CDK.AWS.DocDB.DatabaseSecretProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awsdocdb#DatabaseSecretProps
Javasoftware.amazon.awscdk.services.docdb.DatabaseSecretProps
Pythonaws_cdk.aws_docdb.DatabaseSecretProps
TypeScript (source)aws-cdk-lib » aws_docdb » DatabaseSecretProps

Construction properties for a DatabaseSecret.

Example

declare const cluster: docdb.DatabaseCluster;
const myUserSecret = new docdb.DatabaseSecret(this, 'MyUserSecret', {
  username: 'myuser',
  masterSecret: cluster.secret,
});
const myUserSecretAttached = myUserSecret.attach(cluster); // Adds DB connections information in the secret

cluster.addRotationMultiUser('MyUser', { // Add rotation using the multi user scheme
  secret: myUserSecretAttached, // This secret must have the `masterarn` key
});

Properties

NameTypeDescription
usernamestringThe username.
encryptionKey?IKeyThe KMS key to use to encrypt the secret.
excludeCharacters?stringCharacters to not include in the generated password.
masterSecret?ISecretThe master secret which will be used to rotate this secret.
secretName?stringThe physical name of the secret.

username

Type: string

The username.


encryptionKey?

Type: IKey (optional, default: default master key)

The KMS key to use to encrypt the secret.


excludeCharacters?

Type: string (optional, default: ""@/")

Characters to not include in the generated password.


masterSecret?

Type: ISecret (optional, default: no master secret information will be included)

The master secret which will be used to rotate this secret.


secretName?

Type: string (optional, default: Secretsmanager will generate a physical name for the secret)

The physical name of the secret.