RotationMultiUserOptions Struct
Options to add the multi user rotation.
| Source | aws-docdb/lib/props.ts |
|---|
Example
ts
import * as secretsmanager from 'aws-cdk-lib/aws-secretsmanager';
declare const myImportedSecret: secretsmanager.Secret;
declare const cluster: docdb.DatabaseCluster;
cluster.addRotationMultiUser('MyUser', {
secret: myImportedSecret, // This secret must have the `masterarn` key
});
python
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
)
java
import software.amazon.awscdk.services.secretsmanager.*;
Secret myImportedSecret;
DatabaseCluster cluster;
cluster.addRotationMultiUser("MyUser", RotationMultiUserOptions.builder()
.secret(myImportedSecret)
.build());
csharp
// Install: dotnet add package Amazon.CDK.Lib
using Amazon.CDK.AWS.SecretsManager;
Secret myImportedSecret;
DatabaseCluster cluster;
cluster.AddRotationMultiUser("MyUser", new RotationMultiUserOptions {
Secret = myImportedSecret
});
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
import secretsmanager "github.com/aws/aws-cdk-go/awscdk"
var myImportedSecret Secret
var cluster DatabaseCluster
cluster.AddRotationMultiUser(jsii.String("MyUser"), &RotationMultiUserOptions{
Secret: myImportedSecret,
})
Properties
automaticallyAfteroptionalDurationautomatically_afteroptionalDurationautomaticallyAfteroptionalDurationAutomaticallyAfteroptionalDurationAutomaticallyAfteroptionalDuration = Duration.days(30) #Specifies the number of days after the previous rotation before Secrets Manager triggers the next automatic rotation.
The secret to rotate.
notes
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>
}