Creates a version for a customer master key (CMK).
Operation description
-
You can create a version only for an asymmetric CMK that is in the Enabled state. You can call the CreateKey operation to create an asymmetric CMK and the DescribeKey operation to query the status of the CMK. The status is specified by the KeyState parameter.
-
The minimum interval for creating a version of the same CMK is seven days. You can call the DescribeKey operation to query the time when the last version of a CMK was created. The time is specified by the LastRotationDate parameter.
-
If a CMK is in a private key store, you cannot create a version for the CMK.
-
You can create a maximum of 50 versions for a CMK in the same region.
You can create a version for the CMK whose ID is 0b30658a-ed1a-4922-b8f7-a673ca9c**** by using the parameter settings provided in this topic.
For more information about the access policy required by a RAM user or RAM role to call this API, see Resource Access Management.
Try it now
Test
RAM authorization
Request parameters
|
Parameter |
Type |
Required |
Description |
Example |
| KeyId |
string |
Yes |
The ID of the CMK. The ID must be globally unique. Note
You can also set the value to an alias that is bound to the CMK. For more information, see Overview of aliases. |
0b30658a-ed1a-4922-b8f7-a673ca9c**** |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
b96f250a-4b75-498c-91be-22c6928f85be |
| KeyVersion |
object |
The metadata of the version. |
|
| KeyId |
string |
The ID of the CMK. The ID must be globally unique. |
0b30658a-ed1a-4922-b8f7-a673ca9c**** |
| KeyVersionId |
string |
The ID of the version. |
c0a3d5dc-0b47-4199-a050-b289349a**** |
| CreationDate |
string |
The date and time when the version was created. The time is displayed in UTC. |
2019-08-02T10:38:27Z |
Examples
Success response
JSON format
{
"RequestId": "b96f250a-4b75-498c-91be-22c6928f85be",
"KeyVersion": {
"KeyId": "0b30658a-ed1a-4922-b8f7-a673ca9c****",
"KeyVersionId": "c0a3d5dc-0b47-4199-a050-b289349a****",
"CreationDate": "2019-08-02T10:38:27Z"
}
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | Rejected.UnsupportedOperation | Unsupported operation. | The operation is not supported. |
| 404 | Forbidden.AliasNotFound | The specified Alias is not found. | The error message returned because the specified alias does not exist. |
| 404 | Forbidden.KeyNotFound | The specified Key is not found. | The error message returned because the specified CMK does not exist. |
| 409 | Rejected.Disabled | The request was rejected because the key state is Disabled. | The request was rejected because the key state is Disabled. |
| 409 | Rejected.Unavailable | The request was rejected because the key state is Unavailable. | The request was denied because the key status is unavailable. |
| 409 | Rejected.PendingDeletion | The request was rejected because the key state is PendingDeletion. | The request was rejected because the key state is PendingDeletion. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.