[ aws . ec2 ]

describe-images

Description

Describes the specified images (AMIs, AKIs, and ARIs) available to you or all of the images available to you.

The images available to you include public images, private images that you own, and private images owned by other Amazon Web Services accounts for which you have explicit launch permissions.

Recently deregistered images appear in the returned results for a short interval and then return empty results. After all instances that reference a deregistered AMI are terminated, specifying the ID of the image will eventually return an error indicating that the AMI ID cannot be found.

When Allowed AMIs is set to enabled , only allowed images are returned in the results, with the imageAllowed field set to true for each image. In audit-mode , the imageAllowed field is set to true for images that meet the account’s Allowed AMIs criteria, and false for images that don’t meet the criteria. For more information, see Allowed AMIs .

The Amazon EC2 API follows an eventual consistency model. This means that the result of an API command you run that creates or modifies resources might not be immediately available to all subsequent commands you run. For guidance on how to manage eventual consistency, see Eventual consistency in the Amazon EC2 API in the Amazon EC2 Developer Guide .

Warning

We strongly recommend using only paginated requests. Unpaginated requests are susceptible to throttling and timeouts.

Note

The order of the elements in the response, including those within nested structures, might vary. Applications should not assume the elements appear in a particular order.

See also: AWS API Documentation

describe-images is a paginated operation. Multiple API calls may be issued in order to retrieve the entire data set of results. You can disable pagination by providing the --no-paginate argument. When using --output text and the --query argument on a paginated response, the --query argument must extract data from the results of the following query expressions: Images

Synopsis

  describe-images
[--executable-users <value>]
[--image-ids <value>]
[--owners <value>]
[--include-deprecated | --no-include-deprecated]
[--include-disabled | --no-include-disabled]
[--dry-run | --no-dry-run]
[--filters <value>]
[--starting-token <value>]
[--page-size <value>]
[--max-items <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]

Options

--executable-users (list)

Scopes the images by users with explicit launch permissions. Specify an Amazon Web Services account ID, self (the sender of the request), or all (public AMIs).

  • If you specify an Amazon Web Services account ID that is not your own, only AMIs shared with that specific Amazon Web Services account ID are returned. However, AMIs that are shared with the account’s organization or organizational unit (OU) are not returned.
  • If you specify self or your own Amazon Web Services account ID, AMIs shared with your account are returned. In addition, AMIs that are shared with the organization or OU of which you are member are also returned.
  • If you specify all , all public AMIs are returned.

(string)

Syntax:

"string" "string" ...

--image-ids (list)

The image IDs.

Default: Describes all images available to you.

(string)

Syntax:

"string" "string" ...

--owners (list)

Scopes the results to images with the specified owners. You can specify a combination of Amazon Web Services account IDs, self , amazon , aws-backup-vault , and aws-marketplace . If you omit this parameter, the results include all images for which you have launch permissions, regardless of ownership.

(string)

Syntax:

"string" "string" ...

--include-deprecated | --no-include-deprecated (boolean)

Specifies whether to include deprecated AMIs.

Default: No deprecated AMIs are included in the response.

Note

If you are the AMI owner, all deprecated AMIs appear in the response regardless of what you specify for this parameter.

--include-disabled | --no-include-disabled (boolean)

Specifies whether to include disabled AMIs.

Default: No disabled AMIs are included in the response.

--dry-run | --no-dry-run (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 .

--filters (list)

The filters.

  • architecture - The image architecture (i386 | x86_64 | arm64 | x86_64_mac | arm64_mac ).
  • block-device-mapping.delete-on-termination - A Boolean value that indicates whether the Amazon EBS volume is deleted on instance termination.
  • block-device-mapping.device-name - The device name specified in the block device mapping (for example, /dev/sdh or xvdh ).
  • block-device-mapping.snapshot-id - The ID of the snapshot used for the Amazon EBS volume.
  • block-device-mapping.volume-size - The volume size of the Amazon EBS volume, in GiB.
  • block-device-mapping.volume-type - The volume type of the Amazon EBS volume (io1 | io2 | gp2 | gp3 | sc1 | st1 | standard ).
  • block-device-mapping.encrypted - A Boolean that indicates whether the Amazon EBS volume is encrypted.
  • boot-mode – The boot mode of the image (legacy-bios | uefi | uefi-preferred ).
  • creation-date - The time when the image was created, in the ISO 8601 format in the UTC time zone (YYYY-MM-DDThh:mm:ss.sssZ), for example, 2021-09-29T11:04:43.305Z . You can use a wildcard (* ), for example, 2021-09-29T* , which matches an entire day.
  • description - The description of the image (provided during image creation).
  • ena-support - A Boolean that indicates whether enhanced networking with ENA is enabled.
  • free-tier-eligible - A Boolean that indicates whether this image can be used under the Amazon Web Services Free Tier (true | false ).
  • hypervisor - The hypervisor type (ovm | xen ).
  • image-allowed - A Boolean that indicates whether the image meets the criteria specified for Allowed AMIs.
  • image-id - The ID of the image.
  • image-watermark.source-image-creation-time - The creation date of the source AMI, in the ISO 8601 format in the UTC time zone (`` YYYY -MM -DD T*HH* :MM :SS .*ssssss* +*HH* :MM `` ). You can use a wildcard (* ), for example, 2021-09-29T* , which matches an entire day.
  • image-watermark.source-image-id - The ID of the AMI to which the watermark was originally attached.
  • image-watermark.source-image-region - The Region where the watermark was originally attached.
  • image-watermark.watermark-creation-time - The date and time the watermark was attached to the AMI, in the ISO 8601 format in the UTC time zone (`` YYYY -MM -DD T*HH* :MM :SS .*ssssss* +*HH* :MM `` ). You can use a wildcard (* ), for example, 2021-09-29T* , which matches an entire day.
  • image-watermark.watermark-key - The watermark identifier, in accountId:watermarkName format (for example, 123456789012:approvedAmi ).
  • image-type - The image type (machine | kernel | ramdisk ).
  • instance-type-specification.supported-instance-type – The instance types that are compatible with the AMI, as specified by the AMI owner. Values can be individual instance types (for example, t3.micro ) or wildcard patterns that match multiple instance types (for example, t3.* ).
  • instance-type-specification.unsupported-instance-type – The instance types that are not compatible with the AMI, as specified by the AMI owner. Values can be individual instance types (for example, t3.micro ) or wildcard patterns that match multiple instance types (for example, t3.* ).
  • is-public - A Boolean that indicates whether the image is public.
  • kernel-id - The kernel ID.
  • manifest-location - The location of the image manifest.
  • name - The name of the AMI (provided during image creation).
  • owner-alias - The owner alias (amazon | aws-backup-vault | aws-marketplace ). The valid aliases are defined in an Amazon-maintained list. This is not the Amazon Web Services account alias that can be set using the IAM console. We recommend that you use the Owner request parameter instead of this filter.
  • owner-id - The Amazon Web Services account ID of the owner. We recommend that you use the Owner request parameter instead of this filter.
  • platform - The platform. The only supported value is windows .
  • product-code - The product code.
  • product-code.type - The type of the product code (marketplace ).
  • public-ssm-parameter-name - The name of a public Systems Manager parameter associated with the AMI. The parameter must be in a trusted Amazon Web Services namespace under aws/service/ . Returns all AMIs that have ever been associated with the parameter, including previous versions.
  • ramdisk-id - The RAM disk ID.
  • root-device-name - The device name of the root device volume (for example, /dev/sda1 ).