EC2 / Paginator / DescribeImageReferences

DescribeImageReferences

class EC2.Paginator.DescribeImageReferences
paginator = client.get_paginator('describe_image_references')
paginate(**kwargs)

Creates an iterator that will paginate through responses from EC2.Client.describe_image_references().

See also: AWS API Documentation

Request Syntax

response_iterator = paginator.paginate(
    ImageIds=[
        'string',
    ],
    IncludeAllResourceTypes=True|False,
    ResourceTypes=[
        {
            'ResourceType': 'ec2:Instance'|'ec2:LaunchTemplate'|'ssm:Parameter'|'imagebuilder:ImageRecipe'|'imagebuilder:ContainerRecipe',
            'ResourceTypeOptions': [
                {
                    'OptionName': 'state-name'|'version-depth',
                    'OptionValues': [
                        'string',
                    ]
                },
            ]
        },
    ],
    DryRun=True|False,
    PaginationConfig={
        'MaxItems': 123,
        'PageSize': 123,
        'StartingToken': 'string'
    }
)
Parameters:
  • ImageIds (list) –

    [REQUIRED]

    The IDs of the images to check for resource references.

    • (string) –

  • IncludeAllResourceTypes (boolean) –

    Specifies whether to check all supported Amazon Web Services resource types for image references. When specified, default values are applied for ResourceTypeOptions. For the default values, see How AMI reference checks work in the Amazon EC2 User Guide. If you also specify ResourceTypes with ResourceTypeOptions, your specified values override the default values.

    Supported resource types: ec2:Instance | ec2:LaunchTemplate | ssm:Parameter | imagebuilder:ImageRecipe | imagebuilder:ContainerRecipe

    Either IncludeAllResourceTypes or ResourceTypes must be specified.

  • ResourceTypes (list) –

    The Amazon Web Services resource types to check for image references.

    Either IncludeAllResourceTypes or ResourceTypes must be specified.

    • (dict) –

      A resource type to check for image references. Associated options can also be specified if the resource type is an EC2 instance or launch template.

      • ResourceType (string) –

        The resource type.

      • ResourceTypeOptions (list) –

        The options that affect the scope of the response. Valid only when ResourceType is ec2:Instance or ec2:LaunchTemplate.

        • (dict) –

          The options that affect the scope of the response.

          • OptionName (string) –

            The name of the option.

            • For ec2:Instance: Specify state-name - The current state of the EC2 instance.

            • For ec2:LaunchTemplate: Specify version-depth - The number of launch template versions to check, starting from the most recent version.

          • OptionValues (list) –

            A value for the specified option.

            • For state-name:

              • Valid values: pending | running | shutting-down | terminated | stopping | stopped

              • Default: All states

            • For version-depth:

              • Valid values: Integers between 1 and 10000

              • Default: 10

            • (string) –

  • DryRun (boolean) – Checks whether you have the required permissions for the action, without actually making the request, and provides an error response. If you have the required permissions, the error response is DryRunOperation. Otherwise, it is UnauthorizedOperation.

  • 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

{
    'ImageReferences': [
        {
            'ImageId': 'string',
            'ResourceType': 'ec2:Instance'|'ec2:LaunchTemplate'|'ssm:Parameter'|'imagebuilder:ImageRecipe'|'imagebuilder:ContainerRecipe',
            'Arn': 'string'
        },
    ]
}

Response Structure

  • (dict) –

    • ImageReferences (list) –

      The resources that are referencing the specified images.

      • (dict) –

        A resource that is referencing an image.

        • ImageId (string) –

          The ID of the referenced image.

        • ResourceType (string) –

          The type of resource referencing the image.

        • Arn (string) –

          The Amazon Resource Name (ARN) of the resource referencing the image.