Posted On: Jun 1, 2021
Amazon Lambda Extensions are a new way to integrate your favorite operational tools for monitoring, observability, security, and governance with Amazon Lambda. Starting today, extensions are generally available in the Amazon Web Services China (Beijing) Region, operated by Sinnet, and Amazon Web Services China (Ningxia) Region, operated by NWCD, with new performance improvements.
Extensions use the Lambda Runtime Extensions API to integrate deeply into the Lambda environment. They control and participate in all phases of the Lambda lifecycle - function initialization, invocation, and shutdown. Extensions from Amazon, third party vendors, and open-source tools enable a wide range of use cases. For example, you can use extensions to pre-fetch configuration and secrets before your function handler is executed, or send function logs directly to any destination.
With this release, the Lambda service returns the response from the function as soon as the function code is complete without waiting for the included extensions to finish. This enables extensions to perform activities like sending telemetry to a preferred destination after the function’s response has been returned.
Extensions share the same billing model as Lambda functions and you are charged for compute time used in all phases of the Lambda lifecycle. For function invocations, you pay for requests served and the compute time used to run your code and all extensions, together, in 1ms increments. To learn more about billing for extensions, visit the Lambda FAQs page.
You can deploy extensions using Layers through the Lambda Console, CLI, or infrastructure as code tools such as CloudFormation, the Amazon Serverless Application Model, and Terraform. You can build your own extensions as well. To learn how to build extensions, visit the Amazon Lambda Developer Guide.