aws-cdk-examples, read against today's AWS
aws-samples/aws-cdk-examples is AWS's official list of CDK example code: 5,600 stars, 273 contributors, and a commit two weeks ago (6408f42, 22 September 2026). The README calls it "an intermediate learning resource", to be read after the Developer Guide and the CDK Workshop. Each example shows "a common service implementation, or infrastructure pattern".This page reads it for one question: if you copy an example today, does it deploy against current AWS, using only what AWS offers?
The short answer has two halves:
- The library side is well maintained. Every TypeScript example pins
aws-cdk-lib2.262.1 (one pins 2.268.0), and every Python example requiresaws-cdk-lib>=2.262.0. A multi-language dependency updater was added three months ago (scripts/, PR #1301). No example imports CDK v1. The four@aws-cdk/...imports are v2 alpha modules (aws-lambda-python-alpha,aws-neptune-alpha). - The service side is not. The updater bumps packages. It does not touch the runtime and engine constants inside the code, and those are what AWS retires.
The numbers
| count | |
|---|---|
| example directories | 202 — TypeScript 79, Python 64, Java 22, Go 20, C# 17 |
| distinct example names across languages | 147 |
| … present in all five languages | 2 (classic-load-balancer, lambda-cron) |
| … present in exactly one language | 117 (49 TypeScript-only, 45 Python-only) |
| examples whose Lambda runtime is blocked at create | 15 |
| examples on a runtime already deprecated, still creatable until 29 July 2027 | 20 |
| examples using RemovalPolicy.DESTROY | 57 |
| examples opening port 22 to 0.0.0.0/0 | 4 (one of them, an SFTP server, by design) |
15 examples ask Lambda for a runtime it no longer creates
The Lambda runtime table has three dates per retired runtime: deprecation, block function create, and block function update. After "block function create",
CreateFunction refuses that runtime. A new stack built from these examples fails at the first Lambda function.| runtime in the code | Lambda blocked create on | examples |
|---|---|---|
| PYTHON_3_6 | 18 July 2022 | go/lambda-cron, python/lambda-layer |
| PYTHON_3_7 | 9 January 2024 | python/api-cors-lambda, python/cross-stack-resources, python/ec2-alarms-to-opsitem, python/image-content-search, python/lambda-layer, python/lambda-s3-trigger, python/lambda-triggered-by-existing-kinesis-stream, python/lambda-with-existing-s3-code, python/serverless-backend, python/url-shortener, csharp/elasticbeanstalk |
| DOTNET_CORE_3_1 | 3 April 2023 | csharp/apigateway-cognito-lambda-dynamodb |
| JAVA_8 (java8, Amazon Linux 1) | 8 February 2024 | java/api-cors-lambda-crud-dynamodb, java/s3-lambda-s3 |
That is 15 distinct examples;
python/lambda-layer appears twice, using both 3.6 and 3.7. Ten of the 64 Python examples are in the table.The fix in each is one constant:
- Python:
PYTHON_3_13or later. Lambda's table gives 3.13 and 3.14 a deprecation date of 30 June 2029. - .NET:
DOTNET_8or later. Note that .NET 8's own deprecation date is 10 November 2026. - Java:
JAVA_21.
Function code written for Python 3.7 usually runs on 3.13. Code using
distutils or other removed modules does not, so test before bumping.Already deprecated, still creatable until 29 July 2027:
| runtime | deprecated | examples |
|---|---|---|
| PYTHON_3_8 | 14 October 2024 | python/api-eventbridge-lambda, python/api-stages-lambda, python/rekognition-lambda-s3-trigger, python/s3-object-lambda |
| PYTHON_3_9 | 15 December 2025 | python/apigw-http-api-lambda-dynamodb-python-cdk, python/opensearch, python/s3-sns-sqs-lambda-chain, python/stepfunctions, java/eventbridge-lambda, java/lambda-cron, go/step-functions |
| NODEJS_18_X | 1 September 2025 | python/codepipeline-build-deploy, python/codepipeline-build-deploy-github-manual, go/codepipeline-build-deploy |
| NODEJS_20_X | 30 April 2026 | python/amazon-verified-permissions-rest-api, csharp/my-widget-service, csharp/random-writer, java/my-widget-service |
| PROVIDED_AL2 | 31 July 2026 | go/restapi-lambda, go/sqs-lambda |
Due soon:
PYTHON_3_10 on 31 October 2026, and DOTNET_8 on 10 November 2026.The most common runtimes in the repository are current:
NODEJS_24_X (29 uses), PYTHON_3_12 (18), NODEJS_LATEST (12), PYTHON_3_14 (9). The examples written or refreshed recently are fine. The table above is the long tail nobody revisited.Enjoyed reading this content? Let the author know!
Your likes, comments, shares, and saves help creators reach more builders.
Loading recommendations
Loading article