chaos-lambda icon indicating copy to clipboard operation
chaos-lambda copied to clipboard

Update README w/ Slack Integration Instructions

Open theomarkkuspaul opened this issue 7 years ago • 4 comments

Hey guys, really enjoying using this project.

Noticed you built a Slack integration in this PR: Add slack notification #21

It would be fantastic if the README details how I might be able to wire up Chaos Lambda running on my AWS account with my Slack. Any thoughts on how soon this can get done?

theomarkkuspaul avatar Jun 15 '18 03:06 theomarkkuspaul

Hi @theomarkkuspaul , you have to create an Incoming Webhook in Slack as stated here: https://api.slack.com/incoming-webhooks

It gives you the URL to use in your chaos lambda configuration file. Specifically, you only need to "XXXXXXXXXX" part of the example URL in that page. After configured your Chaosfile.js, the app will take care of everything.

Does it answer your quesiton?

davinerd avatar Jun 26 '18 08:06 davinerd

Hey @davinerd thanks for the reply. Yep, I have created the Slack webhook per the documentation.

I'm not sure exactly at this point how to configure my Chaosfile.json with the access key Slack has given me. Any steps on how I can achieve?

theomarkkuspaul avatar Jun 28 '18 23:06 theomarkkuspaul

So Slack gave you something like https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX, am I correct? Is this the access key are you talking about?

If so, then take the XXXXXXXXXXXXXXXXXXXXXXXX part and put that in the Chaosfile.json under the webhookId key. Type the channel name you want to send the notification to under the channel key.

That should do the trick.

Let me know if you encounter in any error.

davinerd avatar Jun 30 '18 23:06 davinerd

I've found that I actually need to specify everything after the "/services/" portion inside the Chaosfile.json

"slackWebhook": [
      {
        "channel": "#channel",
        "webhookId": "/T00000000/B00000000/XXXXXXXXXXXXXXXXXXXXXXXX"
      }

Don't forget to build from source since this package hasn't been updated in npm. Slack integration is not in the latest tagged version. https://www.npmjs.com/package/chaos-lambda

dpappa avatar Sep 25 '18 19:09 dpappa