CreateAlias#

Description#

Creates an alias associated with a KMS key. You can use the alias to identify the KMS key in DescribeKey and cryptographic operations.

Request Parameters#

  • AliasName — The alias name.

    • Type: String

    • Required: Yes

    • Constraints: Cannot start with alias/aws/ or alias/cloud/

    • Length constraints: From 1 to 256 characters

    • Pattern: ^alias/[a-zA-Z0-9/_-]+$

  • TargetKeyId — The ID of the KMS key to associate the alias with.

    • Type: String

    • Required: Yes

Response Elements#

Response body is absent.

Examples#

Sample Request#

POST / HTTP/1.1
Host: kms.<region>.<domain>
Content-Length: <PayloadSizeBytes>
Content-Type: application/x-amz-json-1.1
Authorization: AWS4-HMAC-SHA256 Credential=<Credential>, SignedHeaders=<Headers>, Signature=<Signature>
X-Amz-Date: <Date>
X-Amz-Target: TrentService.CreateAlias

{
    "AliasName": "alias/example",
    "TargetKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
}

Sample Response#

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