Claudia 5.1: SQS Triggers

Claudia 5.1.0 is now on NPM, with support for the recently introduced SQS Event Source. A major advantage of SQS over other event sources is the message durability – unlike SNS and similar message topics, SQS queues preserve messages even if nobody is consuming them, giving you more flexibility over when a task is processed. You can, for example, use this feature to queue up clean-up tasks and then periodically enable or disable the event source during quiet times.

To wire up a Lambda to an SQS queue, use the add-sqs-event-source command, and specify the queue name or ARN with --queue. You can optionally specify the maximum number of messages to read at once with --batch-size.

Claudia will set up all the IAM privileges correctly so your Lambda can connect to the SQS queue. If you’re deploying without IAM access rights, or the Lambda role already has access to the correct IAM privileges, you can skip this part of the deployment using --skip-iam.

According to the AWS Docs, you can configure multiple queues as event sources for a single Lambda function, but a single SQS queue can be mapped only to a single Lambda function.

Interested in Claudia.js? Get notified when we release a new version.

Low-volume, high value mailing list, no ads or spam.