Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Added option for increasing the connection timeout of the aws-sdk in …
…deploy step
  • Loading branch information
14pixels committed Oct 12, 2016
commit 726a2d72e0495f671fe56e784a305081fe75df94
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ $ node-lambda deploy --help
-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
-T, --deployTimeout [120000] Deploy Timeout
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe mention that this is Upload to AWS: timeout in ms.

```

## Custom Environment Variables
Expand Down
2 changes: 2 additions & 0 deletions bin/node-lambda
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ var EVENT_FILE = process.env.EVENT_FILE || 'event.json';
var PACKAGE_DIRECTORY = process.env.PACKAGE_DIRECTORY;
var CONTEXT_FILE = process.env.CONTEXT_FILE || 'context.json';
var PREBUILT_DIRECTORY = process.env.PREBUILT_DIRECTORY || '';
var DEPLOY_TIMEOUT = process.env.DEPLOY_TIMEOUT || 120000;

program
.command('deploy')
Expand Down Expand Up @@ -63,6 +64,7 @@ program
.option('-x, --excludeGlobs [' + EXCLUDE_GLOBS + ']',
'Space-separated glob pattern(s) for additional exclude files (e.g. "event.json dotenv.sample")', EXCLUDE_GLOBS)
.option('-D, --prebuiltDirectory [' + PREBUILT_DIRECTORY + ']', 'Prebuilt directory', PREBUILT_DIRECTORY)
.option('-T, --deployTimeout [' + DEPLOY_TIMEOUT + ']', 'Deploy Timeout', DEPLOY_TIMEOUT)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same comment as above ^

.action(function (prg) {
lambda.deploy(prg);
});
Expand Down
4 changes: 4 additions & 0 deletions lib/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,10 @@ Lambda.prototype.deploy = function (program) {
aws_security.sessionToken = program.sessionToken;
}

if (program.deployTimeout) {
aws.config.httpOptions.timeout = program.deployTimeout;
}

aws.config.update(aws_security);

var lambda = new aws.Lambda({
Expand Down
1 change: 1 addition & 0 deletions test/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ var originalProgram = {
region: 'us-east-1,us-west-2,eu-west-1',
eventFile: 'event.json',
contextFile: 'context.json',
deployTimeout: 120000,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

was expecting a test to see if aws.config.httpOptions.timeout is correctly set

prebuiltDirectory: '',
};

Expand Down