All Products
Search
Document Center

Key Management Service:CreateAlias

Last Updated:Aug 28, 2026

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

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

No authorization for this operation. If you encounter issues with this operation, contact technical support.

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/. The alias cannot be prefixed with the reserved word alias/acs.

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.