Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,12 @@ Default value: `us-east-1`
Specify the AWS region, useful if you'd normally operate in a certain region (such as one where Lambda isn't yet available)
but wish to upload functions to another region.

##### options.timeout
Type: `Integer`
Default value: `null`
Depending on your Lambda function, you might need to increase the timeout value. The default timeout assigned by AWS is currently 3 seconds.
If you wish to increase this timeout set the value here.

#### Usage Examples

##### Default Options
Expand All @@ -355,7 +361,23 @@ grunt.initConfig({
}
});
```
And now if you run `grunt lambda_deploy` your package shoudl be created and uploaded to the specified function.
And now if you run `grunt lambda_deploy` your package should be created and uploaded to the specified function.


##### Increasing the Timeout Options to 10 seconds
In this example, the timeout value is increased to 10 seconds.

```js
grunt.initConfig({
lambda_deploy: {
default: {
function: 'my-lambda-function',
timeout : 10

}
}
});
```

## Misc info

Expand Down
6 changes: 6 additions & 0 deletions tasks/lambda_deploy.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ module.exports = function (grunt) {

var deploy_function = grunt.config.get('lambda_deploy.' + this.target + '.function');
var deploy_package = grunt.config.get('lambda_deploy.' + this.target + '.package');
var deploy_timeout = grunt.config.get('lambda_deploy.' + this.target + '.options.timeout');

AWS.config.update({region: options.region});

Expand Down Expand Up @@ -62,6 +63,11 @@ module.exports = function (grunt) {
Runtime: current.Runtime
};

if (deploy_timeout !== null)
{
params.Timeout = deploy_timeout;
}

grunt.log.writeln('Uploading...');
fs.readFile(deploy_package, function (err, data) {
params['FunctionZip'] = data;
Expand Down