Get all Instance objects from Reservations
In boto, getallinstances() returns those annoying Reservation objects when what you really want are the Instance objects. Here's a nice concise way to extract the Instances.
import boto
ec2 = boto.connect_ec2()
reservations = ec2.get_all_instances()
instances = [i for r in reservations for i in r.instances]
Written by Mitch Garnaat
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Python
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#