title: AWS Lambda Container destroy event
body: <p>When to release connections and cleanup resources in lambda. In normal Node JS application we do use the hook</p>
  
  <pre><code>process.on('exit', (code) =&gt; {
      console.log(`About to exit with code: ${code}`);
  });
  </code></pre>
  
  <p>However this doesn't work on AWS Lambda. Resulting the Mysql connection in sleep mode. We don't have enough resource for such active connections. None of the AWS documentation specify a way to achieve this.</p>
  
  <p>How to receive stop event of AWS Lambda container ?</p>