Skip to content

Instantly share code, notes, and snippets.

@wataruoguchi
Last active May 23, 2019 04:33
Show Gist options
  • Save wataruoguchi/dea7dc4cbc3cff73c61cfd4831ee2171 to your computer and use it in GitHub Desktop.
Save wataruoguchi/dea7dc4cbc3cff73c61cfd4831ee2171 to your computer and use it in GitHub Desktop.
// handler.js
'use strict';
export handler = function(event, context, callback) {
const key = event.Records[0].s3.object.key;
const sourceKey = decodeURIComponent(key.replace(/\+/g, ' '));
const outputKey = sourceKey.split('.')[0];
const success = { key, sourceKey, outputKey };
const error = null;
callback(error, success);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment