ec2-describe-images

Description

Returns information about AMIs, AKIs, and ARIs. This includes image type, product codes, architecture, and kernel and RAM disk IDs. Images available to you include public images, private images that you own, and private images owned by other users for which you have explicit launch permissions.

Launch permissions fall into three categories:

Launch PermissionDescription
publicThe owner of the AMI granted launch permissions for the AMI to the all group. All users have launch permissions for these AMIs.
explicitThe owner of the AMI granted launch permissions to a specific user.
implicitA user has implicit launch permissions for all AMIs he or she owns.

The list of AMIs returned can be modified by specifying AMI IDs, AMI owners, or users with launch permissions. If no options are specified, Amazon EC2 returns all AMIs for which the user has launch permissions.

If you specify one or more AMI IDs, only AMIs that have the specified IDs are returned. If you specify an invalid AMI ID, a fault is returned. If you specify an AMI ID for which you do not have access, it will not be included in the returned results.

If you specify one or more AMI owners, only AMIs from the specified owners and for which you have access are returned. The results can include the account IDs of the specified owners, amazon for AMIs owned by Amazon or self for AMIs that you own.

If you specify a list of executable users, only users that have launch permissions for the AMIs are returned. You can specify account IDs (if you own the AMI(s)), self for AMIs for which you own or have explicit permissions, or all for public AMIs.

[Note]Note

Deregistered images are included in the returned results for an unspecified interval after deregistration.

Syntax

ec2-describe-images [ami_id ...] [-a] [-o owner ...] [-x user_id]

Options

NameDescriptionRequired

-x user_id

Returns AMIs for which the specified user has explicit launch permissions. The user ID can be a user's account ID, self to return AMIs for which the sender of the request has explicit launch permissions, or all to return AMIs with public launch permissions.

Type: String

Default: None

Example: -x self

No

ami_id

AMI IDs to describe.

Type: String

Default: Returns all AMIs.

Example: ami-78a54011

No

-a

Describes all AMIs.

Type: String

Default: None

Example: -a

No

-o owner

Returns AMIs owned by the specified owner. Multiple owners can be specified. The IDs amazon, self, and explicit can be used to include AMIs owned by Amazon, AMIs owned by the user, and AMIs for which the user has explicit launch permissions, respectively.

Type: String

Default: None

Example: -o 157SZTMZQT516NAZ7CR2

No

Output

The command returns a table that contains the following information:

  • IMAGE identifier

  • Image identifier

  • Manifest location

  • User identifier of the user that registered the image

  • Image status

  • Image visibility (public or private)

  • Product codes, if any, that are attached to the instance

  • Image architecture (i386 or x86_64)

  • Image type (machine, kernel, or ramdisk)

  • ID of the kernel associated with the image (machine images only)

  • ID of the RAM disk associated with the image (machine images only)

Amazon EC2 displays errors on stderr.

Examples

Example Request

This example describes the ami-be3adfd7 AMI.

PROMPT> ec2-describe-images ami-be3adfd7
IMAGE ami-78a54011 amazon/getting-started-with-ebs-boot amazon available
							public i386 machine aki-a13667e4 ari-a33667e6 ebs
BLOCKDEVICEMAPPING /dev/sda1 snap-8eaf78e6 15