Define a new network load balancer.
import { NetworkLoadBalancer } from 'aws-cdk-lib/aws-elasticloadbalancingv2';Or use the module namespace:
import * as elasticloadbalancingv2 from 'aws-cdk-lib/aws-elasticloadbalancingv2';
// elasticloadbalancingv2.NetworkLoadBalancerConfiguration passed to the constructor as NetworkLoadBalancerProps.
clientRoutingPolicyOptionalClientRoutingPolicyThe AZ affinity routing policy.
Default: - AZ affinity is disabled.
disableSecurityGroupsOptionalbooleanCreate a Network Load Balancer without security groups. When true, creates an NLB that cannot have security groups attached. This is useful when you need to create a traditional NLB without security group associations. This property only takes effect when the feature flag `@aws-cdk/aws-elasticloadbalancingv2:networkLoadBalancerWithSecurityGroupByDefault` is enabled.
Default: false
enablePrefixForIpv6SourceNatOptionalbooleanIndicates whether to use an IPv6 prefix from each subnet for source NAT. The IP address type must be IpAddressType.DUALSTACK.
Default: undefined - NLB default behavior is false
enforceSecurityGroupInboundRulesOnPrivateLinkTrafficOptionalbooleanIndicates whether to evaluate inbound security group rules for traffic sent to a Network Load Balancer through AWS PrivateLink.
Default: true
ipAddressTypeOptionalIpAddressTypeThe type of IP addresses to use. If you want to add a UDP or TCP_UDP listener to the load balancer, you must choose IPv4.
Default: IpAddressType.IPV4
securityGroupsOptionalISecurityGroup[]Security groups to associate with this load balancer.
Default: - No security groups associated with the load balancer.
subnetMappingsOptionalSubnetMapping[]Subnet information for the load balancer.
Default: undefined - The VPC default strategy for subnets is used
zonalShiftOptionalbooleanIndicates whether zonal shift is enabled.
Default: false
BaseLoadBalancerPropsvpcRequiredinherited from BaseLoadBalancerPropsIVpcThe VPC network to place the load balancer in.
crossZoneEnabledOptionalinherited from BaseLoadBalancerPropsbooleanIndicates whether cross-zone load balancing is enabled.
Default: - false for Network Load Balancers and true for Application Load Balancers.
This can not be `false` for Application Load Balancers.
deletionProtectionOptionalinherited from BaseLoadBalancerPropsbooleanIndicates whether deletion protection is enabled.
Default: false
denyAllIgwTrafficOptionalinherited from BaseLoadBalancerPropsbooleanIndicates whether the load balancer blocks traffic through the Internet Gateway (IGW).
Default: - false for internet-facing load balancers and true for internal load balancers
internetFacingOptionalinherited from BaseLoadBalancerPropsbooleanWhether the load balancer has an internet-routable address.
Default: false
loadBalancerNameOptionalinherited from BaseLoadBalancerPropsstringName of the load balancer.
Default: - Automatically generated name.
minimumCapacityUnitOptionalinherited from BaseLoadBalancerPropsnumberThe minimum capacity (LCU) for a load balancer.
Default: undefined - ELB default is 0 LCU
vpcSubnetsOptionalinherited from BaseLoadBalancerPropsSubnetSelectionWhich subnets place the load balancer in.
Default: - the Vpc default strategy.
Everything you need to know about Elastic Load Balancing V2 on one page. HD quality, print-friendly.
Download Free Infographicaws-elasticloadbalancingv2