AWS Lambda Versioning and alias from the CLI

Lab Details

  1. This lab walks you through the creation of lambda function and creating versions and alias for your lambda function in CLI from EC2 instance.

  2. Duration: 1 Hour

  3. AWS Region: US East (N. Virginia) us-east-1



  1. AWS Lambda service allows you to run code without provisioning or managing dedicated servers. 

  2. In other words, Lambda will be called Serverless Computing.

  3. The interesting feature about lambda is you only need to pay for the compute time you consume and no need to pay when your code is not running.

  4. you can run code for virtually any type of application with zero administration with the help of AWS Lambda functions.

  5. Just upload your code to Lambda and it will take care of everything required to run and scale your code with high availability

  6. We can set triggering events for our lambda function when to run or when to get triggered.

  7. Lambda currently supports various languages such as java, python, node js, c, etc using which you can write your lambda function.

Lambda Version and Alias

  1. It is possible to use  lambda versions to manage the deployment of your AWS Lambda functions

  2. The Lambda function creates a new version each time you publish the function.

  3. The new version created is a copy of the unpublished version of the function.

  4. Lambda allows us to change the function code and settings only on the unpublished version of a function.

  5. Each version of your Lambda function has its own ARN.

  6. Once the function published the code and most of the settings are locked to ensure a consistent experience for users of that version and you cannot edit or modify the code of that version.

  7. A Lambda alias acts as a pointer to a specific Lambda function version.

  8. AWS allows us to create one or more aliases for the particular lambda function.

  9. Each Alias has its own unique ARN like versions and pointing to a specific version and cant point one alias to others.

  10. You can update an alias to point to a new version of the function that is pointing to some other function.    

Architecture Diagram

Task Details

  1. Creating an IAM role for lambda to create function and Alias.

  2. Creating the Lambda function and Alias from EC2 Server in CLI.

  3. Updating Alias and deleting Alias