AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

NetworkListener

Define a Network Listener.

Import

import { NetworkListener } from 'aws-cdk-lib/aws-elasticloadbalancingv2';

Or use the module namespace:

import * as elasticloadbalancingv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
// elasticloadbalancingv2.NetworkListener

Properties

Configuration passed to the constructor as NetworkListenerProps.

loadBalancerRequired
INetworkLoadBalancer

The load balancer to attach this listener to.

8 properties inherited from BaseNetworkListenerProps
portRequiredinherited from BaseNetworkListenerProps
number

The port on which the listener listens for requests.

alpnPolicyOptionalinherited from BaseNetworkListenerProps
AlpnPolicy

Application-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages. 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

certificatesOptionalinherited from BaseNetworkListenerProps
IListenerCertificate[]

Certificate list of ACM cert ARNs. You must provide exactly one certificate if the listener protocol is HTTPS or TLS.

Default: - No certificates.

defaultActionOptionalinherited from BaseNetworkListenerProps
NetworkListenerAction

Default action to take for requests to this listener. 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.

defaultTargetGroupsOptionalinherited from BaseNetworkListenerProps
INetworkTargetGroup[]

Default target groups to load balance to. 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.

protocolOptionalinherited from BaseNetworkListenerProps
Protocol

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

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

sslPolicyOptionalinherited from BaseNetworkListenerProps
SslPolicy

SSL Policy.

Default: - Current predefined security policy.

tcpIdleTimeoutOptionalinherited from BaseNetworkListenerProps
Duration

The load balancer TCP idle timeout.

Default: Duration.seconds(350)

Get the Elastic Load Balancing V2 Cheat Sheet

Everything you need to know about Elastic Load Balancing V2 on one page. HD quality, print-friendly.

Download Free Infographic