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`
341341Specify the AWS region, useful if you'd normally operate in a certain region (such as one where Lambda isn't yet available)
342342 but wish to upload functions to another region.
343343
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+ 
344350#### Usage Examples  
345351
346352##### Default Options  
@@ -355,7 +361,23 @@ grunt.initConfig({
355361    }
356362});
357363``` 
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+ ``` 
359381
360382## Misc info  
361383
Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ module.exports = function (grunt) {
3535
3636        var  deploy_function  =  grunt . config . get ( 'lambda_deploy.'  +  this . target  +  '.function' ) ; 
3737        var  deploy_package  =  grunt . config . get ( 'lambda_deploy.'  +  this . target  +  '.package' ) ; 
38+         var  deploy_timeout  =  grunt . config . get ( 'lambda_deploy.'  +  this . target  +  '.options.timeout' ) ; 
3839
3940        AWS . config . update ( { region : options . region } ) ; 
4041
@@ -62,6 +63,11 @@ module.exports = function (grunt) {
6263                Runtime : current . Runtime 
6364            } ; 
6465
66+             if  ( deploy_timeout  !==  null ) 
67+             { 
68+                 params . Timeout  =  deploy_timeout ; 
69+             } 
70+ 
6571            grunt . log . writeln ( 'Uploading...' ) ; 
6672            fs . readFile ( deploy_package ,  function  ( err ,  data )  { 
6773                params [ 'FunctionZip' ]  =  data ; 
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments