INetworkLoadBalancer

class aws_cdk.aws_elasticloadbalancingv2.INetworkLoadBalancer(*args, **kwargs)

Bases: ILoadBalancerV2, IVpcEndpointServiceLoadBalancer, IConnectable, Protocol

A network load balancer.

Methods

add_listener(id, *, port, alpn_policy=None, certificates=None, default_action=None, default_target_groups=None, protocol=None, ssl_policy=None, tcp_idle_timeout=None)

Add a listener to this load balancer.

Parameters:
  • id (str) –

  • 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.

  • tcp_idle_timeout (Optional[Duration]) – The load balancer TCP idle timeout. Default: Duration.seconds(350)

Return type:

NetworkListener

Returns:

The newly created listener

apply_removal_policy(policy)

Apply the given removal policy to this resource.

The Removal Policy controls what happens to this resource when it stops being managed by CloudFormation, either because you’ve removed it from the CDK application or because you’ve made a change that requires the resource to be replaced.

The resource can be deleted (RemovalPolicy.DESTROY), or left in your AWS account for data recovery and cleanup later (RemovalPolicy.RETAIN).

Parameters:

policy (RemovalPolicy) –

Return type:

None

Attributes

connections

The network connections associated with this resource.

Indicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink.

Default:

on

env

The environment this resource belongs to.

For resources that are created and managed by the CDK (generally, those created by creating new class instances like Role, Bucket, etc.), this is always the same as the environment of the stack they belong to; however, for imported resources (those obtained from static methods like fromRoleArn, fromBucketName, etc.), that might be different than the stack they were imported into.

ip_address_type

The type of IP addresses to use.

Default:

IpAddressType.IPV4

load_balancer_arn

The ARN of the load balancer that hosts the VPC Endpoint Service.

Attribute:

true

load_balancer_canonical_hosted_zone_id

The canonical hosted zone ID of this load balancer.

Example value: Z2P70J7EXAMPLE

Attribute:

true

load_balancer_dns_name

The DNS name of this load balancer.

Example value: my-load-balancer-424835706.us-west-2.elb.amazonaws.com

Attribute:

true

metrics

All metrics available for this load balancer.

node

The tree node.

security_groups

Security groups associated with this load balancer.

stack

The stack in which this resource is defined.

vpc

The VPC this load balancer has been created in (if available).