https://github.com/chatwork/lambda-sns-to-chatwork-function
https://github.com/chatwork/lambda-sns-to-chatwork-function
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/chatwork/lambda-sns-to-chatwork-function
- Owner: chatwork
- Created: 2015-07-13T01:18:14.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2024-02-27T07:03:24.000Z (over 2 years ago)
- Last Synced: 2025-03-05T19:52:08.615Z (over 1 year ago)
- Language: JavaScript
- Size: 19.5 KB
- Stars: 1
- Watchers: 70
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lambda-sns-to-chatwork-function
[](https://travis-ci.org/chatwork/lambda-sns-to-chatwork-function)
[](https://david-dm.org/chatwork/lambda-sns-to-chatwork-function)
[](https://david-dm.org/chatwork/lambda-sns-to-chatwork-function#info=devDependencies)
Notify the SNS to chatwork.

## Get started
```
git clone https://github.com/chatwork/lambda-sns-to-chatwork-function
cd lambda-sns-to-chatwork-function
echo '{
"token": "[ChatWork API Token]",
"roomId": [ChatWork Room ID],
"template": "[Notify Message]"
}' > config/local.json
npm install
npm start # Notify the example events
```
## Configuration
You will generate `config/local.json`.
| name | type | value |
| :--: | :--: | :--: |
| CHATWORK_API_TOKEN | string | [ChatWork API Token](http://developer.chatwork.com/ja/authenticate.html) |
| CHATWORK_SEND_ROOM_ID | int | ID of the room to be sent to the ChatWork |
| CHATWORK_MESSAGE_TEMPLATE | string | The format of the message to be sent to the ChatWork (e.g. `<%- Message %>`) |
Or please create a `config/local.json`
```json
{
"token": "[ChatWork API Token]",
"roomId": [Send Room ID],
"template": "[Message format]"
}
```
## Deployment
### Manual deploy
1. `git clone https://github.com/chatwork/lambda-sns-to-chatwork-function.git`
1. Generate `config/local.json`
2. Run the `npm run archive` tasks
3. It will upload the `archive.zip` as Lambda Function
4. Add the SNS to the event source
### Jenkins
1. `wget https://github.com/chatwork/lambda-sns-to-chatwork-function/archive/0.0.0.zip`
2. Generate `config/local.json`
3. `zip 0.0.0.zip config/local.json`
4. It will upload the `0.0.0.zip` to S3
5. To deploy the Lambda Function using the [AWS Lambda Plugin](https://wiki.jenkins-ci.org/display/JENKINS/AWS+Lambda+Plugin)
### TravisCI
1. To fork
2. Add configuration value to `.travis.yml` of `env`
3. Add `npm run template` to `.travis.yml` of `after_success`
4. Add deployment configuration to `.travis.yml` (e.g. [https://github.com/travis-ci/dpl#lambda](https://github.com/travis-ci/dpl#lambda))
## License
MIT
## Copyright
Copyright (c) 2015 ChatWork.inc