Skip to content

Instantly share code, notes, and snippets.

@robballou
Created November 11, 2011 17:01
Show Gist options
  • Save robballou/1358548 to your computer and use it in GitHub Desktop.
Save robballou/1358548 to your computer and use it in GitHub Desktop.
Get the instance DNS names for an AWS security group using boto
from boto.ec2.connection import EC2Connection
ec2 = EC2Connection()
reservations = ec2.get_all_instances(None, {'group-name': 'Your Group Name'})
dns_names = [instance[0].dns_name for instance in [reservation.instances for reservation in reservations]]
@whatnick
Copy link

whatnick commented Feb 6, 2019

What IAM credentials do you use with this setup ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment