Creates an alias for a customer master key (CMK).

Usage notes:

  • 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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateAlias

The operation that you want to perform. Set the value to CreateAlias.

KeyId String Yes 7906979c-8e06-46a2-be2d-68e3ccbc****

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

AliasName String Yes alias/example

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.

Response parameters

Parameter Type Example Description
RequestId String 1d2baaf3-d357-46c2-832e-13560c2bd9cd

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

Examples

Sample requests

http(s)://[Endpoint]/?Action=CreateAlias
&KeyId=7906979c-8e06-46a2-be2d-68e3ccbc****
&AliasName=alias/example
&<Common request parameters>

Sample success responses

XML format

HTTP/1.1 200 OK
Content-Type:application/xml

<CreateAliasResponse>
    <RequestId>1d2baaf3-d357-46c2-832e-13560c2bd9cd</RequestId>
</CreateAliasResponse>

JSON format

HTTP/1.1 200 OK
Content-Type:application/json

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

Error codes

For a list of error codes, visit the API Error Center.