def handle(self, *args, **kwargs): c = get_context() take_down_ec2(c) tags = {"Project": "aws-initial-testing", "Use": "messing-around", "ResponsibleParty": settings.AWS_RESPONSIBLE_PARTY, } my_security_group = settings.AWS_SECURITY_GROUP_NAME print create_new_db_cluster(c, [my_security_group], tags)
def handle(self, *args, **kwargs): c = get_context() region_name = getattr(settings, 'AWS_REGION_NAME', 'us-west-2') take_down_ec2(c) try: manage_vpcs(c) launch_ec2(c) except Exception as ex: print ex print "Failed to launch" raise
def handle(self, *args, **kwargs): c = get_context() region_name = getattr(settings, "AWS_REGION_NAME", "us-west-2") take_down_ec2(c) try: manage_vpcs(c) launch_ec2(c) except Exception as ex: print ex print "Failed to launch" raise
def handle(self, *args, **kwargs): c = get_context() take_down_ec2(c) tags = { "Project": "aws-initial-testing", "Use": "messing-around", "ResponsibleParty": settings.AWS_RESPONSIBLE_PARTY, } my_security_group = settings.AWS_SECURITY_GROUP_NAME print create_new_db_cluster(c, [my_security_group], tags)
def handle(self, *args, **kwargs): c = get_context() if False: cleanup_all(c) # Find or create a DB cluster to use. db_settings = get_database_config_for_project(c, "myuw", "aws_mess_around") print "DB settings: ", db_settings # Find or create the proxies the app servers will live behind. proxy_settings = get_proxy_config_for_project(c, "myuw", "aws_mess_around") print "Proxy settings: ", proxy_settings # Get a base image to do build a MyUW AMI off of my_security_group = settings.AWS_SECURITY_GROUP_NAME tags = { "Project": "myuw", "Use": "messing-around", "ResponsibleParty": settings.AWS_RESPONSIBLE_PARTY, } # instance_ids = create_webapp_instances(c, 1, DEMO_DOMAIN, # [my_security_group], tags) # instance_id = instance_ids[0] instance_id = 'i-d7d3370f' print "Our base instance ID: ", instance_id # Get the host ready to be a MyUW app server playbook = "aws_mess_around/playbooks/app/prep_host.yml" urls = [ "url(r'^support', include('userservice.urls'))", "url(r'^restclients/', include('restclients.urls'))", "url(r'^logging/', include('django_client_logger.urls'))", "url(r'^', include('myuw.urls'))" ] # XXX - this should change when the memcached work is implemented. cache = "myuw.util.cache_implementation.MyUWCache" secret_key = get_secret_key_for_project("myuw", "aws_mess_around") extra_settings = "templates/myuw/project_settings.py" data = { "files_dir": settings.AWS_FILES_PATH, "file_group": "ubuntu", "webservice_client_cert_name": "myuw-uwca.cert", "webservice_client_key_name": "myuw-uwca.key", # "build_number": get_next_build_for_project("myuw"), "build_number": 8, "git_repository": "https://github.com/uw-it-aca/myuw.git", "git_version": "feature/aws-shibboleth", "pip_requirements_files": ["requirements.txt"], "project_url_definitions": urls, "database_name": "myuw", "database_user": db_settings["username"], "database_password": db_settings["password"], "database_host": db_settings["host"], "allowed_hosts": [DEMO_DOMAIN], "secret_key": secret_key, "digitlib_client_redirect": False, "userservice_admin_group": "u_pmichaud_myuwdevtesters", "restclients_admin_group": "u_pmichaud_myuwdevtesters", "restclients_dao_cache_class": cache, "project_settings_template": extra_settings, "migrate_apps": ["myuw"], "shib_required_url": "/", "restclients": { "test": [], "production": [ "gws", "sws", "pws", "hfs", "book", "uwnetid", "canvas", "libraries", "trumba_calendar", "digit_lib", "iasystem", "grad" ], }, } run_playbook_on_instances_by_ids(c, playbook, [instance_id], data=data, vars_file="aws/myuw/production.json") # Add our instances to the proxy proxy_ids = [proxy_settings["instance_id"]] # set_app_servers_for_proxies_by_id(c, DEMO_DOMAIN, proxy_ids, # [instance_id]) instance = get_instance(c, instance_id) print "IP: ", instance.public_ip_address
def handle(self, *args, **kwargs): c = get_context() if False: cleanup_all(c) # Find or create a DB cluster to use. db_settings = get_database_config_for_project(c, "myuw", "aws_mess_around") print "DB settings: ", db_settings # Find or create the proxies the app servers will live behind. proxy_settings = get_proxy_config_for_project(c, "myuw", "aws_mess_around") print "Proxy settings: ", proxy_settings # Get a base image to do build a MyUW AMI off of my_security_group = settings.AWS_SECURITY_GROUP_NAME tags = {"Project": "myuw", "Use": "messing-around", "ResponsibleParty": settings.AWS_RESPONSIBLE_PARTY, } # instance_ids = create_webapp_instances(c, 1, DEMO_DOMAIN, # [my_security_group], tags) # instance_id = instance_ids[0] instance_id = 'i-d7d3370f' print "Our base instance ID: ", instance_id # Get the host ready to be a MyUW app server playbook = "aws_mess_around/playbooks/app/prep_host.yml" urls = ["url(r'^support', include('userservice.urls'))", "url(r'^restclients/', include('restclients.urls'))", "url(r'^logging/', include('django_client_logger.urls'))", "url(r'^', include('myuw.urls'))" ] # XXX - this should change when the memcached work is implemented. cache = "myuw.util.cache_implementation.MyUWCache" secret_key = get_secret_key_for_project("myuw", "aws_mess_around") extra_settings = "templates/myuw/project_settings.py" data = {"files_dir": settings.AWS_FILES_PATH, "file_group": "ubuntu", "webservice_client_cert_name": "myuw-uwca.cert", "webservice_client_key_name": "myuw-uwca.key", # "build_number": get_next_build_for_project("myuw"), "build_number": 8, "git_repository": "https://github.com/uw-it-aca/myuw.git", "git_version": "feature/aws-shibboleth", "pip_requirements_files": ["requirements.txt"], "project_url_definitions": urls, "database_name": "myuw", "database_user": db_settings["username"], "database_password": db_settings["password"], "database_host": db_settings["host"], "allowed_hosts": [DEMO_DOMAIN], "secret_key": secret_key, "digitlib_client_redirect": False, "userservice_admin_group": "u_pmichaud_myuwdevtesters", "restclients_admin_group": "u_pmichaud_myuwdevtesters", "restclients_dao_cache_class": cache, "project_settings_template": extra_settings, "migrate_apps": ["myuw"], "shib_required_url": "/", "restclients": {"test": [], "production": ["gws", "sws", "pws", "hfs", "book", "uwnetid", "canvas", "libraries", "trumba_calendar", "digit_lib", "iasystem", "grad"], }, } run_playbook_on_instances_by_ids(c, playbook, [instance_id], data=data, vars_file="aws/myuw/production.json") # Add our instances to the proxy proxy_ids = [proxy_settings["instance_id"]] # set_app_servers_for_proxies_by_id(c, DEMO_DOMAIN, proxy_ids, # [instance_id]) instance = get_instance(c, instance_id) print "IP: ", instance.public_ip_address