AWS provide different services and categories them on base of computation, storage, databases, management, Analytics, Messaging, Developer Tools etc.
ECS comes under the computing services.
Amazon EC2 Container Service (ECS) – Container Management for the AWS Cloud
Run your applications packaged as Docker containers.EC2 Container Service (or ECS for short). This service will make it easy for you to run any number of Docker containers across a managed cluster of Amazon Elastic Compute Cloud (EC2) instances using powerful APIs and other tools. You do not have to install cluster management software, purchase and maintain the cluster hardware, or match your hardware inventory to your software needs when you use ECS.
Here I will explain the steps to set up the docker based application in ECS and terminology.
- Cluster: A cluster is a pool of EC2 instances in a particular AWS Region, all managed by ECS. One cluster can contain multiple instance types and sizes, and can reside within one or more Availability Zones.
This is the first step to creating ECS.before anything you need cluster it can be default or you can create new one.
- EC2 Instance type: In cluster you need to choose the Amazon EC2 instance type for your container instances. The instance type that you select determines the resources available for your tasks to run on.
Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides secure, resizable compute capacity in the cloud.it's like your PC you can install mongo, MySQL (for MySQL RDS is best), PHP, node or whatever you want in it.While Creating EC2 you have to define which OS you want to use in ec2.You can access EC2 using pem file that will be provided by AWS during creating ec2.https://aws.amazon.com/ec2/
Container: – A container is a packaged (or “Dockerized,” as the cool kids like to say) application component. Each EC2 instance in a cluster can serve as a host to one or more containers.
For every task definition, you need to specify container which tells about CPU, memory and other resources.
ECR Registries Amazon EC2 Container Registry (Amazon ECR) is a managed AWS Docker registry service that is secure, scalable, and reliable. Amazon ECR supports private Docker repositories with resource-based permissions using AWS IAM so that specific users or Amazon EC2 instances can access repositories and images. Developers can use the Docker CLI to push, pull, and manage images.
Once the above environment is ready you can place task or start services.
Task definition: A task definition is like a blueprint for your application. In this step, you will specify a task definition so Amazon ECS knows which Docker image to use for containers, how many containers to use in the task, and the resource allocation for each container.
service services manage the task that you have created.once you have created a task definition, you will configure the Amazon ECS service. A service launches and maintains copies of the task definition in your cluster. For example, by running an application as a service, Amazon ECS will auto-recover any stopped tasks and maintain the number of copies you specify.
NOTE: Elastic load Balancing can be setup before any thing done. when you want to create services you can configure with load balancer.load balancer conttain target group and container which need to be balanced.https://aws.amazon.com/elasticloadbalancing/
- Elastic Load Balancing Elastic Load Balancing automatically distributes incoming application traffic across multiple Amazon EC2 instances. It enables you to achieve fault tolerance in your applications, seamlessly providing the required amount of load balancing capacity needed to route application traffic