Define a Network Listener.
import { NetworkListener } from 'aws-cdk-lib/aws-elasticloadbalancingv2';Or use the module namespace:
import * as elasticloadbalancingv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
// elasticloadbalancingv2.NetworkListenerConfiguration passed to the constructor as NetworkListenerProps.
loadBalancerRequiredINetworkLoadBalancerThe load balancer to attach this listener to.
BaseNetworkListenerPropsportRequiredinherited from BaseNetworkListenerPropsnumberThe port on which the listener listens for requests.
alpnPolicyOptionalinherited from BaseNetworkListenerPropsAlpnPolicyApplication-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 BaseNetworkListenerPropsIListenerCertificate[]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 BaseNetworkListenerPropsNetworkListenerActionDefault 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 BaseNetworkListenerPropsINetworkTargetGroup[]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 BaseNetworkListenerPropsProtocolProtocol for listener, expects TCP, TLS, UDP, or TCP_UDP.
Default: - TLS if certificates are provided. TCP otherwise.
sslPolicyOptionalinherited from BaseNetworkListenerPropsSslPolicySSL Policy.
Default: - Current predefined security policy.
tcpIdleTimeoutOptionalinherited from BaseNetworkListenerPropsDurationThe load balancer TCP idle timeout.
Default: Duration.seconds(350)
Everything you need to know about Elastic Load Balancing V2 on one page. HD quality, print-friendly.
Download Free Infographicaws-elasticloadbalancingv2