Skip to content
v2.274.0

DatabaseSecretProps Struct ​

Construction properties for a DatabaseSecret.

Example ​

ts
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 ​

encryptionKeyoptionalIKeyencryption_keyoptionalIKeyencryptionKeyoptionalIKeyEncryptionKeyoptionalIKeyEncryptionKeyoptionalIKey#
The KMS key to use to encrypt the secret.

Default: default master key

excludeCharactersoptionalstringexclude_charactersoptionalstrexcludeCharactersoptionalStringExcludeCharactersoptionalstringExcludeCharactersoptional*string= "\"@/"#
Characters to not include in the generated password.
masterSecretoptionalISecretmaster_secretoptionalISecretmasterSecretoptionalISecretMasterSecretoptionalISecretMasterSecretoptionalISecret#
The master secret which will be used to rotate this secret.

Default: no master secret information will be included

secretNameoptionalstringsecret_nameoptionalstrsecretNameoptionalStringSecretNameoptionalstringSecretNameoptional*string#
The physical name of the secret.

Default: Secretsmanager will generate a physical name for the secret

usernamestringusernamestrusernameStringUsernamestringUsername*stringrequired#
The username.