This module lets you get information about any number of ec2 instances in your environment. It also has the option of creating hostnames based on the ip of your server.