This is a configurable setup for uploading updated lambda functions and invoking them via the AWS CLI and gulp.
- AWS CLI
- npm dependencies (gulp4, node-zip, nconf, bluebird)
npm install
For this to work, you must run gulp using gulp 4+.
-
Setup your AWS keys in the AWS CLI per the AWS CLI Docs
-
Crate a config [env].json file like (dev.json). Then set the NODE_ENV environment variable to the same name as the file when running gulp.
-
The file example.json is added as an example for your configs if you had an example environment.
-
Add your lambda function in the lambda folder. Then add the function name, function file name, region, filename, txt file of your lambad invocation request, and json target file for the response in your [env].json file.
{
"lambda" : {
"function_file": "example.js",
"request_file": "resources/request.txt",
"response_file": "resources/response.json",
"function" : "example",
"region": "us-east-1"
}
}
export NODE_ENV=dev && node ./node_modules/gulp/bin/gulp.js