Exemple #1
0
from meaoelb.elb_tool import ELBTool
from meaoelb.config import *
from meaoelb.elb_ctx import ELBContext

AWS_REGION = 'eu-central-1'
TARGET_CLUSTER = 'frankfurt.moz.works'
ASG = "nodes.{}".format(TARGET_CLUSTER)
VPC = 'vpc-4d036a25'
SUBNET_IDS = ['subnet-10685f78', 'subnet-57ef9f2d']

elb_tool = ELBTool(aws_region=AWS_REGION,
                   target_cluster=TARGET_CLUSTER,
                   asg_name=ASG,
                   vpc_id=VPC,
                   subnet_ids=SUBNET_IDS)

redirector_port = elb_tool.ctx.get_redirector_service_nodeport()


def define_deis_router():
    http_nodeport = elb_tool.ctx.get_service_nodeport('deis', 'deis-router',
                                                      'http')
    healthz_nodeport = elb_tool.ctx.get_service_nodeport(
        'deis', 'deis-router', 'healthz')
    https_nodeport = elb_tool.ctx.get_service_nodeport('deis', 'deis-router',
                                                       'https')
    builder_nodeport = elb_tool.ctx.get_service_nodeport(
        'deis', 'deis-router', 'builder')

    # Health check config
Exemple #2
0
from meaoelb.elb_tool import ELBTool

AWS_REGION = 'us-west-2'
TARGET_CLUSTER = 'oregon-b.moz.works'
OREGON_B_ASG = "nodes.{}".format(TARGET_CLUSTER)
OREGON_B_VPC = 'vpc-ea93e58f'
OREGON_B_SUBNET_IDS = ['subnet-e290afaa']

# one time setup for all ELBs in this region
# config values here are later used to create default ELB objects that
# can be configured however you like
elb_tool = ELBTool(aws_region=AWS_REGION,
                   target_cluster=TARGET_CLUSTER,
                   asg_name=OREGON_B_ASG,
                   vpc_id=OREGON_B_VPC,
                   subnet_ids=OREGON_B_SUBNET_IDS)
Exemple #3
0
from meaoelb.elb_tool import ELBTool

AWS_REGION = 'us-west-2'
TARGET_CLUSTER = 'oregon-a.moz.works'
OREGON_A_ASG = "nodes.{}".format(TARGET_CLUSTER)
OREGON_A_VPC = 'vpc-ea93e58f'
OREGON_A_SUBNET_IDS = ['subnet-0d89cd37ecec22dd2']

elb_tool = ELBTool(aws_region=AWS_REGION,
                   target_cluster=TARGET_CLUSTER,
                   asg_name=OREGON_A_ASG,
                   vpc_id=OREGON_A_VPC,
                   subnet_ids=OREGON_A_SUBNET_IDS)

sumo_stage = elb_tool.define_elb_http(
    service_namespace='sumo-stage',
    service_name='sumo-nodeport',
    ssl_arn=
    'arn:aws:acm:us-west-2:236517346949:certificate/192b6409-996e-46ac-a3d9-c78a69670dae'
)
sumo_stage.elb_config.health_check.target_path = '/healthz/'
sumo_stage.elb_config.name = 'sumo-stage-a'

sumo_prod = elb_tool.define_elb_http(
    service_namespace='sumo-prod',
    service_name='sumo-nodeport',
    ssl_arn=
    'arn:aws:acm:us-west-2:236517346949:certificate/b427fcf8-4321-41ca-8fe0-57a90da17d52'
)
sumo_prod.elb_config.health_check.target_path = '/healthz/'
sumo_prod.elb_config.name = 'sumo-prod-a'
Exemple #4
0
from meaoelb.elb_tool import ELBTool

AWS_REGION = 'us-west-2'
TARGET_CLUSTER = 'oregon-b.moz.works'
OREGON_B_ASG = "nodes.{}".format(TARGET_CLUSTER)
OREGON_B_VPC = 'vpc-ea93e58f'
OREGON_B_SUBNET_IDS = ['subnet-e290afaa']

# one time setup for all ELBs in this region
# config values here are later used to create default ELB objects that
# can be configured however you like
elb_tool = ELBTool(
    aws_region=AWS_REGION,
    target_cluster=TARGET_CLUSTER,
    asg_name=OREGON_B_ASG,
    vpc_id=OREGON_B_VPC,
    subnet_ids=OREGON_B_SUBNET_IDS)

# Bedrock Stage
# Define ELB's that we'd like to have created
bedrock_stage = elb_tool.define_elb(
    service_namespace='bedrock-stage',
    service_name='bedrock-nodeport',
    ssl_arn='arn:aws:acm:us-west-2:236517346949:certificate/657b1ca0-8c09-4add-90a2-1243470a6b45')
# there are more flexible ways of defining ELBS:
# elb_tool.cfg_defaults.default_service_config OR
# elb_tool.cfg_defaults.generic_service_config
# but elb_tool.define_elb() fills in most of the blanks for you

# add an IdleTimeout as an ELB attribute
bedrock_stage.elb_config.elb_atts.connection_settings.idle_timeout = 120
Exemple #5
0
from meaoelb.elb_tool import ELBTool
from meaoelb.config import *
from meaoelb.elb_ctx import ELBContext

AWS_REGION = 'ap-northeast-1'
TARGET_CLUSTER = 'tokyo.moz.works'
ASG = "nodes.{}".format(TARGET_CLUSTER)
VPC = 'vpc-cd1f99a9'
SUBNET_IDS = ['subnet-115ed549', 'subnet-ed79369b']

elb_tool = ELBTool(aws_region=AWS_REGION,
                   target_cluster=TARGET_CLUSTER,
                   asg_name=ASG,
                   vpc_id=VPC,
                   subnet_ids=SUBNET_IDS)

redirector_port = elb_tool.ctx.get_redirector_service_nodeport()


def define_deis_router():

    http_nodeport = elb_tool.ctx.get_service_nodeport('deis', 'deis-router',
                                                      'http')
    healthz_nodeport = elb_tool.ctx.get_service_nodeport(
        'deis', 'deis-router', 'healthz')
    https_nodeport = elb_tool.ctx.get_service_nodeport('deis', 'deis-router',
                                                       'https')
    builder_nodeport = elb_tool.ctx.get_service_nodeport(
        'deis', 'deis-router', 'builder')
    # Health check config