ec2-describe-instances
Description
Returns information about instances that you own.
If you specify one or more instance IDs, Amazon EC2 returns information for those instances. If you do not specify instance IDs, Amazon EC2 returns information for all relevant instances. If you specify an invalid instance ID, a fault is returned. If you specify an instance that you do not own, it will not be included in the returned results.
Recently terminated instances might appear in the returned results.This interval is usually less than one hour.
Syntax
ec2-describe-instances [
instance_id
Options
Name | Description | Required |
---|---|---|
|
Instance IDs to describe. Type: String Default: Returns all instances. Example: i-15a4417c |
No |
Output
The command returns a table that contains the following information:
-
Output type identifier ("RESERVATION", "INSTANCE")
-
Instance ID for each running instance
-
AMI ID of the image on which the instance is based
-
Public DNS name associated with the instance. This is only present for instances in the running state
-
Private DNS name associated with the instance. This is only present for instances in the running state
-
Instance state
-
Key name. If a key was associated with the instance at launch, its name will appear
-
AMI launch index
-
Product codes attached to the instance
-
Instance type. The type of the instance
-
Instance launch time. The time the instance launched
-
Availability Zone. The Availability Zone in which the instance is located
-
Monitoring state
Amazon EC2 displays errors on stderr.
Examples
Example Request
This example describes the current state of the instances owned by this user.
PROMPT>ec2-describe-instances
RESERVATION r-15a4417c AIDADH4IGTRXXKCD
INSTANCE i-3ea74257 ami-6ba54002 ec2-204-236-184-27.us-west-1.compute.amazonaws.com ip-10-162-29-189.us-west-1.compute.internal running 0 m1.small 2009-11-13T16:09:12+0000 us-west-1b aki-f70657b2 ari-ff0657ba monitoring-disabled 204.236.184.27 10.162.29.189 ebs
BLOCKDEVICE vol-6605d50e 2009-11-13T16:09:18.000Z
INSTANCE i-31a74258 ami-6ba54002 ec2-204-236-184-27.us-west-1.compute.amazonaws.com ip-10-162-29-189.us-west-1.compute.internal running 0 m1.small 2009-11-13T16:09:12+0000 us-west-1b aki-f70657b2 ari-ff0657ba monitoring-disabled 204.236.184.21 10.162.29.187 ebs
BLOCKDEVICE vol-6605d50e 2009-11-13T16:09:18.000Z