RAM / Paginator / ListPrincipals

ListPrincipals

class RAM.Paginator.ListPrincipals
paginator = client.get_paginator('list_principals')
paginate(**kwargs)

Creates an iterator that will paginate through responses from RAM.Client.list_principals().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    resourceOwner='SELF'|'OTHER-ACCOUNTS',
    resourceArn='string',
    principals=[
        'string',
    ],
    resourceType='string',
    resourceShareArns=[
        'string',
    ],
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters:
  • resourceOwner (string) –

    [REQUIRED]

    Specifies that you want to list information for only resource shares that match the following:

    • SELF – principals that your account is sharing resources with

    • OTHER-ACCOUNTS – principals that are sharing resources with your account

  • resourceArn (string) – Specifies that you want to list principal information for the resource share with the specified Amazon Resource Name (ARN).

  • principals (list) –

    Specifies that you want to list information for only the listed principals.

    You can include the following values:

    • An Amazon Web Services account ID, for example: 123456789012

    • An Amazon Resource Name (ARN) of an organization in Organizations, for example: organizations::123456789012:organization/o-exampleorgid

    • An ARN of an organizational unit (OU) in Organizations, for example: organizations::123456789012:ou/o-exampleorgid/ou-examplerootid-exampleouid123

    • An ARN of an IAM role, for example: iam::123456789012:role/rolename

    • An ARN of an IAM user, for example: iam::123456789012user/username

    • A service principal name, for example: service-id.amazonaws.com

    Note

    Not all resource types can be shared with IAM roles and users. For more information, see Sharing with IAM roles and users in the Resource Access Manager User Guide.

    • (string) –

  • resourceType (string) –

    Specifies that you want to list information for only principals associated with resource shares that include the specified resource type.

    For a list of valid values, query the ListResourceTypes operation.

  • resourceShareArns (list) –

    Specifies that you want to list information for only principals associated with the resource shares specified by a list the Amazon Resource Names (ARNs).

    • (string) –

  • 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

{
    'principals': [
        {
            'id': 'string',
            'resourceShareArn': 'string',
            'creationTime': datetime(2015, 1, 1),
            'lastUpdatedTime': datetime(2015, 1, 1),
            'external': True|False
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) –

    • principals (list) –

      An array of objects that contain the details about the principals.

      • (dict) –

        Describes a principal for use with Resource Access Manager.

        • id (string) –

          The ID of the principal that can be associated with a resource share.

        • resourceShareArn (string) –

          The Amazon Resource Name (ARN) of a resource share the principal is associated with.

        • creationTime (datetime) –

          The date and time when the principal was associated with the resource share.

        • lastUpdatedTime (datetime) –

          The date and time when the association between the resource share and the principal was last updated.

        • external (boolean) –

          Indicates the relationship between the Amazon Web Services account the principal belongs to and the account that owns the resource share:

          • True – The two accounts belong to same organization.

          • False – The two accounts do not belong to the same organization.

    • NextToken (string) –

      A token to resume pagination.