/lawos-serverless

Serverless example for an SQS Worker in AWS Lambda using Lawos

Primary LanguageJavaScriptMIT LicenseMIT

SQS Worker for AWS Lambda with Lawos

serverless license

Example usage of Lawos with Serverless to process messages from an Amazon SQS queue with AWS Lambda functions.

Setup

  • Use CloudWatch Schedule to run Lambda function every minute
  • Use CloudWatch Alarms to run Lambda function if SQS contains more than 100 messages

Install

$ > git clone git@github.com:sbstjn/lawos-serverless.git && cd lawos-serverless
$ > npm install

Deployment

$ > npm run deploy

Invoke worker

$ > npm run invoke

Add noise to SQS

Use wrk to add some messages to your SQS queue. You need to enable anonymous access to sendMessage for your queue first!

$ > wrk -c25 -d10 -t15 \
    -s helper/wrk.lua \
    https://sqs.eu-west-1.amazonaws.com/YourAccountID/dev-lawos-serverless-backlog