Show / Hide Table of Contents

Class BaseNetworkListenerProps

Basic properties for a Network Listener.

Inheritance
object
BaseNetworkListenerProps
Implements
IBaseNetworkListenerProps
Inherited Members
object.GetType()
object.MemberwiseClone()
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class BaseNetworkListenerProps : IBaseNetworkListenerProps
Syntax (vb)
Public Class BaseNetworkListenerProps Implements IBaseNetworkListenerProps
Remarks

ExampleMetadata: infused

Examples
Vpc vpc;
            AutoScalingGroup asg;
            ISecurityGroup sg1;
            ISecurityGroup sg2;


            // Create the load balancer in a VPC. 'internetFacing' is 'false'
            // by default, which creates an internal load balancer.
            var lb = new NetworkLoadBalancer(this, "LB", new NetworkLoadBalancerProps {
                Vpc = vpc,
                InternetFacing = true,
                SecurityGroups = new [] { sg1 }
            });
            lb.AddSecurityGroup(sg2);

            // Add a listener on a particular port.
            var listener = lb.AddListener("Listener", new BaseNetworkListenerProps {
                Port = 443
            });

            // Add targets on a particular port.
            listener.AddTargets("AppFleet", new AddNetworkTargetsProps {
                Port = 443,
                Targets = new [] { asg }
            });

Synopsis

Constructors

BaseNetworkListenerProps()

Basic properties for a Network Listener.

Properties

AlpnPolicy

Application-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages.

Certificates

Certificate list of ACM cert ARNs.

DefaultAction

Default action to take for requests to this listener.

DefaultTargetGroups

Default target groups to load balance to.

Port

The port on which the listener listens for requests.

Protocol

Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP.

SslPolicy

SSL Policy.

TcpIdleTimeout

The load balancer TCP idle timeout.

Constructors

BaseNetworkListenerProps()

Basic properties for a Network Listener.

public BaseNetworkListenerProps()
Remarks

ExampleMetadata: infused

Examples
Vpc vpc;
            AutoScalingGroup asg;
            ISecurityGroup sg1;
            ISecurityGroup sg2;


            // Create the load balancer in a VPC. 'internetFacing' is 'false'
            // by default, which creates an internal load balancer.
            var lb = new NetworkLoadBalancer(this, "LB", new NetworkLoadBalancerProps {
                Vpc = vpc,
                InternetFacing = true,
                SecurityGroups = new [] { sg1 }
            });
            lb.AddSecurityGroup(sg2);

            // Add a listener on a particular port.
            var listener = lb.AddListener("Listener", new BaseNetworkListenerProps {
                Port = 443
            });

            // Add targets on a particular port.
            listener.AddTargets("AppFleet", new AddNetworkTargetsProps {
                Port = 443,
                Targets = new [] { asg }
            });

Properties

AlpnPolicy

Application-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages.

public AlpnPolicy? AlpnPolicy { get; set; }
Property Value

AlpnPolicy?

Remarks

ALPN enables the application layer to negotiate which protocols should be used over a secure connection, such as HTTP/1 and HTTP/2.

Can only be specified together with Protocol TLS.

Default: - None

Certificates

Certificate list of ACM cert ARNs.

public IListenerCertificate[]? Certificates { get; set; }
Property Value

IListenerCertificate[]

Remarks

You must provide exactly one certificate if the listener protocol is HTTPS or TLS.

Default: - No certificates.

DefaultAction

Default action to take for requests to this listener.

public NetworkListenerAction? DefaultAction { get; set; }
Property Value

NetworkListenerAction

Remarks

This allows full control of the default Action of the load balancer, including weighted forwarding. See the NetworkListenerAction class for all options.

Cannot be specified together with defaultTargetGroups.

Default: - None.

DefaultTargetGroups

Default target groups to load balance to.

public INetworkTargetGroup[]? DefaultTargetGroups { get; set; }
Property Value

INetworkTargetGroup[]

Remarks

All target groups will be load balanced to with equal weight and without stickiness. For a more complex configuration than that, use either defaultAction or addAction().

Cannot be specified together with defaultAction.

Default: - None.

Port

The port on which the listener listens for requests.

public double Port { get; set; }
Property Value

double

Remarks

ExampleMetadata: infused

Protocol

Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP.

public Protocol? Protocol { get; set; }
Property Value

Protocol?

Remarks

Default: - TLS if certificates are provided. TCP otherwise.

SslPolicy

SSL Policy.

public SslPolicy? SslPolicy { get; set; }
Property Value

SslPolicy?

Remarks

Default: - Current predefined security policy.

TcpIdleTimeout

The load balancer TCP idle timeout.

public Duration? TcpIdleTimeout { get; set; }
Property Value

Duration

Remarks

Default: Duration.seconds(350)

Implements

IBaseNetworkListenerProps
Back to top Generated by DocFX