AWS Builder Center
Lambda web functions - The new way to create or migrate an API on AWS

Lambda web functions - The new way to create or migrate an API on AWS

Lambda Web Functions are a new feature that makes it easy to create or migrate an API on AWS.

Introduction
Lambda web functions allow running a serverless HTTP server. While the traditional way to deploy an API on AWS is to deploy an API gateway for the routes and dispatching to one or more lambdas, this new feature allows to deploy directly the whole API in a lambda driven by HTTP requests. For example, you can directly port your Hono API in a Web function with minimal code changes.
How does it work ?

  • Revision : A snapshot of your code and configuration
  • Endpoint : HTTPS address pointing to one or two revisions
  • Web Function : The top-level resource, with a name, an ARN and a state
  • Execution environment : an isolated compute instance running the code of a revision
When traffic arrives at the endpoint, the web lambda routes the request to the execution environment that is running the current revision. Note that you can enable two revisions simultaneously which is useful for canary or blue-green deployment.
What are the advantages ?
A lot of the advantages of the lambda web functions are similar to the advantages of serverless solutions and traditional Lambda functions.
Here is an overview of the main advantages :
  • Billing : you pay for what you use, the billing is based on active CPU time, memory usage, requests and data transfer
  • Scaling : Lambda Web Functions automatically scale based on incoming traffic. When there is no traffic, execution environments scale down to zero, eliminating execution environment charges until new traffic arrives.
  • Concurrency : each execution environment can handle multiple requests at once
  • Portability : you can port your existing API to a lambda web function with minimal code change, and you don't need to configure an API Gateway or an Elastic Load Balancer anymore.
  • And many more...
Thanks for reading this article ! :)
References for further reading :
Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article