This example has been generated with console npx serverless create --template aws-nodejs-typescript --path sns-sqs-lambda
This example presents how to integrate with localstack docker on your machine. It does not perform deployment. All it does is creates resources in docker and makes requests against it.
Currently localstack integration handles targets:
Other handlers are not yet implemented.
This example covers scenario of integrating EventBridge -> SNS -> SQS -> Lambda. Why like this? EventBridge rules are limited to 300 and each rule targets are limited to 5. Which are serious limitations. Usually developers get around them by adding SNS as target since SNS does not have such a limitation and can send message to as many subscribers as it wants to.
Integrations between SNS -> SQS -> Lambda are achieved with use of offline plugins:
Look in to docker-compose.yml for example of localstack configuration.
Example is provided in TypeScript so look for serverless.ts file not serverless.yaml
- docker / podman
- NodeJS 14+
This example is looking for output of plugin build. You can check it in serverless.ts
In root of serverless-offline-aws-eventbridge make sure to perform
console npm install
console npm run build
execute console npm install
in root of this example.
execute console docker-compose up
in foot of this example. It will look for docker-compose.yml by default.
execute npm start
in root of this example.
execute npm test
in root of this example.
Test script
You should be able to see output from server This is output from your lambda.