Reputation: 1889
I'm trying to set up an NLB to provide the main ingress IP for my ECS Fargate instances, and I'm confused as to why you're required to specify one Elastic IP per subnet, and not just one IP for the whole thing. Does that mean each IP can only forward traffic to its own subnet? My destination instance replicas will be split across multiple subnets, so I just want one central IP that splits across all instances no matter what subnet.
And yes for this specific application, I do need a static IP for my load balancer, can't use DNS.
Can someone clarify for me why one IP is needed for each subnet, and if it's possible to just use one IP to load balance across many subnets?
Upvotes: 4
Views: 3812
Reputation: 238051
NLB will be deployed across multiple availability zones (AZ), if the associated subnets are in more then one AZ.
Lets say your subnets are in two AZs. In that case NLB will create two nodes, one per AZ, for high availability purposes. Each node will have its own static public IP address. Each node can only forward traffic to subnets in its AZs (not across AZs by default) If you use NLB's url, it will resolve to those two IP addresses.
If you want to only use one IP address of those two, you have to enable cross-zone load balancing. By default it is disabled.
Upvotes: 1