Using Auto Scaling groups to scale web servers

In the last chapter, we created our web server generic role using CloudFormation. When used, the template creates a single EC2 instance. We are going to do two things: replace the section that creates the EC2 instance in favor of creating an Auto Scaling group and add a section to create an Elastic Load Balancer (ELB) that will serve as our new entry point to our application.

Combining ELB and Auto Scaling groups creates a very robust architecture. While at the administrator level, an ELB instance looks like a single entity, under the hood, AWS will in fact provision multiple resources to handle possible failures and auto-scale the resources to handle any surge in traffic. In addition, a number of managed services can be registered to an ELB. In this section, we will see how instead of interacting with EC2 instances, we will create an Auto Scaling group and register it with an ELB such that an instance added or removed from our Auto Scaling group will also automatically appear and disappear from the load balancer instance pool. Lastly, both ELB and Auto Scaling groups can work across multiple availability zones. This means that if an outage occurs on a subset of availability zones, the load balancer will be able to survive the outage and the Auto Scaling group is able to reprovision hosts to get back to the desired instance count:

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset