LoadBalancer
Source:
src/AWS/ELBv2/LoadBalancer.ts
An ELBv2 (Application / Network / Gateway) load balancer.
Creating a Load Balancer
Section titled “Creating a Load Balancer”Internet-facing Application Load Balancer
const lb = yield* LoadBalancer("web", { type: "application", scheme: "internet-facing", subnets: [subnet1.subnetId, subnet2.subnetId], securityGroups: [sg.groupId],});Network Load Balancer with static EIPs
const nlb = yield* LoadBalancer("edge", { type: "network", scheme: "internet-facing", subnetMappings: [ { subnetId: subnet1.subnetId, allocationId: eip1.allocationId }, { subnetId: subnet2.subnetId, allocationId: eip2.allocationId }, ],});Attributes
Section titled “Attributes”const lb = yield* LoadBalancer("web", { type: "application", subnets: [subnet1.subnetId, subnet2.subnetId], attributes: { "idle_timeout.timeout_seconds": "120", "deletion_protection.enabled": "true", },});