A serverless function that sends Chatwork message events to Slack. This function uses Chatwork's webhook. If you are not authorized, you need to apply to the administrator.
- Python:3.8
- AWS Chalice
$ python3 -m venv myvenv
$ source ./myvenv/bin/activate
$ pip install chalice
config.json is the target of .gitignore in this repository because it contains important information. Set the following values
name | Sample value | remarks |
---|---|---|
SLACK_WEBHOOK_URL | https://hooks.slack.com/services/xxxx/xxxx/xxxx | |
SLACK_CHANNEL_ID | XXXXXXXXXXX | |
ALLOWED_TOKENS | ABC, DEF | Specify a comma-separated list of Chatwork webhook tokens. |
{
"version": "2.0",
"app_name": "chatwork-to-slack",
"stages": {
"dev": {
"api_gateway_stage": "api",
"environment_variables": {
"SLACK_WEBHOOK_URL": "https://hooks.slack.com/services/xxxx/xxxxx/xxxx",
"SLACK_CHANNEL_ID": "XXXXXXXXXXX",
"ALLOWED_TOKENS": "ABC, DEF"
}
},
"prd": {
"api_gateway_stage": "api",
"environment_variables": {
"SLACK_WEBHOOK_URL": "https://hooks.slack.com/services/xxxx/xxxx/xxxx",
"SLACK_CHANNEL_ID": "XXXXXXXXXXX",
"ALLOWED_TOKENS": "GHI"
}
}
}
}
Deploy for each stage described in config.json. It is recommended to set the default AWS profile in advance.
# For the development environment
$ chalice deploy --stage dev