AWS ECS Terms Introduction Tutorial
Most of the time when someone introduces ECS to you it goes something like this. Here are all the terms:
Summary of the ECS Terms
-
Task Definition — This a blueprint that describes how a docker container should launch. If you are already familiar with AWS, it is like a LaunchConfig except instead it is for a docker container instead of an instance. It contains settings like exposed port, docker image, CPU shares, memory requirement, the command to run and environmental variables.
-
Task — This is a running container with the settings defined in the Task Definition. It can be thought of as an “instance” of a Task Definition.
-
Service — Defines long-running tasks of the same Task Definition. This can be one running container or multiple running containers all using the same Task Definition.
-
Cluster — A logic group of EC2 instances. When an instance launches the ecs-agent software on the server registers the instance to an ECS Cluster. This is easily configurable by setting the ECS_CLUSTER variable in /etc/ecs/ecs.config described here.
-
Container Instance — This is just an EC2 instance that is part of an ECS Cluster and has docker and the ecs-agent running on it.
I remember when I first got introduced to the all the terms, it was a little bit overwhelming. How does it feel when you are learning a subject for the first time, and you are thrown a dictionary of terms? It’s a little hard to learn that way.
Though AWS provides some excellent detailed diagrams to help explain the ECS and the terms, I was looking for something simpler. Here is a simplified diagram to help visualize and explain the terms:
In this diagram, you can see that there are 4 running Tasks or Docker containers. They are part of an ECS Service. The Service and Tasks span 2 Container Instances. The Container Instances are part of a logical group called an ECS Cluster.
I did not show a Task Definition in the diagram because a Task is simply an “instance” of Task Definition.
I hope this diagram helps others.
Thanks for reading this far. If you found this article useful, I'd really appreciate it if you share this article so others can find it too! Thanks 😁 Also follow me on Twitter.
Got questions? Check out BoltOps.
You might also like
More tools:
-
Kubes
Kubes: Kubernetes Deployment Tool
Kubes is a Kubernetes Deployment Tool. It builds the docker image, creates the Kubernetes YAML, and runs kubectl apply. It automates the deployment process and saves you precious finger-typing energy.
-
Jets
Jets: The Ruby Serverless Framework
Ruby on Jets allows you to create and deploy serverless services with ease, and to seamlessly glue AWS services together with the most beautiful dynamic language: Ruby. It includes everything you need to build an API and deploy it to AWS Lambda. Jets leverages the power of Ruby to make serverless joyful for everyone.
-
Lono
Lono: The CloudFormation Framework
Building infrastructure-as-code is challenging. Lono makes it much easier and fun. It includes everything you need to manage and deploy infrastructure-as-code.