Create Versions and Aliases of Lambda Function

A cool feature of lambda feature is that versions of the lambda function can be created and saved. This is very useful as applications can be built with one version of the code and then subsequent versions can be added. Also, for example, API Gateway can be setup using lambda and for development the latest version can be used and for production, a specific version can be used.

Once a lambda function is created, a new version can be created by clicking on Actions > Publish new version.

A prompt is provided to enter the description for the version. Note that once a version is created, that version can no longer be edited or any of the configuration changed. The latest version can be continued to be edited.

Once the new version is created, only the triggers section can be edited and new aliases be added. Only the latest code can be modified fully.

An alias can be created by clicking the Actions > Create Alias option. The alias needs to have a name and it can be pointed to either a specific version or to the latest version.

Once versions and aliases are created, the lambda function can be filtered by either the version or alias and the code and the settings can be viewed.

Note that the alias information can be used to call a specific version of the lambda function from a different AWS service like the API Gateway.