03 / 07

What are Lambda versions and aliases?

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