An AWS Lambda function can be invoked with Amazon SNS notifications. When a publisher publishes a message to an SNS topic and a Lambda function is subscribed to the same SNS topic, that Lambda function is invoked with the payload of a published message. When a publisher publishes a message to an SNS topic, SNS provides the message delivery status to the publisher stating that the message is sent to the Lambda function. The payload message acts as an input parameter for the Lambda function. The function can process the message (payload) as needed.
SNS topic can be configured to execute a Lambda function with the help of the following steps:
- Go to the
SNS dashboard
, and selectTopics
from the left-hand side panel; it will display a list of topics, as shown in Figure 13.26:
Figure 13.26: SNS Topics dashboard
- Click the topic ARN for a topic to subscribe a Lambda function, as shown...