amazon-web-servicesamazon-elbavailability-zone

Availability Zones and Load Balancer


I have a basic question with respect to how a load balancer works. I have a VPC created with 3 subnets one in each availability zone(us-west-2a,us-west-2b,us-west-2c) and a 4th subnet in the same availability zone us-west-2a.

Now when I enable Availability Zones for the load balancer, I enable it in us-west-2a,us-west-2b,us-west-2c (subnet1, subnet2, subnet3).

I also have instances running in subnet 4 in us-west-2a. How to enable the load load balancer route traffic to instances in the 4th subnet? Any thoughts?


Solution

  • Based on the comments and chat discussion.

    The question arises from confusion between subsets selected when one creates NLB, and subsets used by instances.

    Since the OP has enabled 3 subnets in 3 AZs (us-west-2a,us-west-2b,us-west-2c; one subnet per AZ) for the NLB, instances can be in any subset withing these zones and same VPC. The instances do not have to be in the same subnets as the NLB.

    Therefore, since the 4th subnet is in us-west-2a, instances created in this subnet need to be only registers with a target group used by NLB.