def deploy():
    utils.status("Deploying to QA %s" % env.environment)
    if autoscale.get(asg_type='QA'):
        utils.failure("There is already a QA autoscaling group, exiting")
        sys.exit(0)
    s3.push_config_to_s3()
    ec2.provision_logging_instance()

    load_balancer = elb.get_or_create_load_balancer()
    autoscaling_group = autoscale.create_autoscaling_group(
        load_balancer=load_balancer)
    if env.environment == 'live':
        autoscale.assign_elastic_ip_addresses(
            autoscaling_group=autoscaling_group)
    route53.link_qa_urls(autoscaling_group=autoscaling_group)
    ec2.deploy_nagios_config(autoscaling_group=autoscaling_group)
    utils.success("Successfully deployed to QA %s" % env.environment)
def logging():
    s3.push_config_to_s3()
    ec2.provision_logging_instance()