Skip to main content

image_usage_report_entries

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

Overview

Nameimage_usage_report_entries
TypeResource
Idaws.ec2.image_usage_report_entries

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
account_idstringThe ID of the account that uses the image.
image_idstringThe ID of the image.
report_creation_timestringThe date and time the report creation was initiated.
report_idstringThe ID of the report.
resource_typestringThe type of resource (ec2:Instance or ec2:LaunchTemplate).
usage_countintegerThe number of times resources of this type reference this image in the account.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
describe_image_usage_report_entriesselectregionImageId, ReportId, NextToken, Filter, DryRun, MaxResultsDescribes the entries in image usage reports, showing how your images are used across other Amazon Web Services accounts. For more information, see View your AMI usage 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
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.
FilterarrayThe filters. account-id - A 12-digit Amazon Web Services account ID. creation-time - The time when the report was created, in the ISO 8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example, 2025-11-29T11:04:43.305Z. You can use a wildcard (), for example, 2025-11-29T, which matches an entire day. resource-type - The resource type (ec2:Instance | ec2:LaunchTemplate).
ImageIdarrayThe IDs of the images for filtering the report entries. If specified, only report entries containing these images are returned.
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.
ReportIdarrayThe IDs of the usage reports.

SELECT examples

Describes the entries in image usage reports, showing how your images are used across other Amazon Web Services accounts. For more information, see View your AMI usage in the Amazon EC2 User Guide.

SELECT
account_id,
image_id,
report_creation_time,
report_id,
resource_type,
usage_count
FROM aws.ec2.image_usage_report_entries
WHERE region = '{{ region }}' -- required
AND ImageId = '{{ ImageId }}'
AND ReportId = '{{ ReportId }}'
AND NextToken = '{{ NextToken }}'
AND Filter = '{{ Filter }}'
AND DryRun = '{{ DryRun }}'
AND MaxResults = '{{ MaxResults }}'
;