skillfed

aws-cdk-lib

Version 2 of the AWS Cloud Development Kit library

aws-cdk-lib v2.265.0 7.6M downloads/30d#1,721 on PyPI12,868
Permissive license Apache-2.0 Active released

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 on this page — 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

aws-cdk-lib on PyPI

pip

pip install aws-cdk-lib

uv

uv add aws-cdk-lib

poetry

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 the current Python release (>=3.10)
Install friction low — pure-Python wheel
Runtime dependencies 6 — aws-cdk.asset-awscli-v1, aws-cdk.asset-node-proxy-agent-v6, aws-cdk.cloud-assembly-schema, constructs, jsii, publication
Maintenance actively maintained — 1 days since the last release
Last repo commit
First released
Downloads 7,577,580/month — #1,721 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aws_cdk_lib-2.265.0-py3-none-any.whl

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: OS IndependentProgramming Language :: JavaScriptProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Typing :: Typed

Tags

infrastructure as code AWScloudformation pythonaws cloud deploymentdefine aws resources programmaticallycdk constructs libraryaws infrastructure automation
infrastructure-as-codeaws-cloudcloudformation

More Build Tools packages