Skip to main content

image_references

Creates, updates, deletes, gets or lists an image_references resource.

Overview

Nameimage_references
TypeResource
Idaws.ec2.image_references

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
arnstringThe Amazon Resource Name (ARN) of the resource referencing the image.
image_idstringThe ID of the referenced image.
resource_typestringThe type of resource referencing the image.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_image_referencesselectImageId, regionIncludeAllResourceTypes, ResourceType, NextToken, DryRun, MaxResultsDescribes your Amazon Web Services resources that are referencing the specified images. For more information, see Identify your resources referencing specified AMIs in the Amazon EC2 User Guide.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
ImageIdarrayThe IDs of the images to check for resource references.
regionstringAWS region (default: us-east-1)
DryRunbooleanChecks 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.
IncludeAllResourceTypesbooleanSpecifies 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.
MaxResultsintegerThe 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.
NextTokenstringThe token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
ResourceTypearrayThe Amazon Web Services resource types to check for image references. Either IncludeAllResourceTypes or ResourceTypes must be specified.

SELECT examples

Describes your Amazon Web Services resources that are referencing the specified images. For more information, see Identify your resources referencing specified AMIs in the Amazon EC2 User Guide.

SELECT
arn,
image_id,
resource_type
FROM aws.ec2.image_references
WHERE ImageId = '{{ ImageId }}' -- required
AND region = '{{ region }}' -- required
AND IncludeAllResourceTypes = '{{ IncludeAllResourceTypes }}'
AND ResourceType = '{{ ResourceType }}'
AND NextToken = '{{ NextToken }}'
AND DryRun = '{{ DryRun }}'
AND MaxResults = '{{ MaxResults }}'
;