Skip to content

Instantly share code, notes, and snippets.

Created December 30, 2012 03:01
Show Gist options
  • Save anonymous/4410745 to your computer and use it in GitHub Desktop.
Save anonymous/4410745 to your computer and use it in GitHub Desktop.
Uses boto to dump instance information.
from boto import ec2
regions = ec2.regions()
for region in regions:
print region.name
conn = ec2.connect_to_region(region.name)
instances = conn.get_all_instances()
if len(instances) > 0:
for i in instances:
current = i.instances[0]
print current.id
print current.image_id
print current.ip_address
print current.launch_time
else:
print '0 instances'
print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment