Skip to content

Commit 13bd9f8

Browse files
authored
Restore the lambda version functionality (#160)
* Fix #156 * update README as well * fix test * rm builds
1 parent 62e6630 commit 13bd9f8

File tree

4 files changed

+26
-26
lines changed

4 files changed

+26
-26
lines changed

README.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -106,28 +106,28 @@ $ node-lambda deploy --help
106106
107107
Options:
108108
109-
-h, --help output usage information
110-
-e, --environment [staging] Choose environment {development, staging, production}
111-
-a, --accessKey [your_key] AWS Access Key
112-
-s, --secretKey [your_secret] AWS Secret Key
113-
-P, --profile [your_profile] AWS Profile
114-
-k, --sessionToken [your_token] AWS Session Token
115-
-r, --region [us-east-1] AWS Region(s)
116-
-n, --functionName [node-lambda] Lambda FunctionName
117-
-H, --handler [index.handler] Lambda Handler {index.handler}
118-
-o, --role [your_role] Amazon Role ARN
119-
-m, --memorySize [128] Lambda Memory Size
120-
-t, --timeout [3] Lambda Timeout
121-
-d, --description [missing] Lambda Description
122-
-u, --runtime [nodejs4.3] Lambda Runtime {nodejs4.3, nodejs} - "nodejs4.3" is the current standard, "nodejs" is v0.10.36
123-
-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
124-
-v, --version [custom-version] Lambda Version
125-
-f, --configFile [] Path to file holding secret environment variables (e.g. "deploy.env")
126-
-b, --vpcSubnets [] VPC Subnet ID(s, comma separated list) for your Lambda Function, when using this, the below param is also required
127-
-g, --vpcSecurityGroups [] VPC Security Group ID(s, comma separated list) for your Lambda Function, when using this, the above param is also required
128-
-A, --packageDirectory [] Local package directory
129-
-x, --excludeGlobs [] Add a space separated list of file(type)s to ignore (e.g. "*.json .env")
130-
-D, --prebuiltDirectory [] Prebuilt directory
109+
-h, --help output usage information
110+
-e, --environment [staging] Choose environment {development, staging, production}
111+
-a, --accessKey [your_key] AWS Access Key
112+
-s, --secretKey [your_secret] AWS Secret Key
113+
-P, --profile [your_profile] AWS Profile
114+
-k, --sessionToken [your_token] AWS Session Token
115+
-r, --region [us-east-1] AWS Region(s)
116+
-n, --functionName [node-lambda] Lambda FunctionName
117+
-H, --handler [index.handler] Lambda Handler {index.handler}
118+
-o, --role [your_role] Amazon Role ARN
119+
-m, --memorySize [128] Lambda Memory Size
120+
-t, --timeout [3] Lambda Timeout
121+
-d, --description [missing] Lambda Description
122+
-u, --runtime [nodejs4.3] Lambda Runtime {nodejs4.3, nodejs} - "nodejs4.3" is the current standard, "nodejs" is v0.10.36
123+
-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
124+
-L, --lambdaVersion [custom-version] Lambda Version
125+
-f, --configFile [] Path to file holding secret environment variables (e.g. "deploy.env")
126+
-b, --vpcSubnets [] VPC Subnet ID(s, comma separated list) for your Lambda Function, when using this, the below param is also required
127+
-g, --vpcSecurityGroups [] VPC Security Group ID(s, comma separated list) for your Lambda Function, when using this, the above param is also required
128+
-A, --packageDirectory [] Local package directory
129+
-x, --excludeGlobs [] Add a space separated list of file(type)s to ignore (e.g. "*.json .env")
130+
-D, --prebuiltDirectory [] Prebuilt directory
131131
```
132132

133133
## Custom Environment Variables

bin/node-lambda

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ program
5353
.option('-d, --description [' + AWS_DESCRIPTION + ']', 'Lambda Description', AWS_DESCRIPTION)
5454
.option('-u, --runtime [' + AWS_RUNTIME + ']', 'Lambda Runtime', AWS_RUNTIME)
5555
.option('-p, --publish [' + AWS_PUBLISH + ']', 'Lambda Publish', AWS_PUBLISH)
56-
.option('-v, --version [' + AWS_FUNCTION_VERSION + ']', 'Lambda Function Version', AWS_FUNCTION_VERSION)
56+
.option('-L, --lambdaVersion [' + AWS_FUNCTION_VERSION + ']', 'Lambda Function Version', AWS_FUNCTION_VERSION)
5757
.option('-b, --vpcSubnets [' + AWS_VPC_SUBNETS + ']', 'Lambda Function VPC Subnets', AWS_VPC_SUBNETS)
5858
.option('-g, --vpcSecurityGroups [' + AWS_VPC_SECURITY_GROUPS + ']', 'Lambda VPC Security Group',
5959
AWS_VPC_SECURITY_GROUPS)

lib/main.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,8 +117,8 @@ Lambda.prototype._params = function (program, buffer) {
117117
Publish: program.publish,
118118
VpcConfig: {}
119119
};
120-
if (program.version) {
121-
params.FunctionName += ('-' + program.version);
120+
if (program.lambdaVersion) {
121+
params.FunctionName += ('-' + program.lambdaVersion);
122122
}
123123
if (program.vpcSubnets && program.vpcSecurityGroups) {
124124
params.VpcConfig = {

test/main.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ describe('node-lambda', function () {
5252
});
5353

5454
it('appends version to original functionName', function () {
55-
program.version = '2015-02-01';
55+
program.lambdaVersion = '2015-02-01';
5656
var params = lambda._params(program);
5757
assert.equal(params.FunctionName, 'node-lambda-development-2015-02-01');
5858
});

0 commit comments

Comments
 (0)