This AWS CloudFormation template creates a simple Slack bot using AWS Lambda, Amazon API Gateway HTTP API, and AWS Identity and Access Management (IAM).
The Lambda function in this template receives an event from the HTTP API Gateway, extracts the body of the Slack event, and returns the challenge answer back to Slack.
You can find the details of the installation on this blog post
You will need:
- AWS account
- Slack Account and Slack Workspace
To use this CloudFormation template, follow these steps:
- Upload the CloudFormation template to your AWS account.
- Create a stack with the template in your AWS account.
- When creating the stack, provide the Slack bot token and AWS account number as parameters.
- After the stack is created, you can find the HTTP API endpoint in the stack output. Use this endpoint to configure your Slack bot's event subscriptions.
python.py
file to update the Lambda function.
This template creates the following resources:
- IAM role for the Lambda function
- Lambda function
- API Gateway HTTP API
- Lambda function resource permission for the API Gateway HTTP API
This template uses the following parameters:
- BotToken: The Slack bot token.
- AccountNumber: The AWS account number.
- AppName (optional): The name of the application. The default value is apigw-http-slack-lambda.
This template creates the following output:
- HttpApiEndpoint: The default endpoint for the HTTP API.
See CONTRIBUTING for more information.
This repository is licensed under the Apache License 2.0. See the LICENSE file.