AWS Lambda Versions and Aliases

AWS Lambda Versions and Aliases

Serverless computing has been on the rise the last few years, and whilst there is still a large number of customers who are not cloud-ready, there is a larger contingent of users who want to realize the benefits of serverless computing to maximize productivity and to enable newer and more powerful ways of building applications. 

Serverless in cloud computing

Serverless is a cloud computing execution model in which the cloud provider allocates machine resources on demand and manages the servers on behalf of their customers. Cloud service providers still use servers to execute code for developers, which makes the term “serverless” a misnomer. There is always a server running in the background somewhere, and the cloud provider (AWS in this case) will run the infrastructure for you and leave you with the room to build your applications. 

AWS Lambda

Within the AWS world, the principal Serverless service is AWS Lambda. Using AWS Lambda, you can run code for virtually any type of application or backend service without provisioning or managing servers. AWS Lambda functions can be triggered from many services, and you only pay for what you use.

So how does AWS Lambda work? Using Lambda, you can run your code on high availability compute infrastructure and manage your compute resources. This includes server and operating system maintenance, capacity provisioning and automatic scaling, code and security patch deployment, and code monitoring and logging. All you need to do is supply the code. 

AWS Lambda versioning

Within the Lambda service, you can specify different versions of your lambda functions. You can use these versions to manage the deployment of your functions. If you want to add beta testing to a function, you can do so without affecting stable production users. Every time you publish your function, Lambda creates a new version – copying the unpublished version of the function into the new version.

This is useful because the function consumers can continue using a previous version without any disruption. The function publisher can let consumers know about the newest version. Each consumer can test and plan accordingly before upgrading. Or the publisher can conduct tests and upgrade to the latest version of your Lambda function.

The concept of a function alias is similar to that of a pointer. An alias points to a specific version of a function. It is possible to update the version to which the alias points as needed. Publishers can upgrade functions without having to update consumer requests because the version pointer is transparent to consumers.

Aliases cannot point to other aliases, only to function versions.

Each alias has its own unique ARN, just like versions.

Use Cases

After new versions have been thoroughly tested, aliases can be used to route traffic to them. For instance, a function can have a test and a production alias. The development team deploys a new version, tests it appropriately, and then points the production alias to the new stable version.

When you are deploying your Lambda functions as an alias, you are deploying your AWS Lambda function in a much safer way. You can ensure that you can make iterative changes to your code and that the correct code is pushed into production. 

Conclusion

You create Lambda Function versions and aliases to manage function deployment and invocation. Lambda Function code and configuration can be stored as an immutable snapshot by publishing a version and creating an alias that points to a specific version, making it easier for developers to make Lambda Function code changes without requiring changes on the client side (client-application that calls your Lambda Function).

Learn how to Master the AWS Cloud

AWS Training – Our popular AWS training will maximize your chances of passing your AWS certification the first time.

Membership – For unlimited access to our entire cloud training catalog, enroll in our monthly or annual membership program.

Challenge Labs – Build hands-on cloud skills in a secure sandbox environment. Learn, build, test and fail forward without risking unexpected cloud bills.


This article originally appeared on: https://digitalcloud.training/aws-lambda-versions-and-aliases/

victor wasonga

Cloud DevOps Engineer | AWS | CI/CD | Kubernetes | Terraform | Docker | Linux | Automation and Monitoring Expert.

2y

Keep it up Neal Devis, I like your tutorials, you are really audible and understand AWS on a deeper level, watched your videos and was able to pass AWS CLF01 with flying colours, taking My exams next month SOLUTIONS ARCHITECT. steal keeping in touch, you make things clear and simple, keep it up my lecturer, on a scale of 10, I would give you 10/10 keep up the good work, let's meet for architecture online.

Jeff Cade

Customer Success Professional | Empowering Clients Through Training, Support & Tailored Solutions | Expert in Relationship Management, Solution Implementation, and Cross-Functional Collaboration

2y

Great information, thanks Neal!

Like
Reply
Brian Hellinger

Site Reliability Engineer III @ Medical Mutual | I Help Drive Operational Excellence and Reliability 💻 | Passionate AWS Community Builder 🦾 | Pushing To Be Better 1% Everyday

2y

Just finished this section in your AWS Developer course! Awesome information

To view or add a comment, sign in

More articles by Neal K. Davis

Insights from the community

Others also viewed

Explore topics