Amazon SNS Outbound via AWS Lambda
Create notifications in Amazon SNS from ilert alerts.
Last updated
Create notifications in Amazon SNS from ilert alerts.
Last updated
(c) 2011 - 2024 ilert GmbH
Amazon Simple Notification Service (Amazon SNS) is a fully managed messaging service for both application-to-application (A2A) and application-to-person (A2P) communication.
The A2A pub/sub functionality provides topics for high-throughput, push-based, many-to-many messaging between distributed systems, microservices, and event-driven serverless applications. Using Amazon SNS topics, your publisher systems can fanout messages to a large number of subscriber systems including Amazon SQS queues, AWS Lambda functions and HTTPS endpoints, for parallel processing, and Amazon Kinesis Data Firehose. The A2P functionality enables you to send messages to users at scale via SMS, mobile push, and email.
To set up the integration, you must have an Amazon SNS topic and the arn string for it.
Go to the AWS Console and then to Amazon Lambda, then click on the Functions link and on the Create function button**.**
On the next page, choose Author from scratch, name the function e.g. myIncidentHandler and scroll down
In the Change default execution role section, choose Create a new role from AWS policy template, name the new role e.g. myIncidentHandlerRole, in the Policy templates section, choose Amazon SNS publish policy and click on the Create function button
On the next page, change Code source as follows:
Change the topicArn variable to the Amazon SNS topic arn and click on the Deploy button
In the Function overview section, click on the Add trigger button
On the next page, choose API Gateway as trigger type, in the API section choose Create an API, in the API type section choose REST API, in the Security section choose API key and click on the Add button
On the next page an API endpoint and an API key are generated. You will need this URL and key below when setting up the AWS Lambda connector in ilert.
Admin permission required
To set up the integration, you must have admin rights in ilert.
**Click the gear icon and then click on the Connectors** link
Click the Add Connector button
On the next page, choose AWS Lambda as type, name the connector, paste the API key that you generated in AWS Lambda and click on the Save button
Go to the alert sources tab and open the alert source whose alerts you want to publish to Amazon SNS. Click on the Alert actions tab and then on the Add new alert action button
On the next page choose AWS Lambda as the type, choose the connector created in step 3, name it, choose Trigger mode, paste the API URL that you generated in AWS Lambda and click on the Save button.
Finished! Now an Amazon SNS notification will be created for each alert in automatic trigger mode or via manual alert action.