Class BaseNetworkListenerProps
Basic properties for a Network Listener.
Inheritance
Implements
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public class BaseNetworkListenerProps : Object, IBaseNetworkListenerProps
Syntax (vb)
Public Class BaseNetworkListenerProps
Inherits Object
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
Base |
Properties
Alpn |
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. |
Default |
Default action to take for requests to this listener. |
Default |
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. |
Ssl |
SSL Policy. |
Tcp |
The load balancer TCP idle timeout. |
Constructors
BaseNetworkListenerProps()
public BaseNetworkListenerProps()
Properties
AlpnPolicy
Application-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages.
public Nullable<AlpnPolicy> AlpnPolicy { get; set; }
Property Value
System.
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
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
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
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
System.
Protocol
Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP.
public Nullable<Protocol> Protocol { get; set; }
Property Value
System.
Remarks
Default: - TLS if certificates are provided. TCP otherwise.
SslPolicy
SSL Policy.
public Nullable<SslPolicy> SslPolicy { get; set; }
Property Value
System.
Remarks
Default: - Current predefined security policy.
TcpIdleTimeout
The load balancer TCP idle timeout.
public Duration TcpIdleTimeout { get; set; }
Property Value
Remarks
Default: Duration.seconds(350)