Skip to content

Instantly share code, notes, and snippets.

@wokamoto
Created December 20, 2016 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wokamoto/8bda516ad5e9f6ca6f7d32f453148648 to your computer and use it in GitHub Desktop.
Save wokamoto/8bda516ad5e9f6ca6f7d32f453148648 to your computer and use it in GitHub Desktop.
[AWS][Lambda] ローカルで Lambda 用の nodejs スクリプトを実行する ref: http://qiita.com/wokamoto/items/a07310069514831c79c7
$ npm -g install aws-sdk
$ export AWS_PROFILE='example'; node test.js
var event = {
"value1": "value1"
};
var context = {
succeed: function(data){console.log(JSON.stringify(data,' ',4));},
fail: function(data){console.log("fail!!\n" + JSON.stringify(data,' ',4));},
invokedFunctionArn: 'test:development',
functionName: 'test',
functionVersion: '$LATEST'
};
var callback = function(){};
var myLambda = require('./index');
myLambda.handler(event, context, callback);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment