Triggering Lambda from SQS

Length: 00:13:24

Lesson Summary:

In this lesson, we'll look at a common use case where we invoke a Lambda function that is triggered by SQS. Whenever a message is placed in the queue, the Lambda function will be triggered, reading the contents of that message and inserting its data as a record into DynamoDB.

Create a DynamoDB Table

aws dynamodb create-table --table-name Message \
  --attribute-definitions AttributeName=MessageId,AttributeType=S \
  --key-schema AttributeName=MessageId,KeyType=HASH \

Create an SQS Queue

aws sqs create-queue --queue-name Messages

Sending Messages to SQS

Run the provided script to send messages to SQS.

Example: Send a message containing random text to the Messages queue every 0.1 second (10 messages per second):

./ -q Messages -i 0.1

Press Ctrl+C to quit.

Send Messages to SQS:


This lesson is only available to Linux Academy members.

Sign Up To View This Lesson

Or Log In

Looking For Team Training?

Learn More