Skip to main content

DeleteAlias

Deletes an alias.

Description

The `DeleteAlias` operation removes the specified alias from the account and region. You cannot delete an alias that is being used by a KMS key. First, update the key to stop using the alias, then delete the alias.

note
  • Because an alias is not a property of a KMS key, you can delete and change the aliases of a KMS key without affecting the KMS key.
  • After you delete an alias, you cannot reuse it until the deletion is complete.
  • If you delete an alias that is the only alias for a KMS key, the KMS key is not affected, but it no longer has any aliases.

Request Syntax

Headers

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

Request Body

NameDescriptionRequiredType
AliasNameThe alias to delete. The name must begin with 'alias/' followed by the alias name, such as 'alias/ExampleAlias'.Yesstring
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.DeleteAlias
{ "AliasName": "alias/ExampleAlias" }
Values in italics indicate user input and should be replaced with actual values.

Examples

Example 1: Delete an alias

POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.DeleteAlias
{ "AliasName": "alias/ExampleAlias" }
Values in italics indicate user input and should be replaced with actual values.
HTTP/1.1 200 OK
Content-Type: application/x-amz-json-1.1
Values in italics indicate variable response values.

Response Elements

This operation returns no response data.

Special Errors

Error CodeDescription
DependencyTimeoutExceptionThe system timed out while trying to fulfill the request.
KMSInternalExceptionThe request was rejected because an internal error occurred.
KMSInvalidStateExceptionThe request was rejected because the state of the specified resource is not valid for this operation.
NotFoundExceptionThe request was rejected because the specified alias was not found.

Permissions

To use the `DeleteAlias` operation, you must have the following permissions:

  • `kms:DeleteAlias` on the alias
  • `kms:DeleteAlias` on the KMS key

Try It Out

Test DeleteAlias

Delete an alias for a KMS key.

Coming Soon

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