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',
    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-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.

  • 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.

  • 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 NextToken will 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 NextToken from 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',
            ],
            'Constraints': {
                'EncryptionContextSubset': {
                    'string': 'string'
                },
                'EncryptionContextEquals': {
                    'string': '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.

          The GranteePrincipal field in the ListGrants response usually contains the user or role designated as the grantee principal in the grant. However, when the grantee principal in the grant is an Amazon Web Services service, the GranteePrincipal field contains the service principal, which might represent several different grantee principals.

        • 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) –

          A list of key-value pairs that must be present in the encryption context of certain subsequent operations that 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) –

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

    • NextToken (string) –

      A token to resume pagination.