12/23/2023 0 Comments Slack bot multiple workspaces![]() ![]() ![]() Deployment (without using GitHub Actions/Workflows) Lambda/OAuth.py also performs further authorization check with app_id, team_id and channel_id. In order to share a Slack App with other Slack Workspaces without registering in the public Slack App Directory, you will need to deploy also the following stack of the OAuth 2.0 authorization flow service.įor details see “Apps distributed to multiple workspaces” in Distributing Slack apps. To Share the Slack App with other Slack Workspaces ByteMatchStatement: SearchString: team_domain=TODO-slack-domain.ByteMatchStatement: SearchString: team_id=TODO-slack-team-id.ByteMatchStatement: SearchString: Slackbot 1.0 (+).Add AWS::WAFv2::RuleGroup to protect the Slack App API Gateway by specifying rules such as.# Clean up rm -rf cdk.out package */_pycache_ */ *.egg-info */out.json # Create and activate virtual env (optional) # Install requirements Update settings_dev.json to include the Slack domains, team IDs and channel IDs that the Slack App serves.Update env_dev.json with you AWS account number and region that the Slack App is being deployed to.Install CDK v2: npm install -g Install Python 3.8 or above.settings_dev.json and settings_prd.jsonĭeployment (without using GitHub Actions/Workflows).Use scripts/create_ssm_parameters.py to set up AWS SSM Parameter SecureString for storing the required secrets.Copy the Verification Token from Basic Information.Enter the provided API endpoint URL in the URL field.Enter the name /testcdk for the command and click Add Slash Command Integration.Select Create New App and select Slash Commands.To create a Slack Command in Slack (the default command in this repo is /testcdk) A DynamoDB table for storing the oauth tokens of all app installations.A Lambda Function lambda/OAuth.py to perform OAuth 2.0 flow and turn the auth code into access token then store it in a DynamoDB table.An API Gateway to provide an endpoint as the Sharable URL in Slack.CloudWatch Loggroup for API Gateway and Lambda Functions.A Lambda Function lambda/SyncWorker.py to perform actual operation that takes less than 3 seconds to finish.A Lambda Function lambda/AsyncWorker.py to perform actual operation that may take more than 3 seconds to finish.This function invokes another Lambda function to to the request tasks (synchronously invocation for quick task asynchronous invocation for long tasks). A Lambda Function lambda/ImmediateResponse.py to perform authentication, some basic checks and send an intermediate response to Slack within 3 seconds (Slack requirement).An API Gateway to provide an endpoint to be invoked from a Slack Command.This stack includes an AWS API Gateway, a Lambda Function, and a DynamoDB table, with AWS WAF (optional). For details see “Apps distributed to multiple workspaces” in Distributing Slack apps. This repo provides the source code for buildingĪ Slack Command App/Bot with AWS API Gateway and Lambda Functions, deploying with CDK v2 and testing wth SAM CLI ( sam-beta-cdk).Īn OAuth 2.0 authorization flow service for sharing the Slack App with other Workspaces without registering in the public Slack App Directory. ![]() This SlackApp can handle requests triggered from a Slash Command which will take longer than 3 seconds to process, and posts the details back to the user.Īll notable changes to this project will be documented in CHANGELOG. and sends the response to the corresponding thread, see another repo kyhau/slack-chat-app-cdk. If you want to use Slack Chat that responds to messages when the app is mentioned (i.e. find) and sends the response to the same channel. This repo creates a Slack Commands App/bot that responds to a command (i.e. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |