ec2-describe-images
Syntax
ec2-describe-images[
ami_id
...] [-a] [-o owner
...] [-x user_id
]
Description
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 | |
---|---|
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.
Options
Option | Description | Required |
---|---|---|
|
Returns AMIs that the user owns and for which the user has execution permissions. Example: |
No |
|
Returns AMIs owned by the specified owner. Multiple owners
can be specified. Owners are specified with AWS user account ID, without
dashes. The IDs Example: |
No |
|
Returns AMIs for which the specified user has explicit launch permissions.
The user ID can be a user's account ID, Example: |
No |
Output
Amazon EC2 returns a table that contains the following information:
-
A record type identifier ("IMAGE")
-
Image identifier
-
Manifest location
-
User identifier of the user that registered the image
-
Image status
-
Image visibility (
public
orprivate
) -
Product codes, if any, that are attached to the instance
-
Image architecture (
i386
orx86_64
) -
Image type (
machine
,kernel
, orramdisk
) -
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
.
Example
This example describes the ami-78a54011
AMI.
PROMPT>
ec2-describe-images ami-78a54011
IMAGE ami-78a54011 powerdns/image.manifest.xml AIDADH4IGTRXXKCD available private 774F4FF8 i386 machine aki-a2d732cb ari-a3d732ca
This example describes the Amazon 64-bit AMI.
PROMPT>
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
This example shows an AMI that runs Windows.
C:\>
ec2-describe-images | findstr /i windows
IMAGE ami-e6cd298f Key2047/test.manifest.xml 720208972571 available private x86_64 machine windows