Skip to content

Instantly share code, notes, and snippets.

supinf / s3-compile-js.js
Last active Aug 29, 2015
AWS Lambda script:: Compiling JavaScript files which are triggered by s3 events.
View s3-compile-js.js
var AWS = require('aws-sdk');
var async = require('async');
var path = require("path");
var mkdir = require("mkdirp");
var fs = require('fs');
var spawn = require('child_process').spawn;
exports.handler = function (event, context) {
// console.log('Event: '+JSON.stringify(event, true, ' '));
var key = event.Records[0].s3.object.key;
supinf / s3-invalidation.js
Last active Aug 21, 2020
AWS Lambda script:: CloudFront Invalidations which are triggered by s3 events.
View s3-invalidation.js
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];
View dynamic-websites-using-aws-sdk-index.html
<!DOCTYPE html>
<html lang="ja">
<title>AWS Javascript Browser SDK Example</title>
<meta charset="UTF-8">
<link rel="stylesheet" href="//">
<script src="//"></script>
You can’t perform that action at this time.