Versioning and Aliases for Safe Releases
Learn how Lambda versions and aliases let you publish immutable releases, point traffic at them, and roll out changes gradually.
Versioning and Aliases for Safe Releases is a free Serverless AWS Lambda Development lesson on CoddyKit — lesson 4 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Serverless AWS Lambda Development learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
The Problem with $LATEST
Every function has a mutable $LATEST version. Deploying overwrites it instantly, leaving no easy rollback. Versions solve this.
Immutable Versions
Publishing creates a numbered, immutable snapshot of code and configuration. Version 3 will always be exactly what you published.
aws lambda publish-version \
--function-name ordersWhat an Alias Is
An alias is a named pointer to a version, such as prod or staging. Clients invoke the alias, and you re-point it without changing callers.
Creating an Alias
Create an alias that points to a specific version. Move it later to promote a new release.
aws lambda create-alias \
--function-name orders \
--name prod \
--function-version 3Invoking via Alias
Callers reference the alias by qualifier. The actual version is decided by the alias, decoupling clients from deploys.
aws lambda invoke \
--function-name orders:prod \
out.jsonWeighted Aliases
An alias can split traffic between two versions by weight, enabling canary deployments where a small percentage tries the new version.
aws lambda update-alias \
--function-name orders \
--name prod \
--function-version 4 \
--routing-config '{"AdditionalVersionWeights":{"3":0.9}}'Reading the Weight Config
In the example, version 4 receives 10 percent of traffic while version 3 keeps 90 percent. Increase the weight as confidence grows.
Instant Rollback
If the new version misbehaves, repoint the alias to the previous version. Rollback is immediate because old versions still exist.
Versioned Permissions
You can grant invoke permission on a specific alias, so staging callers cannot accidentally hit production code.
Environment Per Alias
Aliases can carry their own environment variable overrides, letting staging point at test resources while prod uses live ones.
Automate with CodeDeploy
AWS CodeDeploy can shift alias traffic automatically using canary or linear strategies, with CloudWatch alarms triggering automatic rollback.
Quick Check
Test your release knowledge.
Recap
You learned to publish immutable versions, point aliases at them, run weighted canary rollouts, and roll back instantly by re-pointing the alias.
Frequently asked questions
Is the “Versioning and Aliases for Safe Releases” lesson free?
Yes — the full text of “Versioning and Aliases for Safe Releases” is free to read here on the web, and the Serverless AWS Lambda Development course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Serverless AWS Lambda Development course, upgrade to CoddyKit PRO.
What will I learn in “Versioning and Aliases for Safe Releases”?
Learn how Lambda versions and aliases let you publish immutable releases, point traffic at them, and roll out changes gradually. You practise Serverless AWS Lambda Development with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Serverless AWS Lambda Development?
No prior experience is required. Serverless AWS Lambda Development on CoddyKit is structured for beginners through advanced learners; this is — lesson 4 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Versioning and Aliases for Safe Releases” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Serverless AWS Lambda Development lesson?
Yes. Every Serverless AWS Lambda Development lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Understanding Lambda Runtime & Layers
- Environment Variables and Configuration
- IAM Roles for Lambda Security
- Versioning and Aliases for Safe Releases