The simple sns to webhook service. listens to a specific sns topic and posts to a webhook.
441
The simple sns to webhook service. listens to a specific sns topic and posts to a webhook. The application will expect that a topic exists and will create a SQS queue and subscribe the SNS topic to it automatically. It will also add the policy to the SQS queue automatically if the config user is allowed to add permissions to a SQS policies
The following policy Requirements were used for this application credentials:
It is expected that the name of the file is snswebhook.properties
AWS_ACCESS_KEY_ID=[access_key]
AWS_SECRET_ACCESS_KEY=[secret]
AWS_REGION_NAME="us-west-2"
LOG_LEVEL="INFO"
AWS_SNS_TOPIC_NAME="dronze-qlearn-cf"
MESSAGE_LOOP_WAIT_SECS=3
POST_MESSAGE_ENDPOINT="http://ec2-35-167-29-231.us-west-2.compute.amazonaws.com:5020/webhook/notification/T1BGUBKQR/aws-sns/dronze-qlearn-cf"
A virtual environment installer is provided called install.sh.
$ bash ./install.sh
$ source ../ve-sns-webhook/bin/activate
$ python application.py --config ~/config/local/snswebhook.properties
starting.
topic_name:dronze-qlearn-cf
INFO 2017-03-29 15:29:50,529 _new_conn 735 : Starting new HTTPS connection (1): sns.us-west-2.amazonaws.com
INFO 2017-03-29 15:29:50,724 _new_conn 735 : Starting new HTTPS connection (1): us-west-2.queue.amazonaws.com
if you have problems use the --no-cache option
docker build -t dronzebot/snswebhook:latest .
The container will use the configuration and brain graph you provide.
$ docker run -t -d -p 5020:5020 --name snswebhook -v ${CONFIG_DIR}:/mnt/config dronzebot/snswebhook:latest
aws ecr get-login --region us-west-2
docker build -t dronzebot/snswebhook:latest .
docker tag dronzebot/snswebhook:latest 604212546939.dkr.ecr.us-west-2.amazonaws.com/dronzebot/snswebhook:latest
docker push 604212546939.dkr.ecr.us-west-2.amazonaws.com/dronzebot/snswebhook:latest
aws ecr get-login --region us-west-2
docker pull 604212546939.dkr.ecr.us-west-2.amazonaws.com/dronzebot/snswebhook:latest
make sure that the snswebhook.properties is in the config dir to be mounted.
make sure any existing instances are stoped and removed
$ sudo docker stop snswebhook
snswebhook
$ sudo docker rm snswebhook
snswebhook
$ export CONFIG_DIR=/home/ubuntu/config
$ docker run -t -d --name snswebhook -v ${CONFIG_DIR}:/mnt/config 604212546939.dkr.ecr.us-west-2.amazonaws.com/dronzebot/snswebhook:latest
Content type
Image
Digest
Size
252.7 MB
Last updated
over 9 years ago
docker pull claytantor/sns-webhook