Created
May 3, 2013 21:29
-
-
Save devdave/5514362 to your computer and use it in GitHub Desktop.
Script to generate the ec2-authorize calls necessary to add dotCloud access to your EC2 instances.
This file contains hidden or 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
""" | |
requires the AWS ec2 command line tools are setup | |
run this from the base directory of the ec2-tools install directory | |
security groups provided by DotCloud | |
""" | |
groups = """admin-282171928639, gateway-282171928639, lxc-282171928639 | |
admin-557344332487, gateway-557344332487, lxc-557344332487 | |
admin-198142415373, gateway-198142415373, lxc-198142415373 | |
admin-487118584796, gateway-487118584796, lxc-487118584796 | |
admin-782166217850, gateway-782166217850, lxc-782166217850 | |
admin-512129773505, gateway-512129773505, lxc-512129773505""".strip().replace("\n",",").replace(" ","").split(",") | |
my_security_group = "YOU SHOULD CHANGE THIS; really" | |
for group in groups: | |
name, awsid = group.split("-", 1) | |
print "bin/ec2-authorize {} -P tcp -p -1 -u {} -o {}".format(my_security_group, awsid, name) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment