title: Timeout when connecting AWS lambda and RDS database
body: <p>I have a simple .Net core 2.1 web application that I have deployed to AWS lambda. The application talks to a RDS PostGres database. The web application is able to connect to the RDS PostGres database from my local box but the same application times out connecting to RDS database in production. </p>
  
  <p>What am I missing?</p>
  
  <p><strong>ASP.Net 2.1 Lambda configuration:</strong> The lambda has a execution role which has a policy with all rights to all RDS resources.
  <a href="https://i.stack.imgur.com/KrcEG.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KrcEG.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/GhxVH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/GhxVH.png" alt="enter image description here"></a> </p>
  
  <p><strong>IAM:</strong> 
  <a href="https://i.stack.imgur.com/BuivM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BuivM.png" alt="enter image description here"></a></p>
  
  <p><strong>RDS=> Connecting and security tab:</strong> 
  <a href="https://i.stack.imgur.com/DxqaH.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DxqaH.png" alt="enter image description here"></a>
  <a href="https://i.stack.imgur.com/E5pEA.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/E5pEA.png" alt="enter image description here"></a></p>
  
  <p><strong>CloudWatch logs:</strong> Clicking on the lambda function=> Monitoring tab=> view logs in cloudwatch logs shows the following error:
  <a href="https://i.stack.imgur.com/WNyZL.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WNyZL.png" alt="enter image description here"></a></p>