BaseNetworkListenerProps

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

Bases: object

Basic properties for a Network Listener.

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.

ExampleMetadata:

infused

Example:

import aws_cdk.aws_elasticloadbalancing as elb
import aws_cdk.aws_elasticloadbalancingv2 as elb2

# clb: elb.LoadBalancer
# alb: elb2.ApplicationLoadBalancer
# nlb: elb2.NetworkLoadBalancer


alb_listener = alb.add_listener("ALBListener", port=80)
alb_target_group = alb_listener.add_targets("ALBFleet", port=80)

nlb_listener = nlb.add_listener("NLBListener", port=80)
nlb_target_group = nlb_listener.add_targets("NLBFleet", port=80)

deployment_group = codedeploy.ServerDeploymentGroup(self, "DeploymentGroup",
    load_balancers=[
        codedeploy.LoadBalancer.classic(clb),
        codedeploy.LoadBalancer.application(alb_target_group),
        codedeploy.LoadBalancer.network(nlb_target_group)
    ]
)

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.

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.