IP Address exhaustion for lambdas in VPC

This answer is now out of date. See this blog post or other AWS documentation for up to date information.


This page says how many ENIs are required when using Lambda inside a VPC - this is per subnet

If your Lambda function accesses a VPC, you must make sure that your VPC has sufficient ENI capacity to support the scale requirements of your Lambda function. You can use the following formula to approximately determine the ENI requirements.

Projected peak concurrent executions * (Memory in GB / 3GB)

Let's say you have 10 concurrent executions of a lambda with 1GB allocated, that is 10 x 1 / 3 = 3.33 or 4 ENIs / private IPs per subnet. If you have 100 concurrent executions with 2GB allocated it's 80 ENIs / private IPs per subnet. I don't think there's any description of how often the ENIs are created and deleted, and that implementation detail could change over time.

You can look at ENIs in the console or the ENI API.

Lambda has to have permissions to create and delete ENIs, as per this question.