You can create a dynamic ApsaraDB RDS secret that is automatically rotated on a regular basis. This reduces the risks of ApsaraDB RDS secret leaks. This topic describes how to create, delete, and restore a dynamic ApsaraDB RDS secret in the Key Management Service (KMS) console.
Prerequisites
- An ApsaraDB RDS instance is created. For more information, see Create an ApsaraDB RDS for MySQL instance.
- If you use a RAM user or a RAM role to manage secrets, you must attach the system
policy AliyunKMSSecretAdminAccess to the RAM user or the RAM role. This policy grants the following permissions:
- The permissions to use the features of Secrets Manager.
- The permissions to query ApsaraDB RDS instances and manage accounts.
- The permissions to create the service-linked role that can create managed ApsaraDB RDS secrets.
Create a dynamic ApsaraDB RDS secret
Delete a dynamic ApsaraDB RDS secret
Before you delete a dynamic ApsaraDB RDS secret, make sure that the dynamic ApsaraDB RDS secret is no longer used.
You can schedule the deletion of a dynamic ApsaraDB RDS secret or immediately delete a dynamic ApsaraDB RDS secret.
- Find the dynamic ApsaraDB RDS secret that you want to delete and choose Actions column. in the
- In the Delete Secret dialog box, select a method to delete the secret and click OK.
- If you select Plan Deletion Secret, you must configure the Delete In (7-30 days) parameter. Then, the system deletes the secret after the specified number of days.
Before the system deletes the secret, you can restore the secret to cancel deletion. For more information, see Restore a dynamic ApsaraDB RDS secret.
- If you select Delete Secret Immediately, the system immediately deletes the secret.
- If you select Plan Deletion Secret, you must configure the Delete In (7-30 days) parameter. Then, the system deletes the secret after the specified number of days.
Restore a dynamic ApsaraDB RDS secret
If you schedule a dynamic ApsaraDB RDS secret to be deleted, you can restore the secret to cancel deletion before the system deletes the secret. After the dynamic ApsaraDB RDS secret is restored, it can be used as normal.
- Find the dynamic ApsaraDB RDS secret that you want to restore and choose Actions column. in the
- In the Restore Secret message, click OK.