4.5.0
We are pleased to announce the release of version 4.5.0 of serverless-aws-lambda!
This new release includes several improvements and bug fixes to make the package more robust and flexible. Here are some of the key features and changes included in this release:
- AWS Lambda Stream Response: With this update, "AWS Lambda Stream Response" is now supported out of the box, allowing you to easily test and debug your Lambda functions locally before deploying them to AWS.
- ESM support: We've added support for ECMAScript Modules (ESM) in both local development and deployment modes. This enables you to use the latest JavaScript syntax and features in your code.
- Skipping deployment of a function by stage: We've added the ability to skip the deployment of a function by "Serverless stage". This makes it easier to control which functions are deployed and when.
- Reduced CPU usage in debug mode: We've optimized the package to reduce CPU usage in debug mode, making it more efficient and responsive.
- Support for AWS Lambda Function URL: You can now make requests to AWS Lambda Function URLs by using the "@url/" prefix followed by the Lambda function name. This makes it easier to invoke your Lambda functions from other services and applications.
- Dependency updates: We have updated our dependencies to ensure that the package is compatible with the latest versions of the Node.js runtime and other libraries.
- Various bug fixes and refactoring: Fixed several bugs and made some code refactoring to improve the stability and performance of the package
Lambda Stream Response
AWS Lambda Introduces Response Payload Streaming.
This is now supported locally out of the box.
Deployment of your lambda will depend on this PR
Enabling ESM
To enable ESM for your packages set esbuild format
to esm
inside your defineConfig
.
For local testing set your package.json's type to module
Omit deploy by stage
Currently we can skip a function deploy by setting online
to false
as in example below:
functions:
debugUsageLambda:
online: false
handler: src/handlers/python.default
runtime: python3.7
Now online
supports also a string or array of string where you can specify deployment by desired stage, ex:
functions:
debugUsageLambda:
online: ["dev", "test"]
handler: src/handlers/python.default
runtime: python3.7
Function URL
Now Function URL can be invoked locally.
Request are made by adding @url/
prefix to your lambda name.
http://localhost:PORT/@url/lambdaName