Last active
August 29, 2015 14:15
-
-
Save barakm/c27a51f64c2d5038ac74 to your computer and use it in GitHub Desktop.
Mist backend setup for AWS
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
from mistclient import MistClient | |
client = MistClient(email="MY_MIST_EMAIL", password="MY_MIST_PASSWORD") | |
ec2_demo_access_key ="AWS_ACCESS_KEY" | |
ec2_demo_secret_key = "AWS_SECRET_KEY" | |
ec2_account_name = "AWS_ACCOUNT_NAME" | |
def create_ec2_backends(): | |
# creates backends for all ec2 regions | |
for provider in client.supported_providers: | |
if "EC2" in provider["title"]: | |
title = "%s - %s" % (provider["title"], ec2_account_name) | |
print "Creating backend: %s" % title | |
try: | |
client.add_backend(title = title, provider = provider["provider"], | |
key=ec2_demo_access_key, secret=ec2_demo_secret_key) | |
except Exception as e: | |
print "Failed to create backend: %s" % e.message | |
create_ec2_backends() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment