AWS Builder Center

aws-cdk-examples

aws-cdk-examples

he 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_13  or later. Lambda's table gives 3.13 and 3.14 a deprecation date of 30 June 2029.
  • .NET:  DOTNET_8  or 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.

Engine and cluster versions that have moved on

pinned in the code
example
status, from AWS documentation
 KubernetesVersion.V1_21 
 typescript/aiops-eks-workshop 
not offered by EKS — the oldest version in extended support is 1.31; standard support covers 1.34 to 1.37
 KubernetesVersion.V1_34 
 typescript/eks ,  go/eks ,  java/eks 
current; standard support ends 2 December 2026
 AuroraMysqlEngineVersion.VER_2_10_1 
 python/rds 
Aurora MySQL version 2 (MySQL 5.7) left standard support on 31 October 2024; the release calendar lists only 2.11 and 2.12 for extended support
 AuroraMysqlEngineVersion.VER_5_7_12 
 python/image-content-search ,  python/new-vpc-alb-asg-mysql 
the Aurora MySQL 5.7-compatible engine — past standard support
 AuroraMysqlEngineVersion.VER_3_04_0 
 typescript/rds  (Aurora)
3.04 LTS — standard support ends 31 October 2026
 AuroraMysqlEngineVersion.VER_3_03_0 
 typescript/aws-codepipeline-ecs-lambda 
3.03 — not in the current Aurora MySQL release calendar (check)
 MysqlEngineVersion.VER_5_7_30 
 python/new-vpc-alb-asg-mysql 
RDS for MySQL 5.7 — past standard support (check the RDS for MySQL calendar)
 MysqlEngineVersion.VER_8_0_16 ,  VER_8_0_28 
 python/docker-app-with-asg-alb ;  python/rds ,  typescript/rds 
old 8.0 minors; RDS retires minor versions on its own schedule (check before deploying)
 EngineVersion.OPENSEARCH_1_3 ,  OPENSEARCH_2_3 
 python/opensearch ,  python/opensearch-simple-domain 
old OpenSearch versions (check OpenSearch Service's version support)
The pattern is the same as the runtimes. A version constant is correct the day an example is written, and nothing in the repository's automation looks at it again.

Language parity: the stated aim, and where it is

The README says the repository is "subdivided into sections for each language… with the ultimate aim of complete language parity". Counted by directory name, of the 147 distinct examples:
  • 2 exist in all five languages;
  • 4 in four, 11 in three, 13 in two;
  • 117 in only one.
So the repository is better read as five independent collections that share a few names. The practical consequence: an example in your language may not exist, and the TypeScript and Python collections are where most patterns live (79 and 64 examples).

Two security defaults worth not copying

SSH from anywhere. Four examples add an ingress rule for TCP 22 from  0.0.0.0/0 :
  •  csharp/ec2-instance 
  •  csharp/ec2-instance-dev-server 
  •  python/ssh-into-emr-cluster 
  •  typescript/aws-transfer-sftp-server  — an SFTP endpoint, where that is the point
For the other three, the AWS-native alternatives need no open port:
  • Systems Manager Session Manager;
  • an EC2 Instance Connect Endpoint, which the repository itself demonstrates in  typescript/ec2-instance-connect-endpoint .
Public buckets.  csharp/static-site  and  typescript/static-site-basic  set public read access on the S3 bucket. The CloudFront-fronted pattern — a private bucket with origin access control — is what AWS recommends for a static site, and is what  typescript/static-site  (without  -basic ) uses. Read the two side by side; the basic one is the shortcut.
 RemovalPolicy.DESTROY  in 57 examples is the right default for samples — a learner's  cdk destroy  should leave nothing billing behind. It is the first line to change before an example becomes a real stack.
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article