v1

latestOpenAPI 3.0.0Apache 2.0 License2026-07-1450214444.9 KB

Gets the names of the key policies that are attached to a KMS key. This operation is designed to get policy names that you can use in a GetKeyPolicy operation. However, the only valid policy name is default.

Cross-account use: No. You cannot perform this operation on a KMS key in a different Amazon Web Services account.

Required permissions: kms:ListKeyPolicies (key policy)

Related operations:

  • GetKeyPolicy

  • PutKeyPolicy

post/#X-Amz-Target=TrentService.ListKeyPolicies

Query parameters

Limitstring

Pagination limit

Markerstring

Pagination token

Headers

X-Amz-Target'TrentService.ListKeyPolicies' required

Request body

KeyIdstring required
<p>Gets the names of key policies for the specified KMS key.</p> <p>Specify the key ID or key ARN of the KMS key.</p> <p>For example:</p> <ul> <li> <p>Key ID: <code>1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> <li> <p>Key ARN: <code>arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab</code> </p> </li> </ul> <p>To get the key ID and key ARN for a KMS key, use <a>ListKeys</a> or <a>DescribeKey</a>.</p>
Limitinteger
<p>Use this parameter to specify the maximum number of items to return. When this value is present, KMS does not return more than the specified number of items, but it might return fewer.</p> <p>This value is optional. If you include a value, it must be between 1 and 1000, inclusive. If you do not include a value, it defaults to 100.</p> <p>Only one policy can be attached to a key.</p>
Markerstring

Use this parameter in a subsequent request after you receive a response with truncated results. Set it to the value of <code>NextMarker</code> from the truncated response you just received.

Response

Success

PolicyNamesPolicyNameType[]

A list of key policy names. The only valid value is <code>default</code>.

NextMarkerstring

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

Truncatedboolean

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 <code>NextMarker</code> element in thisresponse to the <code>Marker</code> parameter in a subsequent request.

Example response

{
  "PolicyNames": [
    "default"
  ],
  "Truncated": false
}