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
Name | Description | Required | Type |
---|---|---|---|
Content-Type | Must be "application/x-amz-json-1.1" | Yes | string |
X-Amz-Target | Must be "TrentService.UpdateAlias" | Yes | string |
Request Body
Name | Description | Required | Type |
---|---|---|---|
AliasName | The name of the alias to update. The alias name must begin with `alias/`. | Yes | string |
TargetKeyId | The 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. | Yes | string |
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 Code | Description |
---|---|
DependencyTimeoutException | The system timed out while trying to fulfill the request. |
KMSInternalException | An internal error occurred. |
KMSInvalidStateException | The request was rejected because the key state is not valid for this operation. |
LimitExceededException | The request was rejected because a quota was exceeded. |
NotFoundException | The 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.