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
Name | Description | Required | Type |
---|---|---|---|
Content-Type | Must be "application/x-amz-json-1.1" | Yes | string |
X-Amz-Target | Must be "TrentService.DeleteAlias" | Yes | string |
Request Body
Name | Description | Required | Type |
---|---|---|---|
AliasName | The alias to delete. The name must begin with 'alias/' followed by the alias name, such as 'alias/ExampleAlias'. | Yes | string |
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 Code | Description |
---|---|
DependencyTimeoutException | The system timed out while trying to fulfill the request. |
KMSInternalException | The request was rejected because an internal error occurred. |
KMSInvalidStateException | The request was rejected because the state of the specified resource is not valid for this operation. |
NotFoundException | The 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.