describe_iam_instance_profile_associations

EC2.Client.describe_iam_instance_profile_associations(**kwargs)

Describes your IAM instance profile associations.

See also: AWS API Documentation

Request Syntax

response = client.describe_iam_instance_profile_associations(
    AssociationIds=[
        'string',
    ],
    Filters=[
        {
            'Name': 'string',
            'Values': [
                'string',
            ]
        },
    ],
    MaxResults=123,
    NextToken='string'
)
Parameters
  • AssociationIds (list) --

    The IAM instance profile associations.

    • (string) --
  • Filters (list) --

    The filters.

    • instance-id - The ID of the instance.
    • state - The state of the association ( associating | associated | disassociating ).
    • (dict) --

      A filter name and value pair that is used to return a more specific list of results from a describe operation. Filters can be used to match a set of resources by specific criteria, such as tags, attributes, or IDs.

      If you specify multiple filters, the filters are joined with an AND , and the request returns only results that match all of the specified filters.

      • Name (string) --

        The name of the filter. Filter names are case-sensitive.

      • Values (list) --

        The filter values. Filter values are case-sensitive. If you specify multiple values for a filter, the values are joined with an OR , and the request returns all results that match any of the specified values.

        • (string) --
  • MaxResults (integer) -- The maximum number of items to return for this request. To get the next page of items, make another request with the token returned in the output. For more information, see Pagination.
  • NextToken (string) -- The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
Return type

dict

Returns

Response Syntax

{
    'IamInstanceProfileAssociations': [
        {
            'AssociationId': 'string',
            'InstanceId': 'string',
            'IamInstanceProfile': {
                'Arn': 'string',
                'Id': 'string'
            },
            'State': 'associating'|'associated'|'disassociating'|'disassociated',
            'Timestamp': datetime(2015, 1, 1)
        },
    ],
    'NextToken': 'string'
}

Response Structure

  • (dict) --

    • IamInstanceProfileAssociations (list) --

      Information about the IAM instance profile associations.

      • (dict) --

        Describes an association between an IAM instance profile and an instance.

        • AssociationId (string) --

          The ID of the association.

        • InstanceId (string) --

          The ID of the instance.

        • IamInstanceProfile (dict) --

          The IAM instance profile.

          • Arn (string) --

            The Amazon Resource Name (ARN) of the instance profile.

          • Id (string) --

            The ID of the instance profile.

        • State (string) --

          The state of the association.

        • Timestamp (datetime) --

          The time the IAM instance profile was associated with the instance.

    • NextToken (string) --

      The token to include in another request to get the next page of items. This value is null when there are no more items to return.

Examples

This example describes the specified IAM instance profile association.

response = client.describe_iam_instance_profile_associations(
    AssociationIds=[
        'iip-assoc-0db249b1f25fa24b8',
    ],
)

print(response)

Expected Output:

{
    'IamInstanceProfileAssociations': [
        {
            'AssociationId': 'iip-assoc-0db249b1f25fa24b8',
            'IamInstanceProfile': {
                'Arn': 'arn:aws:iam::123456789012:instance-profile/admin-role',
                'Id': 'AIPAJVQN4F5WVLGCJDRGM',
            },
            'InstanceId': 'i-09eb09efa73ec1dee',
            'State': 'associated',
        },
    ],
    'ResponseMetadata': {
        '...': '...',
    },
}