Skip to content

Commit

Permalink
Restore the lambda version functionality (#160)
Browse files Browse the repository at this point in the history
* Fix #156

* update README as well

* fix test

* rm builds
  • Loading branch information
DeviaVir authored Oct 19, 2016
1 parent 62e6630 commit 13bd9f8
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 26 deletions.
44 changes: 22 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion bin/node-lambda
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
4 changes: 2 additions & 2 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down
2 changes: 1 addition & 1 deletion test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
});
Expand Down

0 comments on commit 13bd9f8

Please sign in to comment.