interface NetworkListenerProps
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.ElasticLoadBalancingV2.NetworkListenerProps |
Java | software.amazon.awscdk.services.elasticloadbalancingv2.NetworkListenerProps |
Python | aws_cdk.aws_elasticloadbalancingv2.NetworkListenerProps |
TypeScript (source) | @aws-cdk/aws-elasticloadbalancingv2 » NetworkListenerProps |
Properties for a Network Listener attached to a Load Balancer.
Example
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import * as elbv2 from '@aws-cdk/aws-elasticloadbalancingv2';
declare const listenerCertificate: elbv2.ListenerCertificate;
declare const networkListenerAction: elbv2.NetworkListenerAction;
declare const networkLoadBalancer: elbv2.NetworkLoadBalancer;
declare const networkTargetGroup: elbv2.NetworkTargetGroup;
const networkListenerProps: elbv2.NetworkListenerProps = {
loadBalancer: networkLoadBalancer,
port: 123,
// the properties below are optional
alpnPolicy: elbv2.AlpnPolicy.HTTP1_ONLY,
certificates: [listenerCertificate],
defaultAction: networkListenerAction,
defaultTargetGroups: [networkTargetGroup],
protocol: elbv2.Protocol.HTTP,
sslPolicy: elbv2.SslPolicy.RECOMMENDED,
};
Properties
Name | Type | Description |
---|---|---|
load | INetwork | The load balancer to attach this listener to. |
port | number | The port on which the listener listens for requests. |
alpn | Alpn | Application-Layer Protocol Negotiation (ALPN) is a TLS extension that is sent on the initial TLS handshake hello messages. |
certificates? | IListener [] | Certificate list of ACM cert ARNs. |
default | Network | Default action to take for requests to this listener. |
default | INetwork [] | Default target groups to load balance to. |
protocol? | Protocol | Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP. |
ssl | Ssl | SSL Policy. |
loadBalancer
Type:
INetwork
The load balancer to attach this listener to.
port
Type:
number
The port on which the listener listens for requests.
alpnPolicy?
Type:
Alpn
(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:
IListener
[]
(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:
Network
(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:
INetwork
[]
(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:
Ssl
(optional, default: Current predefined security policy.)
SSL Policy.