go get -v github.com/jmervine/sns2hipchat
$ sns2hipchat --help
- Create SNS Topic (via AWS console)
- Subscribe SNS Topic to your endpoint (via AWS console)
- Select topic
- Choose "Subscribe to topic"
- Choose "Protocol" (
http
orhttps
accordingly) - Enter endpoint url, e.g.:
http://mysnsendpoint.herokuapp.com/
- Or with rooms:
http://mysnsendpoint.herokuapp.com/?room=1&room=2
- Confirm subscription:
- Select topic (in AWS Console)
- Choose "Request Confirmation"
- Choose "Confirm Subscription"
- View logs for confirmation url (in terminal), e.g.:
heroku logs -a mysnsendpoint | grep "SubscribeURL detected:"
- Paste in subscription url from logs
"Deploy to Heroku" button on the top of this README file is recommended way to set up this app to Heroku.
heroku create
If you're not familiar with using Go on Heroku, see Getting Started with Go on Heroku
To make this app up and work properly, you need to setup the following environment variables:
See
--help
orapp.json
for details.
Required
heroku config:add HIPCHAT_TOKEN=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
# The API auth token for your HipChat account
Optional (defaults listed)
heroku config:add HIPCHAT_ROOMs=<ROOMID>,<ROOMID>
# The default HipChat room(s) to send messages to
heroku config:add HIPCHAT_FROM="Amazon SNS"
# The HipChat sender messages come from
# - v1 only, v2 will show the key owner
heroku config:add HIPCHAT_FORMAT=html
# The HipChat message format
heroku config:add HIPCHAT_NOTIFY=true
# Tell HipChat to notify people on sending messages
heroku config:add HIPCHAT_COLOR=yellow
# The HipChat message color
heroku config:add HIPCHAT_HOST=api.hipchat.com
# The HipChat target host
heroku config:add HIPCHAT_API_VERSION=1
# The HipChat API Version
heroku config:add DEBUG=false
# Verbose logging for debugging SNS and hipchat errors
Testing with Docker
$ go get -v github.com/jmervine/dockme
# running units
$ dockme go test ./...
# running in test mode
$ dockme
# then hit http://localhost:3000/test