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 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 = { 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'); });