title: Lambda to access MongoDB of EC2
body: <p>Here, I am having <code>Lambda</code> &amp; <code>EC2</code> Instance both are under same VPC &amp; Subnet.</p>
  
  <p>Both are having to save security group with the rule to allow inbound connection from same security group for all ports. Lambda is not able to access MongoDB when it is inside VPC. </p>
  
  <p>If I try to take it out from VPC and open port for 0.0.0.0/0 then only it works.</p>
  
  <p>I need the solution for this...</p>