Skip to content

Commit a65c605

Browse files
authored
docs: documentation for slack integration (#1972)
* docs: add docs for slack integration * add menu
1 parent b7b28b8 commit a65c605

File tree

2 files changed

+48
-1
lines changed

2 files changed

+48
-1
lines changed

runatlantis.io/.vuepress/config.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ module.exports = {
7272
'apply-requirements',
7373
'checkout-strategy',
7474
'terraform-versions',
75-
'terraform-cloud'
75+
'terraform-cloud',
76+
'using-slack-hooks'
7677
]
7778
},
7879
{
+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Using Slack hooks
2+
3+
It is possible to use Slack to send notifications to your Slack channel whenever an apply is being done.
4+
5+
::: tip NOTE
6+
Currently only `apply` events are supported.
7+
:::
8+
9+
For this you'll need to:
10+
11+
* Create a Bot user in Slack
12+
* Configure Atlantis to send notifications to Slack.
13+
14+
## Configuring Slack for Atlantis
15+
16+
* Go to [https://api.slack.com/apps](https://api.slack.com/apps)
17+
* Click the `Create New App` button
18+
* Select `From scratch` in the dialog that opens
19+
* Give it a name, e.g. `atlantis-bot`.
20+
* Select your Slack workspace
21+
* Click `Create App`
22+
* On the left go to `oAuth & Permissions`
23+
* Copy the `Bot User OAuth Token` and provide it to Atlantis by using `--slack-token=xoxb-xxxxxxxxxxx` or via the environment `ATLANTIS_SLACK_TOKEN=xoxb-xxxxxxxxxxx`.
24+
* Scroll down to scopes and add the following:
25+
* `channels:read`
26+
* `chat:write`
27+
* `groups:read`
28+
* `incoming-webhook`
29+
* `mpim:read`
30+
* Install the app onto your Slack workspace
31+
32+
## Configuring Atlantis
33+
34+
After following the above steps it is time to configure Atlantis. Assuming you have already provided the `slack-token` (via parameter or environment variable) you can now instruct Atlantis to send `apply` events to Slack.
35+
36+
In your Atlantis configuration you can now add the following:
37+
38+
```yaml
39+
webhooks:
40+
- event: apply
41+
workspace-regex: .*
42+
kind: slack
43+
channel: my-channel
44+
```
45+
46+
The `apply` event information will be sent to the `my-channel` Slack channel.

0 commit comments

Comments
 (0)