Until now (in this recipe and recipes from previous chapters), we were invoking a Lambda either directly from the command line or from the API gateway. A Lambda can also be invoked (or triggered) as a response to an event (or trigger) from one of the supported event sources, such as SQS, Kinesis, DynamoDB, and so on.
In this recipe, we will invoke a Lambda with a trigger from an SQS event source. Similar to the previous recipe, we will then send all the messages as a batch to another SQS output queue. This way, we can easily verify the Lambda was triggered successfully from the other queue. You can also simply check the CloudWatch logs to verify this instead.