Inspired by: https://stackoverflow.com/a/72574950
A no-code solution to push messages sent to an AWS SNS topic into Slack via a workflow webhook.
- Create a new Slack Workflow, using
From a webhookas the triggering event. - Include the following
Data variables:Message Token - Next, add a Slack Workflow step to
Send a message to...a nominated channel withMessageandTokenvalues included. - Publish the Slack Workflow and obtain the
Web request URLfrom the opening event trigger step. - Create an SNS topic subscription where:
- Protocol is
HTTP. EndpointisWeb request URLfrom previous step.
- Protocol is
- SNS will now call
Web request URL, and you will receive a Slack message from the Workflow containingMessageandTokenvalues. - Using the
Token, confirm the SNS topic subscription via the AWS CLI:$ aws sns confirm-subscription --topic-arn SNS_TOPIC_ARN --token LONG_TOKEN_STRING { "SubscriptionArn": "SUBSCRIPTION_ARN" } - Finally, go back to your Slack Workflow and update the message body/add additional triggering actions/etc. You can remove
Tokenfrom theFrom a webhookinitial step, as no longer required. - Done!