Slack Integration

The Slack integration provides DivvyCloud the ability to send notification messages to Slack channels, and is compatible with all DivvyCloud resources. As an example, you can send high priority security alerts when noncompliant security group rules are provisioned, such as SSH open to the world.

Setup Slack

1. From your Slack application, click on Apps.

2. Search for Incoming Webhooks and click Install.

3. Click on Add Configuration.

4. Choose a channel for posting DivvyCloud messages.

Selecting a Channel For Posting

This channel can be overwritten by the channel that you set up in the Bot Action titled "Send Slack Message". We recommend selecting a general channel here and then selecting the desired channel at the Bot Action Level.

5. Copy the Webhook URL (you will use this in Step 7).

6. Scroll down that configuration page and update the Descriptive Label, Name, and Icon with those of DivvyCloud. For the icon, see the image below (open it and save it) and upload it back to the configuration. Then Save your settings.

Precedence of Name Settings

The Name can be updated at the Bot Action Level, at which point the updated Name will take precedence over the settings you add here.

7. Open DivvyCloud, go to the Integrations page, and open the Slack Integration. Paste the Webhook URL you copied in Step 5 and select Save.

Configure the "Send Slack Message" Action in your Bot

Next you'll configure a bot to verify that the Slack integration works.

1. Go to the BotFactory page and click Create Bot.

2. Complete the Resource Type & Groups and Conditions section.

3. In the Actions section, click Add Action and find the "Send Slack Message" action.

4. Type in the name of the channel where you want to post the Slack message.

5. Type in the name that will be displayed when the message gets posted in Slack, e.g., "DivvyCloud".

6. Type in a value if you want to dynamically assign the recipient via one or more Tags.

7. Type in a value if you want to dynamically assign the recipient via one or more Badges.

8. Add content to the message that will be posted to Slack. You can include actionable information with Jinja2 formatting.

For example:

A resource of type ```{{resource.get_resource_type()}}``` was discovered at
```{{resource.common.creation_timestamp}}``` without the required *owner*
or *contact-email* tags. The resource name is ```{{resource.get_resource_name()}}```.
It lives in account ```{{resource.get_organization_service_name()}}```.

What's Next