All Projects → iopipe → sqs-to-lambda-async

iopipe / sqs-to-lambda-async

Licence: Apache-2.0 license
Process SQS messages with Lambda, asynchronously

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to sqs-to-lambda-async

Lambdaguard
AWS Serverless Security
Stars: ✭ 300 (+1011.11%)
Mutual labels:  lambda, sqs
terraform-aws-lambda
A Terraform module to create AWS Lambda ressources.
Stars: ✭ 40 (+48.15%)
Mutual labels:  lambda, sqs
super-serverless-sample
Backend serverless que simula o sistema de votação do BBB
Stars: ✭ 30 (+11.11%)
Mutual labels:  lambda, sqs
Dazn Lambda Powertools
Powertools (logger, HTTP client, AWS clients, middlewares, patterns) for Lambda functions.
Stars: ✭ 501 (+1755.56%)
Mutual labels:  lambda, sqs
Sqs Worker Serverless
Example for SQS Worker in AWS Lambda using Serverless
Stars: ✭ 164 (+507.41%)
Mutual labels:  lambda, sqs
go-localstack
Go Wrapper for using localstack
Stars: ✭ 56 (+107.41%)
Mutual labels:  lambda, sqs
Laravel Bridge
Package to use Laravel on AWS Lambda with Bref
Stars: ✭ 168 (+522.22%)
Mutual labels:  lambda, sqs
lambdakiq
ActiveJob on SQS & Lambda
Stars: ✭ 131 (+385.19%)
Mutual labels:  lambda, sqs
GoblinDB
Fear the Goblin! - An amazing, simple and fun database for humans
Stars: ✭ 54 (+100%)
Mutual labels:  lambda
terraform-aws-lambda-auto-package
A terraform module to define a lambda function which source files are automatically built and packaged for lambda deployment.
Stars: ✭ 23 (-14.81%)
Mutual labels:  lambda
blueauth
🔐 Serverless passwordless authentication. No databases needed. Use in just 1 line in serverless, middleware, express, next.js, and more.
Stars: ✭ 56 (+107.41%)
Mutual labels:  lambda
serverless-apollo-datasource-redis
Serverless Apollo Server 2 with cached Datasource in Redis
Stars: ✭ 26 (-3.7%)
Mutual labels:  lambda
aws-nestjs-starter
Serverless, AWS, NestJS, GraphQL and DynamoDB starter
Stars: ✭ 200 (+640.74%)
Mutual labels:  lambda
scanii-lambda
A Sam-Packaged AWS Lambda client to the scanii.com content processing service
Stars: ✭ 25 (-7.41%)
Mutual labels:  lambda
django-sqs-celery-template
An effortlessly pre configured Django, Celery and SQS template repository for those who want to process asynchronous background tasks.
Stars: ✭ 35 (+29.63%)
Mutual labels:  sqs
aws-sam-typescript-layers-example
Example project for developing AWS Lambda functions on TypeScript with all goodies: local development, tests, debugging, shared layers (3rd party and your own), and deploy.
Stars: ✭ 168 (+522.22%)
Mutual labels:  lambda
SecretsManagerwithCloudFormation
Implements a Lambda-backed CloudFormation Custom Resource for AWS Secrets Manager
Stars: ✭ 20 (-25.93%)
Mutual labels:  lambda
eksutil
Sample project to call Kubernetes API of an Amazon EKS cluster from AWS Lambda
Stars: ✭ 26 (-3.7%)
Mutual labels:  lambda
aws-turn-off-my-account
📦 🚀 📦 Lambda stack to turn off and destroy all resources from your personal AWS Account to avoid billing surprises
Stars: ✭ 63 (+133.33%)
Mutual labels:  lambda
serverless-media-portal
Ready-to-deploy webapp for sharing home videos: a React frontend with a AWS Lambda backend using FFmpeg to process videos. Created using Serverless Framework.
Stars: ✭ 90 (+233.33%)
Mutual labels:  lambda

SQS to Lambda (Async)

CircleCI styled with prettier

So you want to trigger a Lambda function via SQS? Great! You might be able to use sqs-to-lambda. But what if you want your Lambda function to delete the SQS message, instead of the sqs-to-lambda implementation? Or, what if you want to setup multiple SQS => Lambda configurations? That's where this package comes in.

Requirements

  • Node >= 4.3.2
  • NPM >= 2.14.12

Install

With yarn (recommended) in project directory:

yarn add sqs-to-lambda-async

With npm in project directory:

npm install sqs-to-lambda-async

Then, run your application:

import worker from 'sqs-to-lambda-async';

worker([
  {
    queueUrl: 'sqs-queue-url-here',
    functionName: 'lambda-arn-here'
  }
]);

Config

The package accepts an array of mapping configurations. A mapping configuration is an object with the following properties:

queueUrl (string: required)

The SQS queue you want to pull from.

functionName (string: required)

The Lambda function you want to execute.

messageFormatter (function: optional)

A function that allows transformation of the SQS message before send to Lambda.

Example:

worker([
  {
    queueUrl: 'sqs-queue-url-here',
    functionName: 'lambda-arn-here',
    messageFormatter: (msg) => {
      return Object.assign({}, msg, {
        Body: 'reconfigure the sqs body here'
      })
    }
  }
]);

deleteMessage (boolean: optional, default = false)

Use this flag to allow this package to delete the message for you, instead of your Lambda function.

maxNumberOfMessages (integer: optional, default = 5)

The maximum number of messages to return. AWS Documenation

waitTimeSeconds (integer: optional, default = 5)

The duration (in seconds) for which the call waits for a message to arrive in the queue before returning. AWS Documenation

postInvoke (function: optional)

Optional callback that is invoked after each lambda invocation. Useful for error handling.

Example:

worker([
  {
    queueUrl: 'sqs-queue-url-here',
    functionName: 'lambda-arn-here',
    postInvoke(err, value){
      // err will be undefined if lambda invoked successfully
      // value includes FunctionName and Payload
    }
  }
]);

Contributing

  • This project uses Prettier. Please execute npm run eslintFix to auto-format the code before submitting pull requests.
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].