Skip to content

cw-ozaki/lambda-sns-to-chatwork-function

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lambda-sns-to-chatwork-function

Build Status Dependency Status devDependency Status

Notify the SNS to chatwork.

image

Get started

export CHATWORK_API_TOKEN=xxxx
export CHATWORK_SEND_ROOM_ID=[ChatWork Room ID]
export CHATWORK_MESSAGE_TEMPLATE=[Notify Message]
git clone https://github.com/chatwork/lambda-sns-to-chatwork-function
cd lambda-sns-to-chatwork-function
npm install
npm run template
npm start # Notify the example events

Configuration

You will generate config/local.json. When you run the npm run template to generate a config/local.json from the environment variable .

name type value
CHATWORK_API_TOKEN string ChatWork API Token
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

{
  "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
  2. Generate config/local.json
  3. Run the npm run archive tasks
  4. It will upload the archive.zip as Lambda Function
  5. 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

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)

License

MIT

Copyright

Copyright (c) 2015 ChatWork.inc

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 100.0%