ec2-describe-images

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

Returns information about AMIs, AKIs, and ARIs available to the user. Information returned includes image type, product codes, architecture, and kernel and RAM disk IDs. Images available to the user include public images available for any user to launch, private images owned by the user making the request, and private images owned by other users for which the user has explicit launch permissions.

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 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

If you do not specify any optional parameters, Amazon EC2 returns images you own or images for which you have explicit access. Public images are not returned.

Machine images returned by this command include their kernel and RAM disk IDs.

OptionDescriptionRequired

-a

Returns AMIs that the user owns and for which the user has execution permissions.

Example: -a

No

-o owner

Returns AMIs owned by the specified owner. Multiple owners can be specified. Owners are specified with AWS user account ID, without dashes. 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.

Example: -o 495219933132

No

-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.

Example: -x self

No

Amazon EC2 returns a table that contains the following information:

Amazon EC2 displays errors on stderr.

This example describes the ami-78a54011 AMI.

$ ec2-describe-images ami-78a54011
IMAGE ami-78a54011 powerdns/image.manifest.xml 495219933132 available private 774F4FF8 i386  machine aki-a2d732cb    ari-a3d732ca

This example describes the Amazon 64-bit AMI.

$ ec2-describe-images –o amazon | grep x86_64
IMAGE   ami-78a54034   ec2-public-images/fedora-core6-base-x86_64.manifest.xml  
amazon   available   public x86_64  machine aki-a2d732cb    ari-a3d732ca