AWS Lambda with alias and version

AWS Lambda

Create a lambda function with an alias and a version

This pattern creates a Lambda function with an alias 'dev' associated with the latest version of the function.
The inline code is written in the template. For every update on the CloudFormation stack: the function's code and the version description need to be updated to trigger the changeset and create a new version.

< Back to all patterns

GitHub icon Download this pattern (.zip)

GitHub icon View this pattern on GitHub


Clone repo

git clone https://github.com/aws-samples/serverless-patterns/cd serverless-patterns/lambda-version-alias

Deploy

sam deploy


Testing

Go to the function and run it.
To create a new version, you need to UPDATE the stack with: a change in the function's code and a new version description
Then upon update, the alias 'dev' will be associated with the latest version

Cleanup

Delete the stack: sam delete.

Created by:

Alice Goumain

Alice Goumain

Cloud Support Engineer in Serverless @ AWS

Follow on LinkedIn