AWS – Elastic Container Service (ECS) – Ecosystem

AWS ECS system helps us to capitalise on Docker functionalities. Lets talk about a normal work flow of a docker based application.

  • Developing feature/code – devs will work here on new feature or existing app and write code for same.
  • Dockerizing – devs/admins will write DockerFile, which will incorporate dependencies and functional code.
  • Docker Image – in traditional work flow we can tag this step as packaging. Here we are building Docker Image which can be run on any docker environment.
  • Running Docker Image – we will instantiate container from the image which is housing our functional code – and test our feature or deploy to prod post validation.

AWS ECS helps and simplifies this flow when we use it in conjunction with AWS CodeCommit, AWS ECR Registry, AWS CodeBuild

In this and upcoming articles we will be exploring AWS ECS around these services and will try to understand how we can leverage AWS ECS to build and ship containerized app faster with durability.

When it comes down to deploying containers with AWS ECS – it comes in two flavours which are decided based on where we want to deploy our containers and how we want to build for the same.

We will try to understand this in bit more detail.

AWS ECS is offered in 2 launch types :

  • Fargate launch type
  • EC2 launch type

In Fargate Launch Type we are only concerned about the container definition and not where and how container will be run or provisioned also capacity assignment. All these tasks would be handled by Fargate.

In EC2 Launch Type we will be responsible for the underlying infrastructure on which our containers will be provisioned. Cluster of EC2 instance would serve as host machines where we will be deploying our containers.

So which one we should use ?

Answering this is going to be subjective in nature and depends on who much visibility or control one wants on the end resulting environment. In EC2 Launch Type we would be responsible for packing up of containers to different machines and had to manage capacity provisioning. We would be paying for unused capacity as well in this case.

In Case of Fargate we would be charged for what you use and container packaging is handled for you.

Should we always use Fargate then ?

With EC2 Launch Type we have visibility over where our containers are getting deployed, which would come handy when we want certain containers to be deployed together or on certain type of host. Which we cant do with Fargate.

Thats all folks !!

We have explored a lot in this article – in the upcoming article we will be working on setting up ECS pipeline right from scratch.

Gaurav Bajpai