Skip to content
A simple slack app to allow only certain users to post in a channel
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
img
BodyMappingTemplate.
README.md
lambda_function.py
requirements.txt

README.md

SlackMonitor

A simple slack app to allow only certain users to post in a channel

This app is meant to run as an Amazon AWS Lambda function. So you need to set that up, as well as the AWS API Gateway.

The Lambda function requires the following environment variables (don't hardcode API keys!): SLACK_API_TOKEN - the API token of your app. Your app requires the chat:write:user permission scope. SLACK_CHANNEL_ID - the channel we are planning to write into, can be the ID or name (I prefer the ID, in case someone changes the name) SLACK_CHANNEL_TOKEN - the channel token that is being sent by the Outgoing Webhook, to make sure we get the message from the USERS_ALLOW - a comma separated list of users that are allowed to post

Your Lambda function setup should look something like this: Lambda Code

Lambda Config

Your API Gateway Integration Request mapping should be similar to this. The mapping template (originally from https://forums.aws.amazon.com/thread.jspa?messageID=673012) is in the repo as well.

API Gateway

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.