skillfed

aws-cdk.aws-lambda

The CDK Construct Library for AWS::Lambda

aws-cdk-aws-lambda v1.204.0 172.7K downloads/30d#10,329 on PyPI12,868
Permissive license Apache-2.0 Active released

What it is and what it does

This package provides CDK constructs for defining AWS Lambda functions and layers as Python objects within infrastructure-as-code stacks. It abstracts Lambda configuration—runtime, handler, code source, IAM roles, timeouts, and resource-based policies—into a declarative API that generates CloudFormation templates during synthesis.

The package supports multiple code deployment patterns: inline code strings (up to 4 KiB), local filesystem assets (zipped and uploaded to S3), S3 bucket references, and Docker image builds. It integrates with other AWS CDK modules (IAM, CloudWatch, ECR, S3) to manage permissions, monitoring, and artifact storage. However, AWS CDK v1 reached end-of-support on 2023-06-01 and is no longer maintained; new projects should use AWS CDK v2 instead.

Use it for:

  • Define Lambda functions with code from local directories or S3, automatically packaging and uploading assets during stack synthesis.
  • Configure Lambda execution roles and grant permissions to other AWS services or external principals using resource-based policies.
  • Set function timeouts and integrate with CloudWatch to monitor execution duration and create alarms.
  • Deploy Lambda functions from Docker images stored in ECR or built locally as CDK assets.
  • Manage Lambda versions and layers for canary deployments or shared code across multiple functions.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Defines AWS Lambda functions and layers as infrastructure-as-code constructs within AWS CDK v1, supporting multiple code sources and runtime configurations.

No—this is AWS CDK v1, which reached end-of-support on 2023-06-01 and receives no further updates. Install only if you are maintaining an existing v1 codebase. For new projects, use AWS CDK v2 instead. The package itself has low install friction and a permissive license, but the maintenance status makes it unsuitable for new development.

Install

aws-cdk-aws-lambda on PyPI

pip

pip install aws-cdk-aws-lambda

uv

uv add aws-cdk-aws-lambda

poetry

poetry add aws-cdk-aws-lambda

Installing aws-cdk.aws-lambda

Before you install

Low install friction with a pure-Python wheel. However, this is AWS CDK v1, which 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_lambda as lambda_
from aws_cdk import core as cdk
import os

fn = lambda_.Function(self, "MyFunction",
    runtime=lambda_.Runtime.PYTHON_3_9,
    handler="index.main",
    code=lambda_.Code.from_asset(os.path.join(os.path.dirname(__file__), "lambda-handler"))
)

Requires AWS CDK v1 core library and constructs package; AWS credentials and local filesystem access for asset bundling.

Verify before relying

  • Whether v1 receives any critical security patches despite end-of-support status.
  • Performance or compatibility implications of using v1 in new projects versus migrating to v2.

Package facts

License Apache-2.0 (permissive)
Python support supports the current Python release (~=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 23 — aws-cdk.aws-applicationautoscaling, aws-cdk.aws-cloudwatch, aws-cdk.aws-codeguruprofiler, aws-cdk.aws-ec2, aws-cdk.aws-ecr-assets, aws-cdk.aws-ecr, aws-cdk.aws-efs, aws-cdk.aws-events, aws-cdk.aws-iam, aws-cdk.aws-kms, aws-cdk.aws-logs, aws-cdk.aws-s3-assets, aws-cdk.aws-s3, aws-cdk.aws-signer, aws-cdk.aws-sns, aws-cdk.aws-sqs, aws-cdk.core, aws-cdk.cx-api, aws-cdk.region-info, constructs, jsii, publication, typeguard
Maintenance actively maintained — 1,152 days since the last release
Last repo commit
First released
Downloads 172,663/month — #10,329 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: aws_cdk.aws_lambda-1.204.0-py3-none-any.whl

Development Status :: 7 - InactiveFramework :: AWS CDKFramework :: AWS CDK :: 1Intended Audience :: DevelopersLicense :: OSI ApprovedOperating System :: OS IndependentProgramming Language :: JavaScriptProgramming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Typing :: Typed

Tags

aws lambda cdk constructdefine lambda functions as codecdk lambda infrastructureaws lambda deployment automationlambda handler code management
end-of-supportinfrastructure-as-codeaws-cdk-v1

More Build Tools packages

packaging

Provides reusable utilities for Python…

permissive · top 100 on PyPI

tqdm

Wraps any iterable to display a real-time…

copyleft · top 100 on PyPI

pip

pip is the standard installer for Python…

permissive · top 100 on PyPI

hatchling

Hatchling is a standards-compliant Python build…

permissive · top 100 on PyPI

grpcio-tools

Generates Python gRPC service stubs and message…

permissive · top 1,000 on PyPI

pre-commit

pre-commit is a framework for installing and…

permissive · top 1,000 on PyPI

aws-cdk.aws-lambda-python-alpha

Provides AWS CDK constructs for defining,…

permissive · top 5,000 on PyPI

aws-cdk.aws-s3

Defines AWS S3 buckets and related resources as…

permissive · top 15,000 on PyPI

aws-cdk.aws-cloudwatch

Defines CloudWatch metrics, alarms, and…

permissive · top 15,000 on PyPI

aws-cdk.asset-awscli-v1

Bundles AWS CLI v1 as a reusable asset for AWS…

permissive · top 5,000 on PyPI

kappa

Kappa is a command-line tool that automates the…

permissive · top 15,000 on PyPI

aws-cdk.lambda-layer-kubectl-v35

Provides a Lambda Layer packaging kubectl…

permissive · top 15,000 on PyPI

aws-cdk.aws-kms

Provides AWS CDK constructs for defining and…

permissive · top 15,000 on PyPI

aws-cdk.aws-iam

Provides Python constructs for defining AWS IAM…

permissive · top 15,000 on PyPI

aws-cdk.core

Provides the core construct classes and stack…

permissive · top 15,000 on PyPI

datadog-cdk-constructs-v2

Provides AWS CDK constructs to automatically…

permissive · top 15,000 on PyPI