Skip to content

Instantly share code, notes, and snippets.

@cjhanks
Created June 26, 2014 18:43
Show Gist options
  • Save cjhanks/dcc54e8b908e30b7500d to your computer and use it in GitHub Desktop.
Save cjhanks/dcc54e8b908e30b7500d to your computer and use it in GitHub Desktop.
ListByTag
import boto
def gather_hosts():
for reservation in boto.connect_ec2().get_all_instances(
filters = { 'tag:purpose' : 'ingestion' }):
for instance in reservation.instances:
print(instance.public_dns_name)
print(instance.private_ip_address)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment