Table of Contents

Class LoadBalancerListener

Namespace
Amazon.CDK.AWS.ElasticLoadBalancing
Assembly
Amazon.CDK.AWS.ElasticLoadBalancing.dll

Add a backend to the load balancer.

public class LoadBalancerListener : ILoadBalancerListener
Inheritance
LoadBalancerListener
Implements
Inherited Members

Examples

IVpc vpc;

            AutoScalingGroup myAutoScalingGroup;

            var lb = new LoadBalancer(this, "LB", new LoadBalancerProps {
                Vpc = vpc,
                InternetFacing = true,
                HealthCheck = new HealthCheck {
                    Port = 80
                }
            });
            lb.AddTarget(myAutoScalingGroup);
            lb.AddListener(new LoadBalancerListener {
                ExternalPort = 80
            });

Remarks

ExampleMetadata: infused

Constructors

LoadBalancerListener()

public LoadBalancerListener()

Properties

AllowConnectionsFrom

Allow connections to the load balancer from the given set of connection peers.

public IConnectable[]? AllowConnectionsFrom { get; set; }

Property Value

IConnectable[]

Remarks

By default, connections will be allowed from anywhere. Set this to an empty list to deny connections, or supply a custom list of peers to allow connections from (IP ranges or security groups).

Default: Anywhere

ExternalPort

External listening port.

public double ExternalPort { get; set; }

Property Value

double

ExternalProtocol

What public protocol to use for load balancing.

public LoadBalancingProtocol? ExternalProtocol { get; set; }

Property Value

LoadBalancingProtocol?

Remarks

Either 'tcp', 'ssl', 'http' or 'https'.

May be omitted if the external port is either 80 or 443.

InternalPort

Instance listening port.

public double? InternalPort { get; set; }

Property Value

double?

Remarks

Same as the externalPort if not specified.

Default: externalPort

InternalProtocol

What public protocol to use for load balancing.

public LoadBalancingProtocol? InternalProtocol { get; set; }

Property Value

LoadBalancingProtocol?

Remarks

Either 'tcp', 'ssl', 'http' or 'https'.

May be omitted if the internal port is either 80 or 443.

The instance protocol is 'tcp' if the front-end protocol is 'tcp' or 'ssl', the instance protocol is 'http' if the front-end protocol is 'https'.

PolicyNames

SSL policy names.

public string[]? PolicyNames { get; set; }

Property Value

string[]

SslCertificateArn

the ARN of the SSL certificate.

public string? SslCertificateArn { get; set; }

Property Value

string

Remarks

Default: - none

SslCertificateId

(deprecated) the ARN of the SSL certificate.

[Obsolete("- use sslCertificateArn instead")]
public string? SslCertificateId { get; set; }

Property Value

string

Remarks

Stability: Deprecated