title: How can I use a vpc security group to restrict inbound access to my Lambda?
body: <p>I have a simply maked it with serverless endpoint for check some token. Lets say the path is &quot;/checktoken&quot;. And want to access to it only with my Ip address, thats why connect my Lambda with VPC(2 private subnets and security group).</p>
  <p>But problem is even I maked security group in/outbound rules as https with my IP address, I can request to the endpoint with different IP address.</p>
  <p>I have used AWS = CloudFront + Route53 for DNS, Lambda + Api Gateway for endpoint.</p>
  <p>I made a whitelist IP with resource policy in Api gateway which works, but its not the solution I want.</p>
  <p>The required solution is vpc's security group should allow request only from whitelisted IP in its rule.</p>