Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

AWS Lambda IP address ranges

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?

like image 511
tschumann Avatar asked Jun 17 '20 21:06

tschumann


People also ask

How many IP addresses does Lambda use?

The lambdas have 6 /20 private subnets that they are configured to run in.

Do AWS Lambda functions have IP addresses?

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.

How do I assign an IP address to a range?

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.


1 Answers

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.

like image 90
stefansundin Avatar answered Sep 18 '22 14:09

stefansundin