Serverless service which shows how one can chain Lambdas through SNS. The configuration which triggers the chain mechanims is defined on serverless.yml.
Make sure that you use Serverless v1.
- Next up cd into the service with
cd serverless-sns
- Run
npm install
- Search your accountId with: aws sts get-caller-identity
- Replace the
accountId
in the.env
file with your AWS account id - Deploy with
serverless deploy
- Run
serverless invoke -f firstLambda
to trigger the chaining process (this will call a lamnda functionsecondLambda
who publish a message to the SNS topic calleddispatcher
thethirdLambda
will listen to) - Run
serverless logs -f firstLambda -t
to see that the message which was send to thedispatcher
topic successfully triggered thesecondLambda
function - Run
serverless logs -f secondLambda -t
to see that the message which was send to thedispatcher
topic successfully triggered thesecondLambda
function - Run
serverless logs -f thirdLambda -t
to see that the message which was send to thedispatcher
topic successfully triggered thethirdLambda
function
- Lambda
- SNS
https://serverless.com/framework/docs/providers/aws/events/sns/#sns