KMS / Paginator / ListGrants
ListGrants¶
- class KMS.Paginator.ListGrants¶
paginator = client.get_paginator('list_grants')
- paginate(**kwargs)¶
Creates an iterator that will paginate through responses from
KMS.Client.list_grants().See also: AWS API Documentation
Request Syntax
response_iterator = paginator.paginate( KeyId='string', GrantId='string', GranteePrincipal='string', GranteeServicePrincipal='string', PaginationConfig={ 'MaxItems': 123, 'PageSize': 123, 'StartingToken': 'string' } )
- Parameters:
KeyId (string) –
[REQUIRED]
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-1234567890abKey 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.
GrantId (string) – Returns only the grant with the specified grant ID. The grant ID uniquely identifies the grant.
GranteePrincipal (string) –
Returns only grants where the specified principal is the grantee principal for the grant.
You can specify either
GranteePrincipalorGranteeServicePrincipal, but not both.GranteeServicePrincipal (string) –
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
GranteePrincipalorGranteeServicePrincipal, but not both.PaginationConfig (dict) –
A dictionary that provides parameters to control pagination.
MaxItems (integer) –
The total number of items to return. If the total number of items available is more than the value specified in max-items then a
NextTokenwill be provided in the output that you can use to resume pagination.PageSize (integer) –
The size of each page.
StartingToken (string) –
A token to specify where to start paginating. This is the
NextTokenfrom a previous response.
- Return type:
dict
- Returns:
Response Syntax
{ 'Grants': [ { 'KeyId': 'string', 'GrantId': 'string', 'Name': 'string', 'CreationDate': datetime(2015, 1, 1), 'GranteePrincipal': 'string', 'RetiringPrincipal': 'string', 'IssuingAccount': 'string', 'Operations': [ 'Decrypt'|'Encrypt'|'GenerateDataKey'|'GenerateDataKeyWithoutPlaintext'|'ReEncryptFrom'|'ReEncryptTo'|'Sign'|'Verify'|'GetPublicKey'|'CreateGrant'|'RetireGrant'|'DescribeKey'|'GenerateDataKeyPair'|'GenerateDataKeyPairWithoutPlaintext'|'GenerateMac'|'VerifyMac'|'DeriveSharedSecret', ], 'Constraints': { 'EncryptionContextSubset': { 'string': 'string' }, 'EncryptionContextEquals': { 'string': 'string' }, 'SourceArn': 'string' }, 'GranteeServicePrincipal': 'string', 'RetiringServicePrincipal': 'string' }, ], 'Truncated': True|False, 'NextToken': 'string' }
Response Structure
(dict) –
Grants (list) –
A list of grants.
(dict) –
Contains information about a grant.
KeyId (string) –
The unique identifier for the KMS key to which the grant applies.
GrantId (string) –
The unique identifier for the grant.
Name (string) –
The friendly name that identifies the grant. If a name was provided in the CreateGrant request, that name is returned. Otherwise this value is null.
CreationDate (datetime) –
The date and time when the grant was created.
GranteePrincipal (string) –
The identity that gets the permissions in the grant.
When a grant is created with the
GranteePrincipalfield, theListGrantsresponse usually contains the user or role designated as the grantee principal in the grant. However, if the grantee principal is an Amazon Web Services service, theGranteePrincipalfield contains an Amazon Web Services service principal, which might correspond to several different grantee principals, such as an IAM user, IAM role, or Amazon Web Services account.RetiringPrincipal (string) –
The principal that can retire the grant.
IssuingAccount (string) –
The Amazon Web Services account under which the grant was issued.
Operations (list) –
The list of operations permitted by the grant.
(string) –
Constraints (dict) –
The constraints on the grant, such as encryption context pairs or a SourceArn, that restrict the subsequent operations the grant allows.
EncryptionContextSubset (dict) –
A list of key-value pairs that must be included in the encryption context of the cryptographic operation request. The grant allows the cryptographic operation only when the encryption context in the request includes the key-value pairs specified in this constraint, although it can include additional key-value pairs.
(string) –
(string) –
EncryptionContextEquals (dict) –
A list of key-value pairs that must match the encryption context in the cryptographic operation request. The grant allows the operation only when the encryption context in the request is the same as the encryption context specified in this constraint.
(string) –
(string) –
SourceArn (string) –
The Amazon Resource Name (ARN) of an Amazon Web Services resource on behalf of which the request is made. This is effectively the same as having the aws:SourceArn global condition key in the grant. The SourceArn constraint ensures that the principal can use the KMS key only when the request is made on behalf of the specified resource.
GranteeServicePrincipal (string) –
The Amazon Web Services service principal that gets the permissions in the grant.
RetiringServicePrincipal (string) –
The Amazon Web Services service principal that can retire the grant.
Truncated (boolean) –
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
NextMarkerelement in this response to theMarkerparameter in a subsequent request.NextToken (string) –
A token to resume pagination.