Skip to content

Instantly share code, notes, and snippets.

View timanrebel's full-sized avatar
💭
I may be slow to respond.

Timan Rebel timanrebel

💭
I may be slow to respond.
View GitHub Profile
@timanrebel
timanrebel / s3-invalidation.js
Created April 19, 2016 20:00 — forked from supinf/s3-invalidation.js
AWS Lambda script:: CloudFront Invalidations which are triggered by s3 events.
console.log('Loading event');
var Q = require('q');
var aws = require('aws-sdk');
var cloudfront = new aws.CloudFront();
exports.handler = function (event, context) {
//_log('Received event: ', event);
var bucket = event.Records[0].s3.bucket.name;