AWS – Can an EC2 Instance Have Two Public Subnets for Creating a Load Balancer?

amazon ec2amazon-web-servicesload balancingsubnet

So I eventually want to set up a classic load balancer on AWS and I have a VPC with 2 public subnets, but now I am not sure if I can use those two subnets for that one EC2 instance or do I need two ec2 instances?

Best Answer

Some thoughts:

  • What's the point of a load balancer with only one instance? If you scale down to one instance that would make sense, but planning for only one instance all the time would have minimal benefits. Load balancers do offer benefits, they're a reverse proxy that offer your instance some protection against internet based threats.
  • Technically you can load balancer to one or more instances
  • Classic load balancer is not often used these days, best select from the more modern ALB / NLB unless you have a really odd edge case they can't cater for