--- id: aws-cdk-aws-elasticloadbalancingv2 version: "1.204.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # aws-cdk.aws-elasticloadbalancingv2 — The CDK Construct Library for AWS::ElasticLoadBalancingV2 License: permissive · Maintenance: active · Downloads: 154.9K/mo ## What it is and what it does This package provides Python constructs for the AWS CDK v1 framework that abstract AWS Elastic Load Balancing V2 resources—Application Load Balancers (ALBs) and Network Load Balancers (NLBs)—into reusable, composable components. You instantiate a load balancer, attach listeners on specific ports, define target groups, and wire routing rules (including path-based, host-based, and weighted routing) without writing CloudFormation templates directly. The package depends on 15 other AWS CDK modules (core, EC2, IAM, Lambda, Route53, S3, CloudWatch, Certificate Manager, and others) to provide the full infrastructure abstraction layer. However, AWS CDK v1 reached end-of-support on 2023-06-01 and is no longer receiving updates; the maintainers strongly recommend migrating to AWS CDK v2 for ongoing support and new features. Use it for: - Define an internet-facing ALB with HTTP/HTTPS listeners and route traffic to Auto Scaling groups based on hostname or URL path. - Create an NLB for ultra-high-performance, low-latency load balancing of TCP/UDP traffic across multiple availability zones. - Set up listener conditions and weighted target groups to implement canary deployments or A/B testing within infrastructure code. - Configure OIDC authentication at the load balancer level before forwarding requests to application targets. - Automatically manage security group rules between load balancers and targets without manual network configuration. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides AWS CDK constructs for defining and configuring Application and Network Load Balancers in Python, enabling infrastructure-as-code deployment of load balancing resources. No—unless you are maintaining an existing AWS CDK v1 codebase. This package is end-of-support as of 2023-06-01 and receives no updates. New projects should use AWS CDK v2's equivalent load balancer constructs instead. If you are already on v1, the package is stable and has no known vulnerabilities, but migration is strongly recommended. ## Install pip install aws-cdk-aws-elasticloadbalancingv2 uv add aws-cdk-aws-elasticloadbalancingv2 poetry add aws-cdk-aws-elasticloadbalancingv2 ## Installing aws-cdk.aws-elasticloadbalancingv2 Before you install: Low install friction with a pure-Python wheel. However, this is an AWS CDK v1 package that reached end-of-support on 2023-06-01 and is no longer being updated; users should migrate to AWS CDK v2 instead. License in practice: Licensed under Apache-2.0 (permissive), allowing commercial use, modification, and distribution with minimal restrictions. Quickstart: from aws_cdk import aws_elasticloadbalancingv2 as elbv2 from aws_cdk import aws_ec2 as ec2 lb = elbv2.ApplicationLoadBalancer(self, "LB", vpc=vpc, internet_facing=True ) listener = lb.add_listener("Listener", port=80, open=True) listener.add_targets("Targets", port=8080, targets=[asg]) Requires an AWS CDK environment set up with a VPC and compute targets (e.g., AutoScaling group) already defined in the same stack. Verify before relying: - Whether migration tooling or compatibility layers exist to ease transition from v1 to v2. - Current adoption rate and community support for v1 despite end-of-support status. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 154.9K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags aws load balancer cdk, application load balancer construct, network load balancer python, elastic load balancing v2, aws cdk alb nlb, load balancer infrastructure code, aws elasticloadbalancingv2, aws-cdk, infrastructure-as-code, end-of-support [View on SkillFed](https://skillfed.io/packages/aws-cdk-aws-elasticloadbalancingv2) · [View on PyPI](https://pypi.org/project/aws-cdk-aws-elasticloadbalancingv2/)