Skip to content

Serverless example for an SQS Worker in AWS Lambda using Lawos

License

Notifications You must be signed in to change notification settings

sbstjn/lawos-serverless

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Serverless example for an SQS Worker in AWS Lambda using Lawos

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published