I'm looking at https://docs.aws.amazon.com/general/latest/gr/aws-ip-ranges.html trying to work out what IP address ranges are used by AWS Lambda but in the linked JSON file I don't see any references to the Lambda service. Does AWS Lambda just use EC2 under the hood and are those the IP address ranges I should be looking at?
The lambdas have 6 /20 private subnets that they are configured to run in.
The pattern's approach helps you create an AWS Lambda function that uses an Elastic IP address as the outbound IP address. By following the steps in this pattern, you can create a Lambda function and a virtual private cloud (VPC) that routes outbound traffic through an internet gateway with a static IP address.
Click IP Address Manager > IP Addresses > Manage Subnets & IP Addresses. In the network tree pane on the left, click the subnet to which you want to add your new IP address range. Click Add IP Range. Enter the starting IP address and the ending IP address of your IP address range.
The only official answer I can find is on the official AWS forum (from 2015) is:
Unfortunately Lambda does not have a fixed set of IP addresses which it uses.
VPC support, which is in our roadmap, should allow you to control the public IP addresses in use by your function through the use of an EC2 NAT.
As far as I can tell, if you need to control/know the source IP of outgoing requests from your Lambda function, the official answer is still to put it in your VPC and use NAT.
Another idea would be to make a request in your non-VPC Lambda function and see what IP address you see. Then try to find it in the ip-ranges.json file and use the block of whatever service it turns out it is using currently. Just take into account that this may not work forever.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With