The app is three lines of Java. The path that ships it is the point.
Writing a Hello World Lambda takes five minutes. Shipping it like a real service is the hard part, so this article shows that path, mostly in pictures. Everything is in the aws-cdk-path-to-production repo.
Two kinds of code
The application and infrastructure have separate build pipelines. CDK brings them together during synthesis, and CloudFormation deploys the resulting infrastructure.
This is the entire app:
return new APIGatewayProxyResponseEvent()
.withStatusCode(200)
.withBody("Hello, World!");
Three pipelines
App CI builds and tests the Java code, and publishes a versioned JAR when we tag a release. Infra CI validates the infrastructure independently. Only the Release pipeline deploys to AWS.
A tag publishes the JAR once, and a pull request pins which version ships:
LAMBDA_VERSION=1.2.3
LAMBDA_SHA256=<digest printed by App CI>
Bootstrap, then deploy
cdk bootstrap prepares each AWS account once. cdk synth only writes templates; cdk deploy is what changes AWS.
No stored AWS keys
GitHub vouches for the job, and AWS returns credentials that expire within an hour. Each environment has its own role, so Dev can't sign in as Prod.
Gated promotion
Same JAR, same infrastructure code, environment-specific templates. CDK synthesizes them once for the release, and the pipeline promotes that release through Dev → QA → Prod. A failed gate stops the release, but it doesn't roll back what's already deployed.
What's real today
The lesson
The app is Hello World. The value is the path that delivers it: swap in a real service, and the pipelines, the pin and the gates stay the same.
riteshbangal
/
aws-cdk-path-to-production
The path from commit to production for a serverless app on AWS: versioned artifacts, AWS CDK infrastructure in Java, GitHub Actions with OIDC, and gated Dev → QA → Prod promotion. The app is deliberately a Hello World so the delivery path stays the focus.
AWS CDK: the path to production
The path from commit to production for a serverless app on AWS: versioned artifacts, AWS CDK infrastructure in Java, GitHub Actions with OIDC, and gated Dev → QA → Prod promotion.
The app is deliberately a Hello World, so the delivery path stays the focus.
Read the walkthrough: Hello World, the Production Way on DEV.
One release, from commit to production. A static version is also available.
What's in here
app/ The payload: a Java 21 Lambda that returns "Hello, World!"
infrastructure/ AWS CDK in Java: API Gateway + Lambda, with unit tests
lambda-artifact.env The release pin: which JAR version (and SHA-256) to deploy
foundation/ One-time AWS setup: the role GitHub Actions signs in to (OIDC)
scripts/ Fetch/publish the JAR, synth + lint, smoke and QA checks
.github/workflows/ app-ci · infra-ci · release (+ reusable deploy-environment)
docs/ The reasoning behind each piece, and the…







Top comments (0)