Overview
The key rotation feature involves three APIs:
API | API Description | Note |
GetKeyRotationStatus | View key rotation status | The KeyId is a required parameter for this API operation. For more details, please refer to the GetKeyRotationStatus interface documentation. |
Enable Key Rotation | Enable Key Rotation | The KeyId is a required parameter for this API operation. For more details, please refer to the EnableKeyRotation interface documentation. |
Disable Key Rotation | Disable Key Rotation | The KeyId is a required parameter for this API operation. For more details, please refer to the DisableKeyRotation interface documentation. |
This example uses Tencent Cloud's Command Line Tool TCCLI. You can use any supported programming language for subsequent calls.
Sample
View Key Rotation Status Example
Input
tccli kms GetKeyRotationStatus --region ap-guangzhou --KeyId 5xxxxx-xxxx-xxxx-xxxx-52xxxxx4
Output
If the API is called successfully, the key rotation status of the CMK will be returned.
{"KeyRotationEnabled": false,"RequestId": "e1432224-4dc2-48da-a8e8-e84d30afd9ef"}
Enable Key Rotation Example
Input
tccli kms EnableKeyRotation --region ap-guangzhou --KeyId 5xxxxx-xxxx-xxxx-xxxx-52xxxxx4
Output
If the feature is disabled normally, the request information as shown below will be returned.
{"RequestId": "4e0fa96f-e86e-4517-af27-3dfe6e5b2a72"}
Disable Key Rotation Example
Input
tccli kms DisableKeyRotation --region ap-guangzhou --KeyId 5xxxxx-xxxx-xxxx-xxxx-52xxxxx4
Output
If the feature is disabled normally, the request information as shown below will be returned.
{"RequestId": "c8b73c8b-1ee5-4b23-b800-7cccc58e7ffb"}