Reputation: 4680
I read that each AWS Lambda invocation gets it's own private IP (when running in VPC).
Does this mean that if I want 50,000 Lambdas running in parallel I need it to run in a VPC subnet with 50,000 available private IPs?
Upvotes: 4
Views: 1717
Reputation: 12213
Short answer: Yes.
If you want to run 50000 concurrent lambdas inside VPC, you will need more than 50000 IP Addresses as some IP Addresses may not get released right after the end of lambda execution.
There is a soft limit of running 1000 lambdas per account running concurrently. It is a soft limit so you can always submit a ticket and ask AWS to raise it but I doubt they will raise it to 50000.
This is no longer true. Please refer to the answer by @luk2302.
Upvotes: 4
Reputation: 57154
Short (updated) answer: No. You do not need a large VPC.
The accepted answer was correct for some time. However back in 2019 AWS changed how Lambdas work within VPCs: https://aws.amazon.com/blogs/compute/announcing-improved-vpc-networking-for-aws-lambda-functions/
Since then each distinct 'subnet + security group' combination now only needs one IP / one ENI within your VPC and that ENI is shared across all execution environments / lambda invocations across all different lambda functions. So even if you have 100 lambda functions within your VPC and 10k concurrent invocations you only need one IP as long as the lambdas are configured similarly.
Upvotes: 9