I have a project that involves running several hundred Lambda functions fetching data from the internet.
These functions are running inside a private subnet of my VPC.
I would like these functions to not all have the same IP for their internet traffic.
My understanding is that I should create a NAT gateway in a public subnet, but I cannot find how to have multiple public IPs on that NAT gateway to have some sort of randomization.
Is that even possible?
How should one proceed to achieve this?
The other answers here were correct previously, but as of Feb 2023, NAT Gateway now supports registering multiple IP addresses, allowing you to scale up to about 440,000 concurrent connections to the same destination IP / destination port.
Here's the announcement, and here are the relevant API docs for the new capabilities:
associate-nat-gateway-address
disassociate-nat-gateway-address
assign-private-nat-gateway-address
unassign-private-nat-gateway-address
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