Versions, aliases, and traffic shifting
1. Deployment strategies: versions, aliases and traffic shifting
In this video, you'll learn how to deploy Lambda safely using versions and aliases, and how to shift traffic gradually so you can detect issues and roll back quickly.2. Why deployment strategy matters
If a release has a bug, you want to detect it quickly, limit blast radius, and recover fast. That's what versions, aliases, and traffic shifting help you do.3. $LATEST vs published versions
$LATEST moves every time you update code. Published versions are immutable snapshots, which makes them easy to pin for rollbacks and traffic splitting.4. A version is an immutable snapshot
Treat versions like release artifacts: each published version captures code and configuration. Once published, it doesn't change, so you can always return to a known-good state.5. Aliases are stable pointers
An alias is a stable pointer. Instead of calling a version directly, you invoke a stable alias name, and you can update where that alias points without changing callers.6. Dev and prod aliases
Aliases are great for environments. You can move dev frequently, and promote a tested version to prod by moving the prod alias.7. Traffic shifting with weighted aliases
Weighted alias routing lets you test in production safely. A stable alias can keep most traffic on the current version while sending a small percentage to a candidate version.8. Canary step 1: 90/10
This is a classic canary: 90% stays on the current version, 10% tests the candidate under real load, and you watch errors and latency before moving further.9. Canary step 2: 50/50
If the 10% slice looks good, you can increase the weight. At 50/50, issues will show up fast, so monitoring matters.10. Canary step 3: 100% new
Once you're confident, route all traffic to the new version. The old version is still there, which makes rollback simple.11. Blue/green mental model
Blue/green is the same idea: blue is the current stable version, green is the new candidate, and the alias controls which one users hit. Weighted routing just makes the switch gradual.12. Rollback = move the alias back
Rollback is simple: remove the canary weight or move the alias back to the last known-good version. No redeploy is required, you can recover in seconds instead of hours, and that is why immutable versions and stable aliases work so well together.13. Monitor during the shift
Traffic shifting works only if you watch the right signals. Monitor errors, timeouts, duration, tail latency, and throttles if you use caps so you can pause or roll back quickly.14. Common pitfall: treating $LATEST as prod
If you rely on $LATEST in production, you lose predictability. Versions and aliases make it clear what code is running and make rollbacks safe.15. Safe deploy checklist
A simple workflow is: publish version, shift traffic gradually with an alias, monitor the results, and keep rollback ready at every step.16. Key takeaways
Use versions for predictability, aliases for stability, and weighted routing for safety. Then rollback is just changing a pointer.17. Let's practice!
Next, you'll practice publishing versions, moving a stable alias between them, then sending 10% of traffic to a candidate version and rolling back by updating the alias.Create Your Free Account
or
By continuing, you accept our Terms of Use, our Privacy Policy and that your data is stored in the USA.