ListAliases
Gets a list of all aliases in the caller's account and region.
Description
The ListAliases
operation gets a list of all aliases in the caller's account and region. You can optionally filter the list to only aliases that are associated with a particular KMS key.
note
- The response might include multiple grants for the same KMS key.
- An alias name can contain only alphanumeric characters, forward slashes (/), underscores (_), and dashes (-).
- The alias must start with the word "alias/" followed by the alias name.
Request Syntax
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.ListAliases
{
"KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab",
"Limit": 20,
"Marker": "eyJlbmNyeXB0ZWREYXRhIjpbMTIsMzQsNTYsNzgsOTBdfQ=="
}
Values in italics indicate user input and should be replaced with actual values.
Request Parameters
Headers
Name | Description | Required | Type |
---|---|---|---|
Content-Type | Must be "application/x-amz-json-1.1" | Yes | string |
X-Amz-Target | Must be "TrentService.ListAliases" | Yes | string |
Request Body
Name | Description | Required | Type |
---|---|---|---|
KeyId | Lists only aliases that refer to the specified KMS key. The value can be the ID or ARN of a KMS key. | No | string |
Limit | Use this parameter to specify the maximum number of items to return. When this value is present, QKMS does not return more than the specified number of items, but it might return fewer. | No | integer |
Marker | Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of NextMarker from the truncated response you just received. | No | string |
Examples
Example 1: List all aliases in the account and region
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.ListAliases
{}
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
{
"Aliases": [
{
"AliasArn": "arn:verenc:111122223333:alias/test-key",
"AliasName": "alias/test-key",
"CreationDate": 1668815672,
"LastUpdatedDate": 1668815672,
"TargetKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
}
],
"Truncated": false
}
Values in italics indicate variable response values.
Example 2: List aliases for a specific KMS key
POST / HTTP/1.1
Content-Type: application/x-amz-json-1.1
X-Amz-Target: TrentService.ListAliases
{
"KeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
}
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
{
"Aliases": [
{
"AliasArn": "arn:verenc:111122223333:alias/test-key",
"AliasName": "alias/test-key",
"CreationDate": 1668815672,
"LastUpdatedDate": 1668815672,
"TargetKeyId": "1234abcd-12ab-34cd-56ef-1234567890ab"
}
],
"Truncated": false
}
Values in italics indicate variable response values.
Response Syntax
HTTP/1.1 200 OK
Content-Type: application/x-amz-json-1.1
{
"Aliases": [
{
"AliasArn": "string",
"AliasName": "string",
"CreationDate": "number",
"LastUpdatedDate": "number",
"TargetKeyId": "string"
}
],
"NextMarker": "string",
"Truncated": "boolean"
}
Values in italics indicate variable response values.
Response Elements
Name | Description | Required | Type |
---|---|---|---|
Aliases | A list of aliases. | No | String |
Aliases[].AliasArn | The Amazon Resource Name (ARN) of the alias. | No | String |
Aliases[].AliasName | The name of the alias. | No | String |
Aliases[].CreationDate | The date and time that the alias was created. | No | String |
Aliases[].LastUpdatedDate | The date and time that the alias was last updated. | No | String |
Aliases[].TargetKeyId | The ID of the KMS key that the alias refers to. | No | String |
NextMarker | When Truncated is true, this value is present and contains the value to use for the Marker parameter in a subsequent request. | No | String |
Truncated | A flag that indicates whether there are more items in the list. When this value is true, the list in this response is truncated. To get more items, pass the value of the NextMarker element in subsequent requests. | No | String |
Special Errors
Error Code | Description |
---|---|
DependencyTimeoutException | The system timed out while trying to fulfill the request. |
InvalidArnException | The request was rejected because a specified ARN was not valid. |
InvalidMarkerException | The request was rejected because the marker that specifies where pagination should next begin is not valid. |
KMSInternalException | An internal error occurred. |
NotFoundException | The request was rejected because the specified entity or resource could not be found. |
Permissions
To use the ListAliases
operation, you must have the following permissions:
kms:ListAliases
on the KMS key (specified in the policy)
Try It Out
Test ListAliases
List aliases in your account and region.
Coming Soon
This feature is currently under development and will be available soon.