title: How to ignore AWS Lambda timeout limit 300 seconds for long execution?
body: <p>I am stuck with timeout issue in AWS Lambda with Node.js which  default timeout time is 300 secs.</p>
  
  <p>I want to download a <code>zip</code> <code>size&gt;300MB</code> from S3 bucket and after extracting it, upload to in temp folder in same bucket.</p>
  
  <p>But due to heavy data I am not able to complete this within time interval.</p>
  
  <p>I can go with EBS but want to get any nearest solution which can work with Lambda function.</p>
  
  <p>It'll be great if I can get a relevant suggestion to complete this task.</p>
  
  <p>Here is the stuff which I have written in Lambda function.</p>
  
  <pre><code>exports.handler = (event, context, callback) =&gt; {
      console.log('Received event for big file:', JSON.stringify(event, null, 2));
  
      // Get the object from the event and show its content type
      const bucket = event.Records[0].s3.bucket.name;
      const key = decodeURIComponent(event.Records[0].s3.object.key.replace(/\+/g, ' '));
      const params = {
          Bucket: bucket,
          Key: key,
      };
      s3.getObject(params, (err, data) =&gt; {
          if (err) {
              console.log('Error', err);
              const message = `Error getting object ${key} from bucket ${bucket}. Make sure they exist and your bucket is in the same region as this function.`;
              console.log(message);
              callback(message);
          } else {
              console.log('Started to save buffers....');
              JSZip.loadAsync(data.Body).then(function(zip) {
                  console.log('Started to extract files.....');
                  async.eachSeries(zip.files, function(item, cbk1) {
                      if (!item.dir) {
                          async.waterfall([function(cbk) {
                              zip.file(item.name).async("text").then(function(content) {
                                  cbk(null, content)
                              })
                          }], function(err, content) {
                              s3.putObject({
                                  Bucket: bucket,
                                  Key: 'bigtemp/' + item.name.replace(/^.*[\\\/]/, ''),
                                  Body: content
                              }, function(err, result) {
                                  if(result &amp;&amp; result.ETag){
                                  console.log('uploaded file: ', result.ETag);
                                  }
                                  console.log('Error ', err);
                                  cbk1();
                              });
                          })
                      } else {
                          cbk1();
                      }
                  });
              });
              callback(null, data.ContentType);
          }
      });
  }; 
  </code></pre>