https://github.com/totvs/pulumi-slack
Simplified Slack provider to Pulumi
https://github.com/totvs/pulumi-slack
pulumi slack
Last synced: 12 months ago
JSON representation
Simplified Slack provider to Pulumi
- Host: GitHub
- URL: https://github.com/totvs/pulumi-slack
- Owner: totvs
- License: apache-2.0
- Created: 2021-10-22T13:48:16.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2021-12-01T11:59:33.000Z (over 4 years ago)
- Last Synced: 2024-06-21T17:05:29.222Z (about 2 years ago)
- Topics: pulumi, slack
- Language: Go
- Homepage:
- Size: 141 KB
- Stars: 3
- Watchers: 9
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# What this provider can do?
- Channels: can create public, private, add description, purpose, etc...
- User: bind existenting user to a channel
> A channel cannot be deleted, this provider rename and archive the channel.
# Permissions
We need to configure some scopes to manage resources (Bot tokens):
1. Open https://api.slack.com/apps
2. Create new App
3. Configure App Name and Workspace to develop
4. Use the manifest below
```yaml
_metadata:
major_version: 1
minor_version: 1
display_information:
name: pulumi-resource-slack
features:
bot_user:
display_name: pulumi-resource-slack
always_online: false
oauth_config:
scopes:
bot:
- channels:manage
- groups:write
- im:write
- mpim:write
- groups:read
- channels:read
- im:read
- mpim:read
- users:read
- users:read.email
settings:
org_deploy_enabled: false
socket_mode_enabled: false
token_rotation_enabled: false
```
5. Open menu Oauth & Permissions
6. Click on Install to Workspace and allow requested permissions
7. Go to menu Features/Oauth & Permissions
8. Copy the bot user oauth token to be used by this provider
## Other tips
If you are facing problems to manage channel members, even if you add permission scopes to the bot user, check the channel management.
https://YOUR-WORKSPACE-HERE.slack.com/admin/settings#channel_management_restrictions
## Environment
You need to set Slack token with:
```sh
export SLACK_TOKEN xoxb-2271973586641-3369578963123-hngThgT5dq4W7vmHdzd91T3H
```
or
```sh
pulumi config set --secret slack:config:token xoxb-2271973586641-3369578963123-hngThgT5dq4W7vmHdzd91T3H
```
# Installation
You can download the latest provider from releases and install with:
```bash
pulumi plugin install resource slack 0.0.5 -f /tmp/pulumi-resource-slack-v0.0.5-alpha.1636395768+d62d844a-linux-amd64.tar.gz
```
## Pre-requisites to develop
Install the `pulumictl` cli from the [releases](https://github.com/pulumi/pulumictl/releases) page or follow the [install instructions](https://github.com/pulumi/pulumictl#installation)
> NB: Usage of `pulumictl` is optional. If not using it, hard code the version in the [Makefile](Makefile) of when building explicitly pass version as `VERSION=0.0.1 make build`
## Build and Test
```bash
# build and install the resource provider plugin
$ make build install
# test
$ cd examples/ts
$ yarn link @pulumi/slack
$ yarn install
$ pulumi stack init test
$ pulumi up
```