Ejemplo n.º 1
0
def elb_instances():
    """ELB mock service"""
    mock = mock_elb()
    mock.start()
    client = session.client('elb')
    zones = ['eu-west-1a', 'eu-west-1b']
    listeners = [{
            'Protocol': 'string',
            'LoadBalancerPort': 123,
            'InstanceProtocol': 'string',
            'InstancePort': 123,
            'SSLCertificateId': 'string'}]
    client.create_load_balancer(LoadBalancerName='my-lb', AvailabilityZones=zones, Listeners=listeners)
    yield client.describe_load_balancers()
    mock.stop()
Ejemplo n.º 2
0
def elb():
    """ELB mock service"""
    mock = mock_elb()
    mock.start()

    client = boto3.client('elb')
    lbs = []
    for i in range(2):
        lb = client.create_load_balancer(LoadBalancerName='loadbalancer-01',
                                         Listeners=[{
                                             'Protocol': 'http',
                                             'LoadBalancerPort': 80,
                                             'InstanceProtocol': 'http',
                                             'InstancePort': 80,
                                         }])
        lbs.append(lb)
    yield {'lbs': lbs}
    mock.stop()
Ejemplo n.º 3
0
def elb():
    """ELB mock service"""
    mock = mock_elb()
    mock.start()

    client = boto3.client('elb')
    lbs = []
    for i in range(2):
        lb = client.create_load_balancer(
            LoadBalancerName='loadbalancer-{:02d}'.format(i),
            Listeners=[
                {
                    'Protocol': 'http',
                    'LoadBalancerPort': 80,
                    'InstanceProtocol': 'http',
                    'InstancePort': 80,
                }
            ]
        )
        lbs.append(lb)
    yield {'lbs': lbs}
    mock.stop()