Skip to main content

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

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

Request Body

NameDescriptionRequiredType
KeyIdLists only aliases that refer to the specified KMS key. The value can be the ID or ARN of a KMS key.Nostring
LimitUse 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.Nointeger
MarkerUse 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.Nostring

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

NameDescriptionRequiredType
AliasesA list of aliases.NoString
Aliases[].AliasArnThe Amazon Resource Name (ARN) of the alias.NoString
Aliases[].AliasNameThe name of the alias.NoString
Aliases[].CreationDateThe date and time that the alias was created.NoString
Aliases[].LastUpdatedDateThe date and time that the alias was last updated.NoString
Aliases[].TargetKeyIdThe ID of the KMS key that the alias refers to.NoString
NextMarkerWhen Truncated is true, this value is present and contains the value to use for the Marker parameter in a subsequent request.NoString
TruncatedA 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.NoString

Special Errors

Error CodeDescription
DependencyTimeoutExceptionThe system timed out while trying to fulfill the request.
InvalidArnExceptionThe request was rejected because a specified ARN was not valid.
InvalidMarkerExceptionThe request was rejected because the marker that specifies where pagination should next begin is not valid.
KMSInternalExceptionAn internal error occurred.
NotFoundExceptionThe 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.