AWS Elastic Container Service – Everything you need to know | part 2

In order to understand and work with ECS it’s important to get to know other services it associates with. AWS Auto Scaling Group, AWS Elastic Load Balancer and AWS Virtual Private cloud are such services. Following is a nutshell of the functionality of these services required to understand ECS and we’ll discuss in details of these services in a later section.

If you have missed part 1 of the ECS tutorial series please view it here. AWS Elastic Container Service – Everything you need to know | part 1

Auto Scaling Group (ASG)

AWS ASGServices rents instances on your behalf to run docker containers.

One of the ways ECS makes you run Docker containers is by using Auto scaling groups. What ASG does is that it creates a group of identical clones of an instance – with the exact configuration. Auto scaling group (ASG) is not able to run a diverse set of configurations, but the exact same copy.  These instances are managed by a central service and almost all the time its controlled by another service and rarely used individually.

Imagine an occurrence, where the cluster is always instructed to run 6 instances. However, due to some unforeseen circumstance one of these instances crashed. The auto-scaling group is now responsible to maintain the proper number of healthy instances (in this case 6 instances), thereby, it fires another instance to maintain its equilibrium.

Elastic Load Balancer (ELB)

AWS ELBELB controls ASG. It provides 2 main functionalities:

            1. Connects incoming request to instances.
            2. Monitor instances (ASG), to look at its load. ELB uses AWS CloudWatch to monitor the load in ASG and instruct ASG if to fire up or fire down instances based on the load.



Virtual Private Cloud (VPC)

AWS VPCAWS VPC enables you to launch AWS resources into a virtual network that you’ve defined.

ECS depends on VPC. A group of instances otherwise isolated from the internet, can connect with each other using VPC. Instances can connect to one of this virtual networks that will allow to make direct connections to each other.

Instances in addition to being connected to a VPC, can also be connected to the outside internet, or they could even be connected to many VPCs all at once.

ELBs are able to forward connections into VPCs to allow machines on the outside to make use of the services offered within a VPC. In addition, ELBs are capable of connecting directly to a container running on an instance in a VPC.