Skip to main content

UpdateAlias

Associates an existing alias with a different KMS key.

Description

The UpdateAlias operation associates an existing alias with a different KMS key. Each alias is associated with only one KMS key at a time, although a KMS key can have multiple aliases.

note
  • The alias and the target KMS key must be in the same account and region.
  • You cannot use this operation to change the alias name.
  • The current and new target KMS key must be the same type (both symmetric or both asymmetric).
  • The current and new target KMS key must have the same key usage.
  • The alias name must begin with alias/.

Request Syntax

Headers

NameDescriptionRequiredType
Content-TypeMust be "application/x-amz-json-1.1"Yesstring
X-Amz-TargetMust be "TrentService.UpdateAlias"Yesstring

Request Body

NameDescriptionRequiredType
AliasNameThe name of the alias to update. The alias name must begin with `alias/`.Yesstring
TargetKeyIdThe identifier of the KMS key that the alias will be associated with. This can be the key ID or key ARN of the KMS key.Yesstring
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.UpdateAlias
{ "AliasName": "alias/test", "TargetKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab" }
Values in italics indicate user input and should be replaced with actual values.

Response Elements

This operation returns no response data.

Special Errors

Error CodeDescription
DependencyTimeoutExceptionThe system timed out while trying to fulfill the request.
KMSInternalExceptionAn internal error occurred.
KMSInvalidStateExceptionThe request was rejected because the key state is not valid for this operation.
LimitExceededExceptionThe request was rejected because a quota was exceeded.
NotFoundExceptionThe request was rejected because the specified entity or resource could not be found.

Permissions

To use the UpdateAlias operation, you must have the following permissions:

  • kms:UpdateAlias on the alias (specified in the policy)
  • kms:UpdateAlias on the current KMS key (specified in the policy)
  • kms:UpdateAlias on the new target KMS key (specified in the policy)

Try It Out

Test UpdateAlias

Update an alias to point to a different KMS key.

Coming Soon

This feature is currently under development and will be available soon.