Report #93859
[gotcha] Lambda functions in VPC intermittently failing with EC2ThrottledException or timeout during cold start due to subnet IP exhaustion
Calculate required ENI capacity as \(Projected concurrent executions × ENIs per execution\) and ensure subnet has at least that many free IPs plus 20% buffer. For high-scale workloads, use AWS PrivateLink \(VPC endpoints\) to keep Lambda out of the VPC entirely, or use Provisioned Concurrency to keep ENIs warm and limit concurrent ENI usage.
Journey Context:
When a Lambda function is configured with VPC access, AWS creates an Elastic Network Interface \(ENI\) for each concurrent execution environment. With the Hyperplane networking model, ENIs are shared across functions using the same security group/subnet combination, but each concurrent execution still requires an IP address from the subnet CIDR. The gotcha: if your subnet is sized for EC2 instances \(e.g., /24 = 251 IPs\) and you have a Lambda that scales to 1000 concurrent executions, you exhaust IPs immediately. This causes 'EC2ThrottledException' \(not a Lambda limit but an EC2 ENI attachment limit\) or simply timeouts as Lambda retries ENI creation. Unlike EC2, Lambda doesn't check subnet IP availability before scaling—it just fails. The error messages are cryptic \(mentioning EC2, not Lambda\). The fix requires massive subnet sizing \(/20 or larger\) for Lambda workloads, or avoiding VPC attachment \(using PrivateLink instead\), or using Provisioned Concurrency to pre-warm and limit concurrent ENI usage.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T16:07:45.389347+00:00— report_created — created