03 / 07

What are Lambda versions and aliases?

Difficulty: 6/10
versioning, aliases, deployment

Lambda versions and aliases provide a mechanism for managing and deploying function updates safely. Versions allow you to freeze the code and configuration of a function at a specific point in time, while aliases act as pointers to a specific version, enabling better deployment workflows, traffic shifting, and version management.

Lambda Versions
  1. 1

    Each version is immutable—once published, it cannot be changed.

  2. 2

    Version $LATEST refers to the most recently updated code/configuration.

  3. 3

    Useful for tracking and rolling back changes.

  4. 4

    Can be created via the Console, CLI, SDK, or IaC tools.

Lambda Aliases
  1. 1

    An alias is a named reference to a specific function version (e.g., 'prod', 'dev').

  2. 2

    Aliases can be updated to point to a different version without changing the code.

  3. 3

    You can split traffic between two versions using weighted aliases (e.g., 90% to v1, 10% to v2).

  4. 4

    Helps with canary deployments and blue/green deployments.

Create a Version and Alias Using AWS CLI

Scenario Questions

0-2 years experience

  1. 1You need to deploy a bug‑fix to a Lambda function without disrupting existing traffic. How would you use versions and aliases to achieve this?
  2. 2If you publish a new version but forget to update the alias that API Gateway uses, what will a client see when it calls the endpoint?
  3. 3After a faulty deployment, how would you roll back to a previous version using an alias?

2-5 years experience

  1. 1During a blue‑green rollout you notice the 'prod' alias still points to the old version after you updated it. What could cause this and how would you debug it?
  2. 2Why might a team create separate aliases for dev, staging, and prod instead of separate Lambda functions?
  3. 3Your CloudWatch logs show an invocation failed with a version ARN you didn't expect. How would you trace the source of that mismatch?

5-8 years experience

  1. 1At high request volume you want to roll out a new version gradually without causing cold‑start spikes. How would you use weighted alias routing to manage the rollout?
  2. 2Publishing many versions can hit Lambda limits. What strategy would you use to clean up old versions while keeping rollback capability?
  3. 3When a Step Functions workflow references a Lambda, how does using an alias versus a fixed version affect maintainability and version drift?

8+ years experience

  1. 1Your org is moving to a microservice architecture with dozens of Lambdas. How would you design a version and alias strategy across teams to balance stability and rapid iteration?
  2. 2A legacy system invokes Lambdas by name (no version). Propose a migration plan to adopt version‑based deployments with aliases while minimizing downtime.
  3. 3Design a CI/CD pipeline that automatically publishes versions, updates aliases, and enforces a policy that no alias points to a version that fails integration tests, across multiple AWS accounts.

Follow-up Questions

  • What are the service limits for the number of versions and aliases per function?
  • Can an alias route traffic to multiple versions at the same time?
  • Does using an alias change the cold‑start characteristics of a Lambda invocation?
Share

Share via WhatsApp, X, Facebook, LinkedIn or copy link. Open Graph preview enabled.