The technology stack I chose to use was TypeScript, AWS CDK, and AWS Lambda. The reason for using this tech stack was because it is what Adaptavist uses and I was curious to see how AWS CDK works. I had a great time using AWS CDK as I was impressed by how fast I could get my code deployed into the cloud. I do wish that I implemented a lambda layer so that I can lower the file size of the lambda.
You don't need to initialize the backend in order to use the Slack Application. You can just configure the Slack Application to point to the already deployed backend. If you wish to go down this route, skip the Backend Initialization guide and only do the Slack Application Initialization Guide.
In this guide I am assuming that you have the AWS CLI installed and tht you have credentials to provision infrastructure.
- In the terminal, run git clone
GIT_REPO_URL
to clone this repository - In the terminal, run
npm run build
- In the terminal, run
cdk synth
to initialize a stack - Make sure to have bootrapped your CDK environment. If you haven't you can follow the guide
- In the terminal, run
cdk deploy
to deploy the infrastructure to AWS - On success, there should be a deployed API Gateway and Lambda.
- Create a Slack Application
- Add a Slash Command that sends a POST request to the API Gateway that was configured in the backend initialization guide. You can find this using the AWS Console or AWS CLI. However, if you did not complete this guide then please use this URL: https://on9inavid4.execute-api.us-east-2.amazonaws.com/prod
- Install the App in your workspace
- Use the slash command that you configured with the Slack Application, you can enter it to get a Chuck Norris joke