Created
December 20, 2016 08:18
-
-
Save wokamoto/8bda516ad5e9f6ca6f7d32f453148648 to your computer and use it in GitHub Desktop.
[AWS][Lambda] ローカルで Lambda 用の nodejs スクリプトを実行する ref: http://qiita.com/wokamoto/items/a07310069514831c79c7
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ npm -g install aws-sdk |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ export AWS_PROFILE='example'; node test.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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