The shop now runs on two instances, web-1 in us-east-1a and web-2 in us-east-1b, both in the security group web-sg. Each serves its page on / and answers /health once the app is up. Customers still need one address.
- Keep the default VPC's id in
VPC, the subnet ofus-east-1ainSUBNET_Aand ofus-east-1binSUBNET_B, and the two instances' ids inWEB1andWEB2. - Create a security group
alb-sgfor the load balancer, open on port 80 to the world, and keep its id inALB_SG. - Create a target group
web-tgfor the two servers on port 80, register both, and set its health check to ask/healthevery 10 seconds, healthy after 2 passes. - Create the load balancer
market-albin both subnets withalb-sg, and a listener on port 80 that forwards toweb-tg. Wait until it isactive. - Check the targets' health. Read the reason they give, fix what causes it, and check again until both are
healthy. - Fetch the load balancer's DNS name a few times and see both servers answer.