

# Delete an alias
<a name="alias-delete"></a>

You can delete an alias in the Amazon KMS console or by using the [DeleteAlias](https://docs.amazonaws.cn/kms/latest/APIReference/API_DeleteAlias.html) operation. Before deleting an alias, make sure that it's not in use. Although deleting an alias doesn't affect the associated KMS key, it might create problems for any application that uses the alias. If you delete an alias by mistake, you can create a new alias with the same name and associate it with the same or a different KMS key.

If you delete a KMS key, all aliases associated with that KMS key are deleted.

## Using the Amazon KMS console
<a name="alias-delete-console"></a>

To delete an alias in the Amazon KMS console, use the **Aliases** tab on the detail page for the KMS key. You can delete multiple aliases for a KMS key at one time.

1. Sign in to the Amazon Web Services Management Console and open the Amazon Key Management Service (Amazon KMS) console at [https://console.amazonaws.cn/kms](https://console.amazonaws.cn/kms).

1. To change the Amazon Web Services Region, use the Region selector in the upper-right corner of the page.

1. In the navigation pane, choose **Customer managed keys**. You cannot manage aliases for Amazon managed keys or Amazon owned keys.

1. In the table, choose the key ID or alias of the KMS key. Then, on the KMS key detail page, choose the **Aliases** tab.

   If a KMS key has multiple aliases, the **Aliases** column in the table displays one alias and an alias summary, such as **(\+*n* more)**. Choosing the alias summary takes you directly to the **Aliases** tab on the KMS key detail page.

1. On the **Aliases** tab, select the check box next to the aliases that you want to delete. Then choose **Delete**.

## Using the Amazon KMS API
<a name="alias-delete-api"></a>

To delete an alias, use the [DeleteAlias](https://docs.amazonaws.cn/kms/latest/APIReference/API_DeleteAlias.html) operation. This operation deletes one alias at a time. The alias name is case-sensitive and it must be preceded by the `alias/` prefix.

For example, the following command deletes the `test-key` alias. This command does not return any output. 

```
$ aws kms delete-alias --alias-name alias/test-key
```

To verify that the alias is deleted, use the [ListAliases](https://docs.amazonaws.cn/kms/latest/APIReference/API_ListAliases.html) operation. The following command uses the `--query` parameter in the Amazon CLI to get only the `test-key` alias. The empty brackets in the response indicate that the `ListAliases` response didn't include a `test-key` alias. To eliminate the brackets, use the `--output text` parameter and value.

```
$ aws kms list-aliases --query 'Aliases[?AliasName==`alias/test-key`]'
[]
```