Serverless Lambda chaining
Serverless service which shows how one can chain Lambdas through SNS. The configuration which triggers the chain mechanims is defined on serverless.yml.
Installation
Make sure that you use Serverless v1.
- Run
serverless install --url https://github.com/pmuens/serverless-lambda-chaining
to install the service in your current working directory - Next up cd into the service with
cd serverless-lambda-chaining
- Run
npm install
- Replace the
accountId
in thehandler.js
file with your AWS account id - Deploy with
serverless deploy
How to use
- Run
serverless invoke --function firstLambda
to trigger the chaining process (this will publish a message to the SNS topic calleddispatcher
thesecondLambda
will listen to) - Run
serverless logs --function secondLambda
to see that the message which was send to thedispatcher
topic successfully triggered thesecondLambda
function
AWS services used
- Lambda
- SNS
References
https://serverless.com/framework/docs/providers/aws/events/sns/#sns