sbstjn / sqs-worker-serverless

Example for SQS Worker in AWS Lambda using Serverless
https://sbstjn.com/serverless-sqs-worker-with-aws-lambda.html
MIT License
177 stars 38 forks source link
aws dynamodb lambda serverless sqs worker

SQS Worker with Serverless ⚡️

MIT License Read Tutorial

Experimental Serverless Amazon SQS Worker with AWS Lambda.

Update: Please see Serverless Analytics for a more realistic setup using Amazon Kinesis Streams to process your data and events. You can read more about the Kinesis and Lambda connection at Serverless Analytics with Amazon Kinesis and AWS Lambda. This was only intended as an April Fools' project …

Setup

Workflow

Auto-Scaling with CloudWatch Alerts

Workers with CloudWatch Schedule

Deploy

$ > yarn install
$ > yarn deploy

Add noise to SQS

You should have some data in your queue to test this setup. Use wrk to send messages to SQS, but make sure to enable anonymous access to sendMessage for your queue first!

$ > wrk -c35 -d60 -t35 \
    -s helpers/wrk.lua \
    https://sqs.REGION.amazonaws.com/ACCOUNT-ID/YourQueueName