Follow these steps to create a simple AWS Lambda function that processes messages from an Amazon Simple Queue Service (SQS) queue. The ability to automatically process all the messages in a queue with a Lambda function is an incredibly valuable feature that was announced by AWS in 2018. Anyone who has written code to poll a queue for messages knows that it can be surprisingly hard to do correctly, especially at scale with distributed systems. Adding this tool to your belt will allow you to tackle a wide variety of architectural challenges:
- Go to the SQS dashboard and create a new queue. Name the queue MySampleQ, choose Standard Queue, and click Quick-Create Queue.
- Go to the AWS Lambda dashboard and click Create function