EC2 / Client / describe_image_usage_reports
describe_image_usage_reports¶
- EC2.Client.describe_image_usage_reports(**kwargs)¶
Describes the configuration and status of image usage reports, filtered by report IDs or image IDs.
For more information, see View your AMI usage in the Amazon EC2 User Guide.
See also: AWS API Documentation
Request Syntax
response = client.describe_image_usage_reports( ImageIds=[ 'string', ], ReportIds=[ 'string', ], NextToken='string', Filters=[ { 'Name': 'string', 'Values': [ 'string', ] }, ], DryRun=True|False, MaxResults=123 )
- Parameters:
ImageIds (list) –
The IDs of the images for filtering the reports. If specified, only reports containing these images are returned.
(string) –
ReportIds (list) –
The IDs of the image usage reports.
(string) –
NextToken (string) – The token returned from a previous paginated request. Pagination continues from the end of the items returned by the previous request.
Filters (list) –
The filters.
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.state
- The state of the report (available
|pending
|error
).
(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.For more information, see List and filter using the CLI and API in the Amazon EC2 User Guide.
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) –
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 isUnauthorizedOperation
.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.
- Return type:
dict
- Returns:
Response Syntax
{ 'NextToken': 'string', 'ImageUsageReports': [ { 'ImageId': 'string', 'ReportId': 'string', 'ResourceTypes': [ { 'ResourceType': 'string', 'ResourceTypeOptions': [ { 'OptionName': 'string', 'OptionValues': [ 'string', ] }, ] }, ], 'AccountIds': [ 'string', ], 'State': 'string', 'StateReason': 'string', 'CreationTime': datetime(2015, 1, 1), 'ExpirationTime': datetime(2015, 1, 1), 'Tags': [ { 'Key': 'string', 'Value': 'string' }, ] }, ] }
Response Structure
(dict) –
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.ImageUsageReports (list) –
The image usage reports.
(dict) –
The configuration and status of an image usage report.
ImageId (string) –
The ID of the image that was specified when the report was created.
ReportId (string) –
The ID of the report.
ResourceTypes (list) –
The resource types that were specified when the report was created.
(dict) –
A resource type to include in the report. Associated options can also be specified if the resource type is a launch template.
ResourceType (string) –
The resource type.
Valid values:
ec2:Instance
|ec2:LaunchTemplate
ResourceTypeOptions (list) –
The options that affect the scope of the report. Valid only when
ResourceType
isec2:LaunchTemplate
.(dict) –
The options that affect the scope of the report.
OptionName (string) –
The name of the option.
OptionValues (list) –
The number of launch template versions to check.
(string) –
AccountIds (list) –
The IDs of the Amazon Web Services accounts that were specified when the report was created.
(string) –
State (string) –
The current state of the report. Possible values:
available
- The report is available to view.pending
- The report is being created and not available to view.error
- The report could not be created.
StateReason (string) –
Provides additional details when the report is in an
error
state.CreationTime (datetime) –
The date and time when the report was created.
ExpirationTime (datetime) –
The date and time when Amazon EC2 will delete the report (30 days after the report was created).
Tags (list) –
Any tags assigned to the report.
(dict) –
Describes a tag.
Key (string) –
The key of the tag.
Constraints: Tag keys are case-sensitive and accept a maximum of 127 Unicode characters. May not begin with
aws:
.Value (string) –
The value of the tag.
Constraints: Tag values are case-sensitive and accept a maximum of 256 Unicode characters.