# DatabaseSecretProps

Construction properties for a DatabaseSecret.

Extends: DatabaseSecretProps
Used as props by: DatabaseSecret

- Source: [`aws-docdb/lib/database-secret.ts`](https://github.com/aws/aws-cdk/blob/v2.275.0/packages/aws-cdk-lib/aws-docdb/lib/database-secret.ts#L12)
- Type last changed: v2.72.0 · 29 Mar 2023

## 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

- `encryptionKey`: [IKey](/cdk/api/v2/docs/aws-cdk-lib.aws_kms.IKey.html) — The KMS key to use to encrypt the secret.

  **Default:** default master key

- `excludeCharacters`: string = "\"@/" — Characters to not include in the generated password.

- `masterSecret`: [ISecret](/cdk/api/v2/docs/aws-cdk-lib.aws_secretsmanager.ISecret.html) — The master secret which will be used to rotate this secret.

  **Default:** no master secret information will be included

- `secretName`: string — The physical name of the secret.

  **Default:** Secretsmanager will generate a physical name for the secret

- `username`: string (required) — The username.
