Created
September 27, 2011 20:23
-
-
Save whaley/1246120 to your computer and use it in GitHub Desktop.
itertools and boto
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import itertools | |
import boto | |
ec2 = boto.connect_ec2() | |
chain = itertools.chain.from_iterable | |
existing_instances = list(chain([res.instances for res in ec2.get_all_instances()])) | |
print existing_instances #gives you a list of all instances | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment