From d55eb19ef8f80a028fa27a85e54507ad8eebe50e Mon Sep 17 00:00:00 2001 From: Chase Sillevis Date: Wed, 12 Oct 2016 20:12:32 +0200 Subject: [PATCH 1/4] Fix #156 --- bin/node-lambda | 2 +- lib/main.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/node-lambda b/bin/node-lambda index d1bba065..4ae061a8 100755 --- a/bin/node-lambda +++ b/bin/node-lambda @@ -53,7 +53,7 @@ program .option('-d, --description [' + AWS_DESCRIPTION + ']', 'Lambda Description', AWS_DESCRIPTION) .option('-u, --runtime [' + AWS_RUNTIME + ']', 'Lambda Runtime', AWS_RUNTIME) .option('-p, --publish [' + AWS_PUBLISH + ']', 'Lambda Publish', AWS_PUBLISH) - .option('-v, --version [' + AWS_FUNCTION_VERSION + ']', 'Lambda Function Version', AWS_FUNCTION_VERSION) + .option('-L, --lambdaVersion [' + AWS_FUNCTION_VERSION + ']', 'Lambda Function Version', AWS_FUNCTION_VERSION) .option('-b, --vpcSubnets [' + AWS_VPC_SUBNETS + ']', 'Lambda Function VPC Subnets', AWS_VPC_SUBNETS) .option('-g, --vpcSecurityGroups [' + AWS_VPC_SECURITY_GROUPS + ']', 'Lambda VPC Security Group', AWS_VPC_SECURITY_GROUPS) diff --git a/lib/main.js b/lib/main.js index 15fd094f..27672f69 100644 --- a/lib/main.js +++ b/lib/main.js @@ -117,8 +117,8 @@ Lambda.prototype._params = function (program, buffer) { Publish: program.publish, VpcConfig: {} }; - if (program.version) { - params.FunctionName += ('-' + program.version); + if (program.lambdaVersion) { + params.FunctionName += ('-' + program.lambdaVersion); } if (program.vpcSubnets && program.vpcSecurityGroups) { params.VpcConfig = { From 30b8ca91437d8600be2e0bb9dcd77771713b598d Mon Sep 17 00:00:00 2001 From: Chase Sillevis Date: Wed, 12 Oct 2016 20:14:06 +0200 Subject: [PATCH 2/4] update README as well --- README.md | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index 21c78dba..b65fbfba 100644 --- a/README.md +++ b/README.md @@ -106,28 +106,28 @@ $ node-lambda deploy --help Options: - -h, --help output usage information - -e, --environment [staging] Choose environment {development, staging, production} - -a, --accessKey [your_key] AWS Access Key - -s, --secretKey [your_secret] AWS Secret Key - -P, --profile [your_profile] AWS Profile - -k, --sessionToken [your_token] AWS Session Token - -r, --region [us-east-1] AWS Region(s) - -n, --functionName [node-lambda] Lambda FunctionName - -H, --handler [index.handler] Lambda Handler {index.handler} - -o, --role [your_role] Amazon Role ARN - -m, --memorySize [128] Lambda Memory Size - -t, --timeout [3] Lambda Timeout - -d, --description [missing] Lambda Description - -u, --runtime [nodejs4.3] Lambda Runtime {nodejs4.3, nodejs} - "nodejs4.3" is the current standard, "nodejs" is v0.10.36 - -p, --publish [false] This boolean parameter can be used to request AWS Lambda to create the Lambda function and publish a version as an atomic operation - -v, --version [custom-version] Lambda Version - -f, --configFile [] Path to file holding secret environment variables (e.g. "deploy.env") - -b, --vpcSubnets [] VPC Subnet ID(s, comma separated list) for your Lambda Function, when using this, the below param is also required - -g, --vpcSecurityGroups [] VPC Security Group ID(s, comma separated list) for your Lambda Function, when using this, the above param is also required - -A, --packageDirectory [] Local package directory - -x, --excludeGlobs [] Add a space separated list of file(type)s to ignore (e.g. "*.json .env") - -D, --prebuiltDirectory [] Prebuilt directory + -h, --help output usage information + -e, --environment [staging] Choose environment {development, staging, production} + -a, --accessKey [your_key] AWS Access Key + -s, --secretKey [your_secret] AWS Secret Key + -P, --profile [your_profile] AWS Profile + -k, --sessionToken [your_token] AWS Session Token + -r, --region [us-east-1] AWS Region(s) + -n, --functionName [node-lambda] Lambda FunctionName + -H, --handler [index.handler] Lambda Handler {index.handler} + -o, --role [your_role] Amazon Role ARN + -m, --memorySize [128] Lambda Memory Size + -t, --timeout [3] Lambda Timeout + -d, --description [missing] Lambda Description + -u, --runtime [nodejs4.3] Lambda Runtime {nodejs4.3, nodejs} - "nodejs4.3" is the current standard, "nodejs" is v0.10.36 + -p, --publish [false] This boolean parameter can be used to request AWS Lambda to create the Lambda function and publish a version as an atomic operation + -L, --lambdaVersion [custom-version] Lambda Version + -f, --configFile [] Path to file holding secret environment variables (e.g. "deploy.env") + -b, --vpcSubnets [] VPC Subnet ID(s, comma separated list) for your Lambda Function, when using this, the below param is also required + -g, --vpcSecurityGroups [] VPC Security Group ID(s, comma separated list) for your Lambda Function, when using this, the above param is also required + -A, --packageDirectory [] Local package directory + -x, --excludeGlobs [] Add a space separated list of file(type)s to ignore (e.g. "*.json .env") + -D, --prebuiltDirectory [] Prebuilt directory ``` ## Custom Environment Variables From b90fadc50da91cb91d62162e1ad17aeab45195e7 Mon Sep 17 00:00:00 2001 From: Chase Sillevis Date: Wed, 12 Oct 2016 20:15:46 +0200 Subject: [PATCH 3/4] fix test --- .build_1476296124329/package.json | 1 + .build_1476296124329/testa | 1 + .build_1476296141663/package.json | 1 + .build_1476296141663/testa | 1 + test/main.js | 2 +- 5 files changed, 5 insertions(+), 1 deletion(-) create mode 100644 .build_1476296124329/package.json create mode 100644 .build_1476296124329/testa create mode 100644 .build_1476296141663/package.json create mode 100644 .build_1476296141663/testa diff --git a/.build_1476296124329/package.json b/.build_1476296124329/package.json new file mode 100644 index 00000000..66dc9051 --- /dev/null +++ b/.build_1476296124329/package.json @@ -0,0 +1 @@ +undefined \ No newline at end of file diff --git a/.build_1476296124329/testa b/.build_1476296124329/testa new file mode 100644 index 00000000..66dc9051 --- /dev/null +++ b/.build_1476296124329/testa @@ -0,0 +1 @@ +undefined \ No newline at end of file diff --git a/.build_1476296141663/package.json b/.build_1476296141663/package.json new file mode 100644 index 00000000..66dc9051 --- /dev/null +++ b/.build_1476296141663/package.json @@ -0,0 +1 @@ +undefined \ No newline at end of file diff --git a/.build_1476296141663/testa b/.build_1476296141663/testa new file mode 100644 index 00000000..66dc9051 --- /dev/null +++ b/.build_1476296141663/testa @@ -0,0 +1 @@ +undefined \ No newline at end of file diff --git a/test/main.js b/test/main.js index 9feb9342..33541ff4 100644 --- a/test/main.js +++ b/test/main.js @@ -52,7 +52,7 @@ describe('node-lambda', function () { }); it('appends version to original functionName', function () { - program.version = '2015-02-01'; + program.lambdaVersion = '2015-02-01'; var params = lambda._params(program); assert.equal(params.FunctionName, 'node-lambda-development-2015-02-01'); }); From aff76212b972d216fbf1b61cf57c57ed362678dd Mon Sep 17 00:00:00 2001 From: Chase Sillevis Date: Wed, 12 Oct 2016 20:16:13 +0200 Subject: [PATCH 4/4] rm builds --- .build_1476296124329/package.json | 1 - .build_1476296124329/testa | 1 - .build_1476296141663/package.json | 1 - .build_1476296141663/testa | 1 - 4 files changed, 4 deletions(-) delete mode 100644 .build_1476296124329/package.json delete mode 100644 .build_1476296124329/testa delete mode 100644 .build_1476296141663/package.json delete mode 100644 .build_1476296141663/testa diff --git a/.build_1476296124329/package.json b/.build_1476296124329/package.json deleted file mode 100644 index 66dc9051..00000000 --- a/.build_1476296124329/package.json +++ /dev/null @@ -1 +0,0 @@ -undefined \ No newline at end of file diff --git a/.build_1476296124329/testa b/.build_1476296124329/testa deleted file mode 100644 index 66dc9051..00000000 --- a/.build_1476296124329/testa +++ /dev/null @@ -1 +0,0 @@ -undefined \ No newline at end of file diff --git a/.build_1476296141663/package.json b/.build_1476296141663/package.json deleted file mode 100644 index 66dc9051..00000000 --- a/.build_1476296141663/package.json +++ /dev/null @@ -1 +0,0 @@ -undefined \ No newline at end of file diff --git a/.build_1476296141663/testa b/.build_1476296141663/testa deleted file mode 100644 index 66dc9051..00000000 --- a/.build_1476296141663/testa +++ /dev/null @@ -1 +0,0 @@ -undefined \ No newline at end of file