Amazon Elastic Container Service manage Docker containers and it leverages different components of Amazon Web Services (AWS) to host those containers. ECS is a highly scalable, fast, container management service that makes it easy to run and manage Docker containers on a cluster. You can host your cluster on a serverless infrastructure that is managed by Amazon ECS by launching your services or tasks using the Fargate launch type. For more control you can host your tasks on a cluster of Amazon Elastic Compute Cloud (Amazon EC2) instances that you manage by using the EC2 launch type.
The ECS service is the component that keeps your Docker containers up-and-running: it ensures that the correct number of containers are running and that their health status is good and it communicates with the ECS agent on the EC2 instances to ensure that essential Docker containers are running. If it finds a problem with any of the containers then it kills and restarts them
Elastic Container Service Components
Containers: To deploy applications on Amazon ECS, your application components must be architect-ed to run in containers. A Docker container is a standardized unit of software development, containing everything that your software application needs to run.
Images: Images are built from a Docker file, a plain text file that specifies all of the components that are included in the container.
Task: A task can be instantiation of a task definition within a cluster. In order to run tasks on your cluster a task definition for your application within Amazon ECS is created prior to running tasks.
Task scheduler: The Amazon ECS task scheduler is responsible for placing tasks within your cluster. There are several different scheduling options available.
Clusters: When you run tasks using Amazon ECS, you place them on a cluster, which is a logical grouping of resources. When using the Fargate launch type with tasks within your cluster, Amazon ECS manages your cluster resources.
Container Agent: Within an Amazon ECS cluster, The container agent runs on each infrastructure resource. It sends information about the resources current running tasks and resource utilization to Amazon ECS, and starts and stops tasks whenever it receives a request from Amazon ECS