File tree Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Expand file tree Collapse file tree 2 files changed +29
-1
lines changed Original file line number Diff line number Diff line change @@ -341,6 +341,12 @@ Default value: `us-east-1`
341
341
Specify the AWS region, useful if you'd normally operate in a certain region (such as one where Lambda isn't yet available)
342
342
but wish to upload functions to another region.
343
343
344
+ ##### options.timeout
345
+ Type: ` Integer `
346
+ Default value: ` null `
347
+ Depending on your Lambda function, you might need to increase the timeout value. The default timeout assigned by AWS is currently 3 seconds.
348
+ If you wish to increase this timeout set the value here.
349
+
344
350
#### Usage Examples
345
351
346
352
##### Default Options
@@ -355,7 +361,23 @@ grunt.initConfig({
355
361
}
356
362
});
357
363
```
358
- And now if you run ` grunt lambda_deploy ` your package shoudl be created and uploaded to the specified function.
364
+ And now if you run ` grunt lambda_deploy ` your package should be created and uploaded to the specified function.
365
+
366
+
367
+ ##### Increasing the Timeout Options to 10 seconds
368
+ In this example, the timeout value is increased to 10 seconds.
369
+
370
+ ``` js
371
+ grunt .initConfig ({
372
+ lambda_deploy: {
373
+ default: {
374
+ function: ' my-lambda-function' ,
375
+ timeout : 10
376
+
377
+ }
378
+ }
379
+ });
380
+ ```
359
381
360
382
## Misc info
361
383
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ module.exports = function (grunt) {
35
35
36
36
var deploy_function = grunt . config . get ( 'lambda_deploy.' + this . target + '.function' ) ;
37
37
var deploy_package = grunt . config . get ( 'lambda_deploy.' + this . target + '.package' ) ;
38
+ var deploy_timeout = grunt . config . get ( 'lambda_deploy.' + this . target + '.options.timeout' ) ;
38
39
39
40
AWS . config . update ( { region : options . region } ) ;
40
41
@@ -62,6 +63,11 @@ module.exports = function (grunt) {
62
63
Runtime : current . Runtime
63
64
} ;
64
65
66
+ if ( deploy_timeout !== null )
67
+ {
68
+ params . Timeout = deploy_timeout ;
69
+ }
70
+
65
71
grunt . log . writeln ( 'Uploading...' ) ;
66
72
fs . readFile ( deploy_package , function ( err , data ) {
67
73
params [ 'FunctionZip' ] = data ;
You can’t perform that action at this time.
0 commit comments