Created
August 3, 2013 21:01
-
-
Save mdfranz/6147964 to your computer and use it in GitHub Desktop.
VPC Region Fun with 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
# Not sure why I had to do this, seems like I shouldn't have to | |
def region_from_str(s): | |
regions = boto.ec2.regions() | |
for r in regions: | |
if s == r.name: | |
return r | |
vpc_conn = VPCConnection(region=region_from_str(region)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment