@@ -60,24 +60,6 @@ The endpoint to access your database cluster will be available as the `.clusterE
60
60
cluster .clusterEndpoint .socketAddress ; // "HOSTNAME:PORT"
61
61
```
62
62
63
- ## Rotating credentials
64
-
65
- When the master password is generated and stored in AWS Secrets Manager, it can be rotated automatically:
66
-
67
- ``` ts fixture=cluster
68
- cluster .addRotationSingleUser (); // Will rotate automatically after 30 days
69
- ```
70
-
71
- The multi user rotation scheme is also available:
72
-
73
- ``` ts fixture=cluster
74
- import * as secretsmanager from ' @aws-cdk/aws-secretsmanager' ;
75
-
76
- cluster .addRotationMultiUser (' MyUser' , {
77
- secret: secretsmanager .Secret .fromSecretNameV2 (this , ' Imported Secret' , ' my-secret' ),
78
- });
79
- ```
80
-
81
63
## Database Resources
82
64
83
65
This module allows for the creation of non-CloudFormation database resources such as users
@@ -273,3 +255,24 @@ call to `grant` but the user does not have the specified permission.
273
255
274
256
Note that this does not occur when duplicate privileges are granted within the same
275
257
application, as such privileges are de-duplicated before any SQL query is submitted.
258
+
259
+ ## Rotating credentials
260
+
261
+ When the master password is generated and stored in AWS Secrets Manager, it can be rotated automatically:
262
+
263
+ ``` ts fixture=cluster
264
+ cluster .addRotationSingleUser (); // Will rotate automatically after 30 days
265
+ ```
266
+
267
+ The multi user rotation scheme is also available:
268
+
269
+ ``` ts fixture=cluster
270
+
271
+ const user = new User (this , ' User' , {
272
+ cluster: cluster ,
273
+ databaseName: ' databaseName' ,
274
+ });
275
+ cluster .addRotationMultiUser (' MultiUserRotation' , {
276
+ secret: user .secret ,
277
+ });
278
+ ```
0 commit comments