BaseLoadBalancerProps Struct
Shared properties of both Application and Network Load Balancers.
Example
ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_ec2 as ec2 } from 'aws-cdk-lib';
import { aws_elasticloadbalancingv2 as elbv2 } from 'aws-cdk-lib';
declare const subnet: ec2.Subnet;
declare const subnetFilter: ec2.SubnetFilter;
declare const vpc: ec2.Vpc;
const baseLoadBalancerProps: elbv2.BaseLoadBalancerProps = {
vpc: vpc,
// the properties below are optional
crossZoneEnabled: false,
deletionProtection: false,
denyAllIgwTraffic: false,
internetFacing: false,
loadBalancerName: 'loadBalancerName',
minimumCapacityUnit: 123,
vpcSubnets: {
availabilityZones: ['availabilityZones'],
onePerAz: false,
subnetFilters: [subnetFilter],
subnetGroupName: 'subnetGroupName',
subnets: [subnet],
subnetType: ec2.SubnetType.PRIVATE_ISOLATED,
},
};
Properties
crossZoneEnabledbooleancross_zone_enabledboolcrossZoneEnabledBooleanCrossZoneEnabledboolCrossZoneEnabled*bool= false for Network Load Balancers…#Indicates whether cross-zone load balancing is enabled.
default
Default: false for Network Load Balancers and true for Application Load Balancers. This can not be false for Application Load Balancers.
deletionProtectionbooleandeletion_protectionbooldeletionProtectionBooleanDeletionProtectionboolDeletionProtection*bool= false#Indicates whether deletion protection is enabled.
denyAllIgwTrafficbooleandeny_all_igw_trafficbooldenyAllIgwTrafficBooleanDenyAllIgwTrafficboolDenyAllIgwTraffic*bool= false for internet-facing load b…#Indicates whether the load balancer blocks traffic through the Internet Gateway (IGW).
default
Default: false for internet-facing load balancers and true for internal load balancers
internetFacingbooleaninternet_facingboolinternetFacingBooleanInternetFacingboolInternetFacing*bool= false#Whether the load balancer has an internet-routable address.
loadBalancerNamestringload_balancer_namestrloadBalancerNameStringLoadBalancerNamestringLoadBalancerName*string= Automatically generated name.#Name of the load balancer.
minimumCapacityUnitnumberminimum_capacity_unitint | floatminimumCapacityUnitNumberMinimumCapacityUnitdoubleMinimumCapacityUnit*float64= undefined - ELB default is 0 LCU#The minimum capacity (LCU) for a load balancer.
vpcSubnetsSubnetSelectionvpc_subnetsSubnetSelectionvpcSubnetsSubnetSelectionVpcSubnetsSubnetSelectionVpcSubnetsSubnetSelection= the Vpc default strategy.#Which subnets place the load balancer in.