Skip to content

KMSClient.list_key_policies

rboto-kms==0.4.0 · Service index · Types

Model summary (excerpt): 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. The valid policy names are default and AWS_RAM . For information about the AWS_RAM key policy, see Sharing KMS keys with RAM in the Key Management Service Developer Guide . Cross-account use : No. You cannot perform this operation on a...

Install and imports

python -m pip install "rboto[kms]==0.4.0"
from rboto import KMSClient
from rboto_kms.types import (
    ListKeyPoliciesOutput,
)

Signature

async def list_key_policies(
    *,
    key_id: str,
    limit: int | None = None,
    marker: str | None = None,
) -> ListKeyPoliciesOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
key_id Yes Gets the names of key policies for the specified KMS key. Specify the key ID or key ARN of the KMS key. For example: Key ID: 1234abcd-12ab-34cd-56ef-1234567890ab Key ARN: arn:aws:kms:us-east-2:111122223333:key/1234abcd-12ab-34cd-56ef-1234567890ab To get the key ID and key ARN for a KMS key, use ListKeys or DescribeKey .
limit No 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. 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. A KMS key can have at most two key policies, default and AWS_RAM .
marker No 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.

Output

ListKeyPoliciesOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
policy_names list[str] | None Always present —
next_marker str | None Always present —
truncated bool Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

ListKeyPoliciesOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

client.paginators.list_key_policies(...) accepts the same arguments and returns AsyncIterator[ListKeyPoliciesOutput]. Direct calls return one page. Pages preserve the Output representation above.

Input cursors: marker. Page-size argument: limit.

No output stream.

Errors

Import from rboto_kms.exceptions:

DependencyTimeoutError, InvalidArnError, KMSInternalError, KMSInvalidStateError, NotFoundError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model