Use AWS Lambda (not heroku or on-permise machine) to forward message to Slack from SNS
Why I use AWS Lambda not heroku or any other service:
- Cheapest (1 million request only cost 0.20 USD. It is the cheapest service than any cloud-provider service)
- Build-in integration with SNS trigger
- Low maintaining effort
- Prepare the IAM Execution Role. For example:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"sns:GetTopicAttributes",
"sns:List*"
],
"Resource": "*"
}
]
}
- Prepare the Slack web-incoming-webhook url
- Create a channel for aws-sns in slack
- add a Incoming WebHooks service integration
- get the webhook url
- Select topic you want and subscirpt to it
- select AWS Lambda as Protocol and select Lambda function