In the previous recipe, we saw how to create an SNS topic, subscribe to that topic, and publish messages from AWS CLI. In this recipe, we will see how to publish a message to an SNS topic from Java Lambda code using the AWS Java SDK.
Publishing to an SNS topic with SDK (Java)
Getting ready
The following are the prerequisites for this recipe:
- 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 other notes there including code usage guidelines, S3 bucket creation and notes for the Windows...