-
Notifications
You must be signed in to change notification settings - Fork 24
Home
Slackbot endpoints backed by API Gateway + Lambda.
The archetecture for the Slackbot API is fairly straightforward. All requests are routed asynchronously to to SNS. By convention, payloads are routed to topics corresponding to the specific event. Eg, slack_event_<event_type>, slack_callback_<callback_id>, or slack_slash_<slash_command_name>.
OAuth requests are authenticated using the Slack client and redirected to the configured redirect URL.

The module is quite configurable, but a very basic setup will do the trick.
module "slackbot" {
source = "amancevice/slackbot/aws"
slack_access_token = "${var.slack_access_token}"
slack_bot_access_token = "${var.slack_bot_access_token}"
slack_signing_secret = "${var.slack_signing_secret}"
}This will create an API with the following endpoints to be configured in Slack:
-
/v1/callbacksThe request URL for interactive components -
/v1/eventsThe request URL for Slack events -
/v1/oauthThe request URL for Slack OAuth -
/v1/slash-commandsThe request URL for Slack slash commands
You will need to separately create an SNS topic for every callback, event, and slash command your app will invoke. Event, callback, and slash command endpoints listen for POST requests made by Slack (using the verification token to ensure the request is indeed coming from Slack) and simply publish the payload to the SNS topic to which the request applies.