Wednesday, March 9, 2011

Generate list of Instance, AMI their Public DNS, Zone and type of Instance

Here is the command you can use to generate a list of instances running in your Amazon AWS account. You need to have Amazon AWS command line tool installed and configured on your machine. If you don't have it already follow article http://swapnilgoswami.blogspot.com/2011/03/amazon-ec2-command-line-tool-step-by.html.


./ec2-describe-instances | grep INSTANCE | cut f12,2,10,3,4 >> abc.txt


The above command will create a file abc.txt in your current directory which has list of all instances running in your account.. Basically it will list down following info:


1. Instance ID
2. AMI ID
3. Public DNS
4. Type of Instance (small, medium, large etc)
5. Zone

No comments:

Post a Comment