0
votes

When configuring load balancer in AWS, we can't choose more than one subnet in an AZ. I want to understand the reason for this restriction. I believe the reason is because:

Two subnets in a VPC differ in only 2 aspects: private IP address assigned to instances and subnets could be private or public. IP address won't matter because private IP is all about internal working. For public or private subnet, you will deploy application to either private subnet or public subnet but not both. So, it does not make any sense to create multiple private or public subnets for same purpose. If you think you may need large number of resources in a subnet, you should size your subnet accordingly.

Is my reasoning correct?

2

2 Answers

0
votes

When you create ELB, AWS will use your subnet to put the network interface into. ELB service will use those interfaces to communicate with resources in your private VPC.

So they don't need 2 subnets in the same AZ for that purpose. on the other hand, they need 2 AZ for HA.

0
votes

The reason for the restriction is that placing an ALB on more than one subnet in a single availability zone would serve no purpose.

Internet-facing ALBs must be on a public subnet, otherwise they are externally unreachable because traffic to and from browsers can't traverse the Internet Gateway in both directions from a private subnet.

ALBs do not need to be on the same subnet(s) as the instances behind them, and usually are not, because you typically want the instances on private subnets. There is no performance disadvantage to having the balancer on a different subnet than the instances, within the same availability zone. This is a common misconception.