Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I have a single NAT Gateway with multiple public IPs?

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?

like image 759
NewbiZ Avatar asked Sep 05 '25 04:09

NewbiZ


1 Answers

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
like image 139
Dan Avatar answered Sep 07 '25 20:09

Dan