Dice rolling bot for Slack, using Amazon API Gateway and Lambda microservices
- Create a new Lambda function in AWS
- Skip the blueprint, but make sure the language is set to Python 2.7
- Zip slack_roller.py and upload it
- The handler is "slack_roller.roll"
- Set role as "Basic Execution Role" and allow it when it pops up
- Click through the "create function" stuff
- Create a new API in Amazon API Gateway
- Create a new method
- In the dropdown that appears, select "POST"
- Click the checkbox beside POST
- Select Lambda Function and select your slack_roller lambda
- Click "Integration Request"
- Add a mapping template for "application/x-www-form-urlencoded"
- Make the template the following: { "formparams" : $input.params() }
- Save that
- Click "Deploy API"; this should provide you with a url.
- Add a slash command to your integrations
- Fill in the information it asks for the command you want
- Provide it with the url your API is at
- Save it and test your command!