AWS Builder Center

aws-cdk-examples, read against today's AWS

aws-cdk-examples, read against today's AWS

runtimedeprecatedexamples
PYTHON_3_814 October 2024python/api-eventbridge-lambda, python/api-stages-lambda, python/rekognition-lambda-s3-trigger, python/s3-object-lambda
PYTHON_3_915 December 2025python/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_X1 September 2025python/codepipeline-build-deploy, python/codepipeline-build-deploy-github-manual, go/codepipeline-build-deploy
NODEJS_20_X30 April 2026python/amazon-verified-permissions-rest-api, csharp/my-widget-service, csharp/random-writer, java/my-widget-service
PROVIDED_AL231 July 2026go/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 codeexamplestatus, from AWS documentation
KubernetesVersion.V1_21typescript/aiops-eks-workshopnot offered by EKS — the oldest version in extended support is 1.31; standard support covers 1.34 to 1.37
KubernetesVersion.V1_34typescript/eks, go/eks, java/ekscurrent; standard support ends 2 December 2026
AuroraMysqlEngineVersion.VER_2_10_1python/rdsAurora 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_12python/image-content-search, python/new-vpc-alb-asg-mysqlthe Aurora MySQL 5.7-compatible engine — past standard support
AuroraMysqlEngineVersion.VER_3_04_0typescript/rds (Aurora)3.04 LTS — standard support ends 31 October 2026
AuroraMysqlEngineVersion.VER_3_03_0typescript/aws-codepipeline-ecs-lambda3.03 — not in the current Aurora MySQL release calendar (check)
MysqlEngineVersion.VER_5_7_30python/new-vpc-alb-asg-mysqlRDS for MySQL 5.7 — past standard support (check the RDS for MySQL calendar)
MysqlEngineVersion.VER_8_0_16, VER_8_0_28python/docker-app-with-asg-alb; python/rds, typescript/rdsold 8.0 minors; RDS retires minor versions on its own schedule (check before deploying)
EngineVersion.OPENSEARCH_1_3, OPENSEARCH_2_3python/opensearch, python/opensearch-simple-domainold 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.

Reading an example safely, in four checks

  1. Lambda runtime: grep for Runtime. / Runtime_ and compare against Lambda's supported-runtimes table. Anything older than Python 3.12, Node.js 22 or Java 17 deserves a look.
  2. Engine and cluster versions: grep for EngineVersion and KubernetesVersion. Replace any pin with a currently supported version, or remove it where the construct has a sensible default.
  3. Ingress rules: grep for anyIpv4 / any_ipv4. Replace SSH-from-anywhere with Session Manager.
  4. Removal policies: decide per resource before the first production deploy; DESTROY on a database or a bucket of user data is a data-loss setting.
All four are mechanical, which is also why they would fit in the repository's CI. A check that fails a pull request on a runtime Lambda blocks at create would have caught all 15 examples in the first table.
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