Menu
AWS Key Management Service
API Reference (API Version 2014-11-01)

ListAliases

Gets a list of all aliases in the caller's AWS account and region. You cannot list aliases in other accounts. For more information about aliases, see CreateAlias.

The response might include several aliases that do not have a TargetKeyId field because they are not associated with a CMK. These are predefined aliases that are reserved for CMKs managed by AWS services. If an alias is not associated with a CMK, the alias does not count against the alias limit for your account.

Request Syntax

Copy
{ "Limit": number, "Marker": "string" }

Request Parameters

For information about the parameters that are common to all actions, see Common Parameters.

The request accepts the following data in JSON format.

Note

In the following list, the required parameters are described first.

Limit

Use this parameter to specify the maximum number of items to return. When this value is present, AWS KMS does not return more than the specified number of items, but it might return fewer.

This value is optional. If you include a value, it must be between 1 and 100, inclusive. If you do not include a value, it defaults to 50.

Type: Integer

Valid Range: Minimum value of 1. Maximum value of 100.

Required: No

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.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 320.

Pattern: [\u0020-\u00FF]*

Required: No

Response Syntax

Copy
{ "Aliases": [ { "AliasArn": "string", "AliasName": "string", "TargetKeyId": "string" } ], "NextMarker": "string", "Truncated": boolean }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

Aliases

A list of aliases.

Type: Array of AliasListEntry objects

NextMarker

When Truncated is true, this element is present and contains the value to use for the Marker parameter in a subsequent request.

Type: String

Length Constraints: Minimum length of 1. Maximum length of 320.

Pattern: [\u0020-\u00FF]*

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 this response to the Marker parameter in a subsequent request.

Type: Boolean

Errors

For information about the errors that are common to all actions, see Common Errors.

DependencyTimeoutException

The system timed out while trying to fulfill the request. The request can be retried.

HTTP Status Code: 500

InvalidMarkerException

The request was rejected because the marker that specifies where pagination should next begin is not valid.

HTTP Status Code: 400

KMSInternalException

The request was rejected because an internal exception occurred. The request can be retried.

HTTP Status Code: 400

Examples

The following examples are formatted for legibility.

Example Request

Copy
POST / HTTP/1.1 Host: kms.us-east-2.amazonaws.com Content-Length: 2 X-Amz-Target: TrentService.ListAliases X-Amz-Date: 20161203T011453Z Content-Type: application/x-amz-json-1.1 Authorization: AWS4-HMAC-SHA256\ Credential=AKIAI44QH8DHBEXAMPLE/20161203/us-east-2/kms/aws4_request,\ SignedHeaders=content-type;host;x-amz-date;x-amz-target,\ Signature=c2867e5f45167bf713e8f2c9998772ad72a20958db2cc0ef46bfba1632ca4d62 {}

Example Response

Copy
HTTP/1.1 200 OK Server: Server Date: Sat, 03 Dec 2016 01:14:55 GMT Content-Type: application/x-amz-json-1.1 Content-Length: 2874 Connection: keep-alive x-amzn-RequestId: e6196175-b8f5-11e6-b404-15dcd0a7add5 { "Aliases": [ { "AliasArn": "arn:aws:kms:us-east-2:111122223333:alias/aws/acm", "AliasName": "alias/aws/acm", "TargetKeyId": "da03f6f7-d279-427a-9cae-de48d07e5b66" }, { "AliasArn": "arn:aws:kms:us-east-2:111122223333:alias/aws/ebs", "AliasName": "alias/aws/ebs", "TargetKeyId": "25a217e7-7170-4b8c-8bf6-045ea5f70e5b" }, { "AliasArn": "arn:aws:kms:us-east-2:111122223333:alias/aws/rds", "AliasName": "alias/aws/rds", "TargetKeyId": "7ec3104e-c3f2-4b5c-bf42-bfc4772c6685" }, { "AliasArn": "arn:aws:kms:us-east-2:111122223333:alias/aws/redshift", "AliasName": "alias/aws/redshift", "TargetKeyId": "08f7a25a-69e2-4fb5-8f10-393db27326fa" }, { "AliasArn": "arn:aws:kms:us-east-2:111122223333:alias/aws/s3", "AliasName": "alias/aws/s3", "TargetKeyId": "d2b0f1a3-580d-4f79-b836-bc983be8cfa5" }, { "AliasArn": "arn:aws:kms:us-east-2:111122223333:alias/example1", "AliasName": "alias/example1", "TargetKeyId": "4da1e216-62d0-46c5-a7c0-5f3a3d2f8046" }, { "AliasArn": "arn:aws:kms:us-east-2:111122223333:alias/example2", "AliasName": "alias/example2", "TargetKeyId": "f32fef59-2cc2-445b-8573-2d73328acbee" }, { "AliasArn": "arn:aws:kms:us-east-2:111122223333:alias/example3", "AliasName": "alias/example3", "TargetKeyId": "1374ef38-d34e-4d5f-b2c9-4e0daee38855" } ], "Truncated": false }

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following: