title: Why is my Lambda unable to access the internet?
body: <p>I have a Lambda function which can be triggered from an API gateway or ALB request. I also have an RDS Aurora PostgreSQL instance, both of which are running within a VPC.</p>
  
  <p>I'm able to connect to the RDS instance from the Lambda just fine, however I can't access the internet, e.g. attempting to fire off a request to <a href="https://jsonplaceholder.typicode.com/todos/1" rel="nofollow noreferrer">https://jsonplaceholder.typicode.com/todos/1</a> will cause a timeout. </p>
  
  <p>I also can't connect to the remote database using a SQL client such as DBeaver.</p>
  
  <p>Here's some detail below but let me know if you need anything else. I'm stumped.</p>
  
  <p><strong>Lambda Inbound Rules</strong></p>
  
  <pre><code>Security group ID       Ports   Source
  sg-0f2c4426c8fc85235    80      0.0.0.0/0
  sg-0f2c4426c8fc85235    5432    0.0.0.0/0
  sg-0f2c4426c8fc85235    All     sg-0f2c4426c8fc85235
  sg-0f2c4426c8fc85235    22      0.0.0.0/0
  sg-0f2c4426c8fc85235    443     0.0.0.0/0
  </code></pre>
  
  <p><strong>Lambda Outbound Rules</strong></p>
  
  <pre><code>Security group ID       Ports   Destination
  sg-0f2c4426c8fc85235    All     0.0.0.0/0
  </code></pre>
  
  <p><strong>RDS Connectivity</strong></p>
  
  <p><img src="https://i.imgur.com/Xg7GZNB.png" alt="rds"></p>
  
  <p><strong>VPC</strong>
  <img src="https://i.imgur.com/ZO1gHu4.png" alt="vpc"></p>
  
  <p><strong>Public Subnet</strong>
  <img src="https://i.imgur.com/Oh2nBhr.png" alt="pubsub"></p>
  
  <p><strong>Private Subnet</strong>
  <img src="https://i.imgur.com/MwB7t5Z.png" alt="prisub"></p>
  
  <p><strong>EDITS</strong></p>
  
  <p><strong>Nat Gateway (associated with public subnet)</strong>
  <img src="https://i.imgur.com/cgGRXlH.png" alt="nat"></p>
  
  <p><strong>Route Tables</strong>
  <img src="https://i.imgur.com/JHkFexd.png" alt="rtables"></p>
  
  <p><strong>Route Table Routes</strong>
  <img src="https://i.imgur.com/vPJYMTg.png" alt="rtablerouteA"></p>
  
  <p><img src="https://i.imgur.com/mdmq16V.png" alt="rtablerouteB"></p>
  
  <p><img src="https://i.imgur.com/jGTKIph.png" alt="rtablerouteC"></p>
  
  <p><strong>EDIT 2</strong></p>
  
  <p><strong>Lambda Subnets</strong></p>
  
  <p><img src="https://i.imgur.com/MAnhwaq.png" alt="lamsub"></p>