Class NetworkListenerProps
Properties for a Network Listener attached to a Load Balancer.
Inheritance
Namespace: Amazon.CDK.AWS.ElasticLoadBalancingV2
Assembly: Amazon.CDK.AWS.ElasticLoadBalancingV2.dll
Syntax (csharp)
public class NetworkListenerProps : Object, INetworkListenerProps, IBaseNetworkListenerProps
Syntax (vb)
Public Class NetworkListenerProps
Inherits Object
Implements INetworkListenerProps, IBaseNetworkListenerProps
Remarks
ExampleMetadata: fixture=_generated
Examples
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.ElasticLoadBalancingV2;
ListenerCertificate listenerCertificate;
NetworkListenerAction networkListenerAction;
NetworkLoadBalancer networkLoadBalancer;
NetworkTargetGroup networkTargetGroup;
var networkListenerProps = new NetworkListenerProps {
LoadBalancer = networkLoadBalancer,
Port = 123,
// the properties below are optional
AlpnPolicy = AlpnPolicy.HTTP1_ONLY,
Certificates = new [] { listenerCertificate },
DefaultAction = networkListenerAction,
DefaultTargetGroups = new [] { networkTargetGroup },
Protocol = Protocol.HTTP,
SslPolicy = SslPolicy.RECOMMENDED
};
Synopsis
Constructors
NetworkListenerProps() |
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. |
LoadBalancer | The load balancer to attach this listener 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. |
Constructors
NetworkListenerProps()
public NetworkListenerProps()
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.Nullable<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
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.
LoadBalancer
The load balancer to attach this listener to.
public INetworkLoadBalancer LoadBalancer { get; set; }
Property Value
Port
The port on which the listener listens for requests.
public double Port { get; set; }
Property Value
System.Double
Protocol
Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP.
public Nullable<Protocol> Protocol { get; set; }
Property Value
System.Nullable<Protocol>
Remarks
Default: - TLS if certificates are provided. TCP otherwise.
SslPolicy
SSL Policy.
public Nullable<SslPolicy> SslPolicy { get; set; }
Property Value
System.Nullable<SslPolicy>
Remarks
Default: - Current predefined security policy.