Registry / aws / aws-cdk-aws-sam

aws-cdk-aws-sam

JSON →
library1.204.0pypypiunverified

The CDK Construct Library for the AWS Serverless Application Model (SAM) resources. Version 1.204.0 is the latest release for CDK v1 (maintenance mode). This library is part of the AWS CDK v1 which entered maintenance on June 1, 2022 and will end support on June 1, 2025. Users are strongly encouraged to migrate to CDK v2 where SAM constructs are available via the 'aws-cdk-lib/aws-sam' module.

pip install aws-cdk-aws-sam==1.204.0
INSTALL
IMPORT
SIG · AWS-CDK-AWS-SAM
A
aws-cdk-aws-sam
awspythonv1.204.0
Install
3.5s avg
Import
Disk
29MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v1.204.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 29.6MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 3.5s · import 0.000s · 30MB
29MB installed
● package 29MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

CfnServerlessFunction
from aws_cdk.aws_sam import CfnServerlessFunction
from aws_cdk.aws_sam import CfnServerlessFunction

Basic CDK v1 SAM application with a Lambda function triggered by an API Gateway event.

from aws_cdk import core from aws_cdk.aws_sam import CfnServerlessFunction app = core.App() stack = core.Stack(app, "MySamStack") CfnServerlessFunction(stack, "MyFunction", code_uri="./", handler="index.handler", runtime="python3.9", events={ "MyApi": { "Type": "Api", "Properties": { "Path": "/hello", "Method": "GET" } } } ) app.synth()
cdk --version
Debug
Known issues
deprecatedCDK v1 is in maintenance mode and will reach end-of-life on June 1, 2025. All active development has shifted to CDK v2.
fix
Migrate to CDK v2: replace 'aws-cdk-aws-sam' with 'aws-cdk-lib/aws-sam'.
affects: all
breakingIn CDK v2, SAM constructs are no longer in a separate package. Import paths and class names may differ. The package 'aws-cdk-aws-sam' does not exist for CDK v2.
fix
Use 'from aws_cdk.aws_sam import ...' via 'aws-cdk-lib' (v2) or install 'aws-cdk-lib' directly.
affects: >=2.0.0
gotchaThe SAM package is only compatible with CDK v1. If you install both v1 and v2 packages in the same environment, you may encounter import conflicts.
fix
Use a virtual environment and install only one CDK version.
affects: all
deprecatedThe 'aws-cdk-aws-sam' package will not receive new features; only critical bug fixes.
fix
Evaluate migration to CDK v2 for ongoing support.
affects: all
Upgrade
Version history
1.204.0latest on PyPI · released Jun 19, 2023
Audit
Dependencies
aws-cdk-librequiredCDK v1 runtime required; SAM constructs depend on core CDK library
constructsrequiredFoundation for CDK constructs
Agent activity
49 hits · last 30 days
node
44
OpenAI (training)
2
Resources
aws-cdk-aws-sam — pip install aws-cdk-aws-sam · libregistry