kingpin
kingpin copied to clipboard
AWS Actors should get Region from meta-data server if necessary
If the region is not supplied, the AWS actors should be able to get it from the local metadata server via the placement-zone metadata key.
Complexity arises from the fact that we instantiate connection objects in the constructor of each AWS Actor. Even though the connection object definition is lazy, the method to fetch current region (required to define the connection object) is a network call.
Possible solution is to leverage @property decorator, changing our code from
def __init__(...):
self.ec2_conn = boto.ec2.connection(...)
to
@property
def ec2_conn(self):
return boto.ec2.connection(...)