All Products
Search
Document Center

Key Management Service:CreateAlias

Last Updated:Jul 29, 2025

Creates an alias for a key.

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.

In this topic, an alias named alias/example is created for a CMK named 7906979c-8e06-46a2-be2d-68e3ccbc****.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

There is currently no authorization information disclosed in the API.

Request parameters

ParameterTypeRequiredDescriptionExample
KeyIdstringYes

The ID of the CMK. The ID must be globally unique.

7906979c-8e06-46a2-be2d-68e3ccbc****
AliasNamestringYes

The alias of the CMK.

The alias must be 1 to 255 characters in length and must contain the prefix alias/. The alias cannot be prefixed with the reserved word alias/acs.

alias/example

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The ID of the request, which is used to locate and troubleshoot issues.

1d2baaf3-d357-46c2-832e-13560c2bd9cd

Examples

Sample success responses

JSONformat

{
  "RequestId": "1d2baaf3-d357-46c2-832e-13560c2bd9cd"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidParameterThe specified parameter is not valid.An invalid value is specified for the parameter.
404InvalidAccessKeyId.NotFoundThe Access Key ID provided does not exist in our records.-
404Forbidden.KeyNotFoundThe specified Key is not found.The error message returned because the specified CMK does not exist.

For a list of error codes, visit the Service error codes.