AWS: listing your EC2 instances IP addresses from command line

Increasing number of instances running on Amazon AWS / EC2, ever wondered how to get their list of IP addresses, including elastic IPs, from CLI (i.e. to make sure you don’t have any servers with proxy or SMTP open relay)?

Here is a small bash script that will do it.


The newer aws command (from awscli package) might be easier to use:aws ec2 describe-instances|grep PublicIpAddress