title: How to kill LAMBDA hot container to refresh all data from RDS connection.pool
body: <p>I am noticing that under some conditions Lamda is using <code>old data</code> form an rds connection.pool after I have update both the Lamda function and the RDS data.</p>
  
  <p>For example.</p>
  
  <pre><code>V1 of function is uploaded to lambda via cli
  V1 is tested @ lambda aws.web.console and returns data as expected
  V1 is called from api.gateway and returns v1 data as expected
  
  V2 of function is uploaded to lambda via cli
  V2 data is changed on RDS 
  V2 is tested @ lambda aws.web.console and returns V2 data as expected
  V2 is called from api.gateway and returns data as **V1**
  </code></pre>
  
  <p>Wait for function to go cold</p>
  
  <pre><code>V2 is called from api.gateway and returns V2 data as expected
  </code></pre>
  
  <p>It seems that,</p>
  
  <ol>
  <li>the aws.web.console always calls a new container and new connection.pools when testing the function </li>
  <li>calls from api.gateway seems to use a previous container with old cache or a new container with old cache somehow?</li>
  </ol>
  
  <p>So my question is how do you force kill a Lambda function so it goes cold and restarts completely new on next call?</p>