Releases: Inqnuam/serverless-aws-lambda
5.0.0
Breaking changes
Now defineConfig
reader is not including require
automatically. If you are still using require
to import modules, as workaround create your own require
before requir
ing other modules.
Example:
import { createRequire } from "module";
let require = createRequire(import.meta.url);
const someModule = require("some-sync-module");
export default defineConfig({...})
Or use import
when possible.
- chore: drop support for old node versions
defineConfig
bundling target is now using current node process's major version, which allows to no longer throw error ontop-level await
when your Node supports it.
4.6.6
4.6.5
- chore: provide common js globals to esm context
- chore: updated AWS Stream Response behaviour to match AWS's new behaviour
- chore: updated dependencies
- fix: exit with code 1 when a plugin 'afterDeploy' hook crashs
- fix: SQS plugin doesn't correctly parses Queue ARN declared in CloudFormation template
- feat: added support for CreateBucket, DeleteBucket, DeleteObjects, HeadBucket, ListBuckets, ListObjects and ListObjectsV2 commands for local S3 plugin.
- feat: added support for AWS CLI
s3
ands3api
commands
4.6.4
- Router (express)
- feat: expose cookies and headers set with res.cookie() and res.setHeader()
- fix: in some cases error middleware may receive response object instead of request object as second argument
- SQS Plugin
- fix: additional verifications for MessageBody, MessageAttributes and MessageSystemAttributes
- fix: added support for Binary type attributes
- fix: explicit message for missing id in batch actions
- SNS Plugin
- fix: additional verifications for Message, and MessageAttributes
- fix: added support for Binary type attributes
- chore
- updated dependencies
- updated README
4.6.2
- updated esbuild
with 0.19.0 esbuild shipped a bug which changed the behaviour of tsconfig baseURL - updated body-parser
now Router body-parser plugin parsesform-urlencoded
requests correctly out of box - added a quick-start project example
with the help of npx and degit you can now start a new project whitin seconds - introduce
LOCAL
label to remove chunk of code when deploying
It's now possible to execute a chunk of code only when developing locally withLOCAL
label statement. Previously it was possible by checkingIS_LOCAL
value fromprocess.env
or with some additional esbuild configuration, example:
export const handler = async (event)=> {
if (process.env.IS_LOCAL == "true") {
console.log("do something locally")
}
return {
statusCode: 200,
body: "Hello World!"
}
}
now you can also achieve the same thing with a more elegant and less error prone with LOCAL label solution:
export const handler = async (event)=> {
LOCAL: {
console.log("do something locally")
}
return {
statusCode: 200,
body: "Hello World!"
}
}
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
4.4.1
4.4.0
4.3.1
4.3.0
Core:
- added support for
onError
,onFailure
andonSuccess
on async invocations.- currently only Lambda and SNS are supported. SQS is planned.
- added support for custom
Client Context
on lambda invocations.
defineConfig:
- expose local ip adresse to plugins.
plugins:
- s3 plugin now stores
Content-Type
andCache-Control
metadata locally to serve them later.