In a previous recipe, we invoked a Lambda with a trigger from an SQS event source, and we configured SQS as an event source for the Lambda. With SNS, instead of defining an event source, Lambda has to subscribe to an SNS topic. Lambda will write the message received from the SNS topic into another queue, and we will verify the output queue after publishing messages to the topic.
Invoking a Lambda with SNS events (Java)
Getting ready
You need to follow the section Getting started in the recipes Your first AWS Lambda and Your first Lambda with AWS CLI from Chapter 1, Getting Started with Serverless Computing on AWS to set up Java, Maven, the parent project, serverless-cookbook-parent-aws-java and AWS CLI, and may also read...