aws-cdk-lib.aws_elasticloadbalancingv2.BaseNetworkListenerProps

interface BaseNetworkListenerProps

LanguageType name
.NETAmazon.CDK.AWS.ElasticLoadBalancingV2.BaseNetworkListenerProps
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awselasticloadbalancingv2#BaseNetworkListenerProps
Javasoftware.amazon.awscdk.services.elasticloadbalancingv2.BaseNetworkListenerProps
Pythonaws_cdk.aws_elasticloadbalancingv2.BaseNetworkListenerProps
TypeScript (source)aws-cdk-lib » aws_elasticloadbalancingv2 » BaseNetworkListenerProps

Basic properties for a Network Listener.

Example

import { HttpNlbIntegration } from '@aws-cdk/aws-apigatewayv2-integrations-alpha';

const vpc = new ec2.Vpc(this, 'VPC');
const lb = new elbv2.NetworkLoadBalancer(this, 'lb', { vpc });
const listener = lb.addListener('listener', { port: 80 });
listener.addTargets('target', {
  port: 80,
});

const httpEndpoint = new apigwv2.HttpApi(this, 'HttpProxyPrivateApi', {
  defaultIntegration: new HttpNlbIntegration('DefaultIntegration', listener),
});

Properties

NameTypeDescription
portnumberThe port on which the listener listens for requests.
alpnPolicy?AlpnPolicyApplication-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages.
certificates?IListenerCertificate[]Certificate list of ACM cert ARNs.
defaultAction?NetworkListenerActionDefault action to take for requests to this listener.
defaultTargetGroups?INetworkTargetGroup[]Default target groups to load balance to.
protocol?ProtocolProtocol for listener, expects TCP, TLS, UDP, or TCP_UDP.
sslPolicy?SslPolicySSL Policy.

port

Type: number

The port on which the listener listens for requests.


alpnPolicy?

Type: AlpnPolicy (optional, default: None)

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.


certificates?

Type: IListenerCertificate[] (optional, default: No certificates.)

Certificate list of ACM cert ARNs.

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


defaultAction?

Type: NetworkListenerAction (optional, default: None.)

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.


defaultTargetGroups?

Type: INetworkTargetGroup[] (optional, default: None.)

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.


protocol?

Type: Protocol (optional, default: TLS if certificates are provided. TCP otherwise.)

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


sslPolicy?

Type: SslPolicy (optional, default: Current predefined security policy.)

SSL Policy.