RotationMultiUserOptions

class aws_cdk.aws_docdb.RotationMultiUserOptions(*, secret, automatically_after=None)

Bases: object

Options to add the multi user rotation.

Parameters:
  • secret (ISecret) – The secret to rotate. It must be a JSON string with the following format:: { “engine”: <required: must be set to ‘mongo’>, “host”: <required: instance host name>, “username”: <required: username>, “password”: <required: password>, “dbname”: <optional: database name>, “port”: <optional: if not specified, default port 27017 will be used>, “masterarn”: <required: the arn of the master secret which will be used to create users/change passwords> “ssl”: <optional: if not specified, defaults to false. This must be true if being used for DocumentDB rotations where the cluster has TLS enabled> }

  • automatically_after (Optional[Duration]) – Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation. Default: Duration.days(30)

ExampleMetadata:

infused

Example:

import aws_cdk.aws_secretsmanager as secretsmanager

# my_imported_secret: secretsmanager.Secret
# cluster: docdb.DatabaseCluster


cluster.add_rotation_multi_user("MyUser",
    secret=my_imported_secret
)

Attributes

automatically_after

Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.

Default:

Duration.days(30)

secret

The secret to rotate.

It must be a JSON string with the following format:

{
   "engine": <required: must be set to 'mongo'>,
   "host": <required: instance host name>,
   "username": <required: username>,
   "password": <required: password>,
   "dbname": <optional: database name>,
   "port": <optional: if not specified, default port 27017 will be used>,
   "masterarn": <required: the arn of the master secret which will be used to create users/change passwords>
   "ssl": <optional: if not specified, defaults to false. This must be true if being used for DocumentDB rotations
          where the cluster has TLS enabled>
}