Skip to content

Instantly share code, notes, and snippets.

@duckpuppy
duckpuppy / function.js
Created August 24, 2018 20:05 — 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'};
@duckpuppy
duckpuppy / sns-to-slack.js
Created August 24, 2018 20:07 — forked from benyanke/sns-to-slack.js
AWS Lambda function for forwarding SNS notifications to Slack
// Added by Ben Yanke
// from https://gist.github.com/benyanke/862e446e5a816551928d8acc2d98b752
console.log('Loading function');
const https = require('https');
const url = require('url');
// SETUP
// urlToUse = in this environment variable, place the name of another environment variable which contains the key.
// This allows easy dev/prod switching.
/var/folders/qc/bflqyv394j1c70pj52k53vf40000gp/T/ruby-build.20181107143635.8229 ~
/var/folders/qc/bflqyv394j1c70pj52k53vf40000gp/T/ruby-build.20181107143635.8229/ruby-2.4.2 /var/folders/qc/bflqyv394j1c70pj52k53vf40000gp/T/ruby-build.20181107143635.8229 ~
checking for ruby... /Users/patrickaikens/.rbenv/shims/ruby
config.guess already exists
config.sub already exists
checking build system type... x86_64-apple-darwin18.2.0
checking host system type... x86_64-apple-darwin18.2.0
checking target system type... x86_64-apple-darwin18.2.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out