Creates an alias for a customer master key (CMK). You can then use the alias in place of the key ID.
Operation description
-
Each alias can be bound to only one CMK at a time.
-
The aliases of CMKs in the same region must be unique.
The following example creates an alias named alias/example for the CMK 7906979c-8e06-46a2-be2d-68e3ccbc****.
For the access policy that a RAM user or RAM role needs to call this operation, 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. |
7906979c-8e06-46a2-be2d-68e3ccbc**** |
| AliasName |
string |
Yes |
The alias of the CMK. The alias must be 1 to 255 characters in length and must contain the prefix |
alias/example |
Response elements
|
Element |
Type |
Description |
Example |
|
object |
|||
| RequestId |
string |
The request ID. |
1d2baaf3-d357-46c2-832e-13560c2bd9cd |
Examples
Success response
JSON format
{
"RequestId": "1d2baaf3-d357-46c2-832e-13560c2bd9cd"
}
Error codes
|
HTTP status code |
Error code |
Error message |
Description |
|---|---|---|---|
| 400 | InvalidParameter | The specified parameter is not valid. | An invalid value is specified for the parameter. |
| 404 | InvalidAccessKeyId.NotFound | The Access Key ID provided does not exist in our records. | |
| 404 | Forbidden.KeyNotFound | The specified Key is not found. | The specified CMK does not exist. |
See Error Codes for a complete list.
Release notes
See Release Notes for a complete list.