Skip to content

EC2  >  Operations  >  create_image_usage_report

create_image_usage_report

Operation

create_image_usage_report async

create_image_usage_report(input: CreateImageUsageReportInput, plugins: list[Plugin] | None = None) -> CreateImageUsageReportOutput

Creates a report that shows how your image is used across other Amazon Web Services accounts. The report provides visibility into which accounts are using the specified image, and how many resources (EC2 instances or launch templates) are referencing it.

For more information, see View your AMI usage in the Amazon EC2 User Guide.

Parameters:

Name Type Description Default
input CreateImageUsageReportInput

An instance of CreateImageUsageReportInput.

required
plugins list[Plugin] | None

A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations.

None

Returns:

Type Description
CreateImageUsageReportOutput

An instance of CreateImageUsageReportOutput.

Input

CreateImageUsageReportInput dataclass

Bases: _SerdeShape

Dataclass for CreateImageUsageReportInput structure.

Attributes

account_ids class-attribute instance-attribute
account_ids: list[str] | None = ...

The Amazon Web Services account IDs to include in the report. To include all accounts, omit this parameter.

client_token class-attribute instance-attribute
client_token: str | None = ...

A unique, case-sensitive identifier that you provide to ensure idempotency of the request.

dry_run class-attribute instance-attribute
dry_run: bool | None = ...

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.

image_id class-attribute instance-attribute
image_id: str | None = ...

The ID of the image to report on.

resource_types class-attribute instance-attribute
resource_types: list[ImageUsageResourceTypeRequest] | None = ...

The resource types to include in the report.

tag_specifications class-attribute instance-attribute
tag_specifications: list[TagSpecification] | None = ...

The tags to apply to the report on creation. The ResourceType must be set to image-usage-report; any other value will cause the report creation to fail.

To tag a report after it has been created, see CreateTags.

Output

CreateImageUsageReportOutput dataclass

Bases: _SerdeShape

Dataclass for CreateImageUsageReportOutput structure.

Attributes

report_id class-attribute instance-attribute
report_id: str | None = ...

The ID of the report.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.