KMSClient.list_grants
rboto-kms==0.4.0 · Service index · Types
Model summary (excerpt): Gets a list of all grants for the specified KMS key. You must specify the KMS key in all requests. You can filter the grant list by grant ID, grantee principal, or grantee service principal. For detailed information about grants, including grant terminology, see Grants in KMS in the Key Management Service Developer Guide . For examples of creating grants in several programming languages, see...
Install and imports
Signature
async def list_grants(
*,
key_id: str,
limit: int | None = None,
marker: str | None = None,
grant_id: str | None = None,
grantee_principal: str | None = None,
grantee_service_principal: str | None = None,
) -> ListGrantsOutput: ...
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 | Returns only grants for the specified KMS key. This parameter is required. Specify the key ID or key ARN of the KMS key. To specify a KMS key in a different Amazon Web Services account, you must use the key ARN. 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... |
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 100, inclusive. If you do not include a value, it defaults to 50. |
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. |
grant_id |
No | Returns only the grant with the specified grant ID. The grant ID uniquely identifies the grant. |
grantee_principal |
No | Returns only grants where the specified principal is the grantee principal for the grant. You can specify either GranteePrincipal or GranteeServicePrincipal , but not both. |
grantee_service_principal |
No | Returns only grants where the specified Amazon Web Services service principal is the grantee service principal for the grant. This filter is only usable by callers in a service principal. You can specify either GranteePrincipal or GranteeServicePrincipal , but not both. |
Output
ListGrantsOutput.
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 |
|---|---|---|---|
grants |
list[GrantListEntryOutput] | None |
Always present | GrantListEntryOutput |
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.
Related types
Follow these links for nested inputs and outputs; recursive types link back to the same type page.
Pagination and streaming
client.paginators.list_grants(...) accepts the same arguments and returns AsyncIterator[ListGrantsOutput]. 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, InvalidGrantIdError, InvalidMarkerError, KMSInternalError, KMSInvalidStateError, NotFoundError.
Other service failures use the service base error; credential, transport and timeout failures use shared errors.