RAM / Client / get_resource_share_associations

get_resource_share_associations#

RAM.Client.get_resource_share_associations(**kwargs)#

Retrieves the resource and principal associations for resource shares that you own.

See also: AWS API Documentation

Request Syntax

response = client.get_resource_share_associations(
    associationType='PRINCIPAL'|'RESOURCE',
    resourceShareArns=[
        'string',
    ],
    resourceArn='string',
    principal='string',
    associationStatus='ASSOCIATING'|'ASSOCIATED'|'FAILED'|'DISASSOCIATING'|'DISASSOCIATED',
    nextToken='string',
    maxResults=123
)
Parameters:
  • associationType (string) –

    [REQUIRED]

    Specifies whether you want to retrieve the associations that involve a specified resource or principal.

    • PRINCIPAL – list the principals that are associated with the specified resource share.

    • RESOURCE – list the resources that are associated with the specified resource share.

  • resourceShareArns (list) –

    Specifies a list of Amazon Resource Names (ARNs) of the resource share whose associations you want to retrieve.

    • (string) –

  • resourceArn (string) –

    Specifies the Amazon Resoure Name (ARN) of the resource whose resource shares you want to retrieve.

    You cannot specify this parameter if the association type is PRINCIPAL.

  • principal (string) –

    Specifies the ID of the principal whose resource shares you want to retrieve. This can be an Amazon Web Services account ID, an organization ID, an organizational unit ID, or the Amazon Resoure Name (ARN) of an individual IAM user or role.

    You cannot specify this parameter if the association type is RESOURCE.

  • associationStatus (string) – Specifies that you want to retrieve only associations with this status.

  • nextToken (string) – Specifies that you want to receive the next page of results. Valid only if you received a NextToken response in the previous request. If you did, it indicates that more output is available. Set this parameter to the value provided by the previous call’s NextToken response to request the next page of results.

  • maxResults (integer) – Specifies the total number of results that you want included on each page of the response. If you do not include this parameter, it defaults to a value that is specific to the operation. If additional items exist beyond the number you specify, the NextToken response element is returned with a value (not null). Include the specified value as the NextToken request parameter in the next call to the operation to get the next part of the results. Note that the service might return fewer results than the maximum even when there are more results available. You should check NextToken after every operation to ensure that you receive all of the results.

Return type:

dict

Returns:

Response Syntax

{
    'resourceShareAssociations': [
        {
            'resourceShareArn': 'string',
            'resourceShareName': 'string',
            'associatedEntity': 'string',
            'associationType': 'PRINCIPAL'|'RESOURCE',
            'status': 'ASSOCIATING'|'ASSOCIATED'|'FAILED'|'DISASSOCIATING'|'DISASSOCIATED',
            'statusMessage': 'string',
            'creationTime': datetime(2015, 1, 1),
            'lastUpdatedTime': datetime(2015, 1, 1),
            'external': True|False
        },
    ],
    'nextToken': 'string'
}

Response Structure

  • (dict) –

    • resourceShareAssociations (list) –

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

      • (dict) –

        Describes an association with a resource share and either a principal or a resource.

        • resourceShareArn (string) –

          The Amazon Resoure Name (ARN) of the resource share.

        • resourceShareName (string) –

          The name of the resource share.

        • associatedEntity (string) –

          The associated entity. This can be either of the following:

          • For a resource association, this is the Amazon Resoure Name (ARN) of the resource.

          • For principal associations, this is one of the following:

            • The ID of an Amazon Web Services account

            • The Amazon Resoure Name (ARN) of an organization in Organizations

            • The ARN of an organizational unit (OU) in Organizations

            • The ARN of an IAM role

            • The ARN of an IAM user

        • associationType (string) –

          The type of entity included in this association.

        • status (string) –

          The current status of the association.

        • statusMessage (string) –

          A message about the status of the association.

        • creationTime (datetime) –

          The date and time when the association was created.

        • lastUpdatedTime (datetime) –

          The date and time when the association was last updated.

        • external (boolean) –

          Indicates whether the principal belongs to the same organization in Organizations as the Amazon Web Services account that owns the resource share.

    • nextToken (string) –

      If present, this value indicates that more output is available than is included in the current response. Use this value in the NextToken request parameter in a subsequent call to the operation to get the next part of the output. You should repeat this until the NextToken response element comes back as null. This indicates that this is the last page of results.

Exceptions

  • RAM.Client.exceptions.UnknownResourceException

  • RAM.Client.exceptions.MalformedArnException

  • RAM.Client.exceptions.InvalidNextTokenException

  • RAM.Client.exceptions.InvalidParameterException

  • RAM.Client.exceptions.OperationNotPermittedException

  • RAM.Client.exceptions.ServerInternalException

  • RAM.Client.exceptions.ServiceUnavailableException