NetworkListenerProps

class aws_cdk.aws_elasticloadbalancingv2.NetworkListenerProps(*, port, alpn_policy=None, certificates=None, default_action=None, default_target_groups=None, protocol=None, ssl_policy=None, load_balancer)

Bases: BaseNetworkListenerProps

Properties for a Network Listener attached to a Load Balancer.

Parameters:
  • port (Union[int, float]) – The port on which the listener listens for requests.

  • alpn_policy (Optional[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

  • certificates (Optional[Sequence[IListenerCertificate]]) – Certificate list of ACM cert ARNs. You must provide exactly one certificate if the listener protocol is HTTPS or TLS. Default: - No certificates.

  • default_action (Optional[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.

  • default_target_groups (Optional[Sequence[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.

  • protocol (Optional[Protocol]) – Protocol for listener, expects TCP, TLS, UDP, or TCP_UDP. Default: - TLS if certificates are provided. TCP otherwise.

  • ssl_policy (Optional[SslPolicy]) – SSL Policy. Default: - Current predefined security policy.

  • load_balancer (INetworkLoadBalancer) – The load balancer to attach this listener to.

ExampleMetadata:

fixture=_generated

Example:

# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
import aws_cdk.aws_elasticloadbalancingv2 as elbv2

# listener_certificate: elbv2.ListenerCertificate
# network_listener_action: elbv2.NetworkListenerAction
# network_load_balancer: elbv2.NetworkLoadBalancer
# network_target_group: elbv2.NetworkTargetGroup

network_listener_props = elbv2.NetworkListenerProps(
    load_balancer=network_load_balancer,
    port=123,

    # the properties below are optional
    alpn_policy=elbv2.AlpnPolicy.HTTP1_ONLY,
    certificates=[listener_certificate],
    default_action=network_listener_action,
    default_target_groups=[network_target_group],
    protocol=elbv2.Protocol.HTTP,
    ssl_policy=elbv2.SslPolicy.RECOMMENDED
)

Attributes

alpn_policy

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

certificates

Certificate list of ACM cert ARNs.

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

Default:
  • No certificates.

default_action

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.

default_target_groups

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.

load_balancer

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.

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

ssl_policy

SSL Policy.

Default:
  • Current predefined security policy.