--- id: aws-cdk-aws-lambda version: "1.204.0" license: Apache-2.0 license_treatment: permissive maintenance: active --- # aws-cdk.aws-lambda — The CDK Construct Library for AWS::Lambda License: permissive · Maintenance: active · Downloads: 172.7K/mo ## 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 above — 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 pip install aws-cdk-aws-lambda uv add aws-cdk-aws-lambda 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_current - Install friction: low - Maintenance: active - Downloads: 172.7K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags aws lambda cdk construct, define lambda functions as code, cdk lambda infrastructure, aws lambda deployment automation, lambda handler code management, end-of-support, infrastructure-as-code, aws-cdk-v1 [View on SkillFed](https://skillfed.io/packages/aws-cdk-aws-lambda) · [View on PyPI](https://pypi.org/project/aws-cdk-aws-lambda/)