--- id: aws-cdk-lib version: "2.265.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # aws-cdk-lib — Version 2 of the AWS Cloud Development Kit library License: permissive · Maintenance: active · Downloads: 7.6M/mo ## What it is and what it does aws-cdk-lib is the core construct library for AWS CDK v2, a framework for defining cloud infrastructure in Python code rather than CloudFormation templates directly. It provides high-level abstractions (constructs) that map to AWS resources and services, letting you organize deployments into Stacks (physical CloudFormation units) and Stages (logical application instances). The library handles synthesis—converting your Python definitions into CloudFormation JSON—and manages asset handling, role configuration, and deployment orchestration through pluggable synthesizers. You write Python classes that inherit from Stack, instantiate constructs for the AWS resources you need, and then synthesize and deploy. It supports both classic and barrel imports for different coding styles. The package depends on constructs (the base abstraction layer), jsii (for language bindings), and AWS CDK asset packages for CLI and Node.js tooling integration. Use it for: - Define multi-environment deployments by instantiating the same Stack class with different configurations for dev, staging, and production. - Build reusable infrastructure libraries as construct subclasses that teams can share across projects. - Manage complex infrastructure organized across multiple stacks without writing raw CloudFormation. - Automate infrastructure changes through version control and CI/CD pipelines using Python code review workflows. - Separate stateful and stateless resources into different stacks for independent lifecycle management. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides Python APIs to define and deploy AWS cloud infrastructure as code, organizing resources into stacks and stages that synthesize to CloudFormation. Yes. aws-cdk-lib is production-stable (Development Status 5), actively maintained with recent updates, has no known vulnerabilities, and low installation friction. It is the standard library for Python-based AWS CDK v2 projects. Install it if you are building infrastructure-as-code applications on AWS and prefer Python over CloudFormation templates. ## Install pip install aws-cdk-lib uv add aws-cdk-lib poetry add aws-cdk-lib ## Installing aws-cdk-lib Before you install: Low friction installation with a pure-Python wheel. Actively maintained with a recent release (1 day old) and 12868 repository stars. Requires Python 3.10 or later. License in practice: Licensed under Apache-2.0 (permissive), allowing commercial and private use with minimal restrictions. Quickstart: pip install aws-cdk-lib constructs from aws_cdk import Stack, App from aws_cdk import aws_s3 as s3 app = App() stack = Stack(app, "MyStack") s3.Bucket(stack, "MyBucket") Requires Python 3.10 or later; AWS credentials and bootstrap configuration needed for actual deployment. Verify before relying: - Whether the package handles all AWS service APIs or if some require separate modules. - Performance characteristics when synthesizing large stacks with hundreds of resources. ## Package facts - License: Apache-2.0 (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 7.6M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags infrastructure as code AWS, cloudformation python, aws cloud deployment, define aws resources programmatically, cdk constructs library, aws infrastructure automation, infrastructure-as-code, aws-cloud, cloudformation [View on SkillFed](https://skillfed.io/packages/aws-cdk-lib) · [View on PyPI](https://pypi.org/project/aws-cdk-lib/)