Skip to content

Instantly share code, notes, and snippets.

View ausfestivus's full-sized avatar

Andrew Best ausfestivus

View GitHub Profile
@ausfestivus
ausfestivus / function.js
Created September 25, 2018 06:26 — forked from vgeshel/function.js
AWS Lambda function for forwarding SNS notifications to Slack
console.log('Loading function');
const https = require('https');
const url = require('url');
// to get the slack hook url, go into slack admin and create a new "Incoming Webhook" integration
const slack_url = 'https://hooks.slack.com/services/...';
const slack_req_opts = url.parse(slack_url);
slack_req_opts.method = 'POST';
slack_req_opts.headers = {'Content-Type': 'application/json'};