Amazon Elastic Container Service (ECS), also known as Amazon EC2 Container Service, is a managed service that allows users to run Docker-based applications packaged as containers across a cluster of EC2 instances. Running simple containers on a single EC2 instance is simple but running these applications on a cluster of instances and managing the cluster is being administratively heavy process. With ECS, Fargate launch type, the load, and responsibility of managing the EC2 cluster is transferred over to the AWS and you can focus on application development rather than management of your cluster architecture.
Is the AWS service that allows ECS to run containers without having to manage and provision the resources required for running these applications.
a) Pas : Services to run container
b) Works as a pay as you go model
c) Services in AWS to run container at scale
--> ECS can be operated in 2 ways:
-
EC2 Launch type (Manage your own server)
-
Serverless (Fargate)
EC2 | DOCKER | ECR | ECS | FARGATE | APPLICATION LOAD BALANCER
STEP 1 : Lauch EC2 instance, install Docker, Build dockerimage .
STEP 2 :
Creating ECR in Linux OR Windows
Login to ECR
aws ecr-public get-login-password --region us-east-1 | docker login --username AWS --password-stdin public.ecr.aws/i2d4i5f8
Tag existing image as AWS ECR repo
docker tag myecr-repo:latest public.ecr.aws/i2d4i5f8/myecr-repo:latest
Push image into ECR
docker push public.ecr.aws/i2d4i5f8/myecr-repo:latest
STEPS 3 :
Creating Application Load Balancer
STEP 4 :
Create Task Definition
Task : It is blue print, which describes how to lauch the AWS container.
Create AWS ECS cluster
Creating Services
Steps 5 :
VALIDATION
STEP 6:
Set Up Auto Scaling (Optional): Configure auto-scaling for your ECS service to automatically adjust the number of tasks based on metrics such as CPU or memory utilization.
Monitor and Test: Monitor your ECS cluster and application performance using CloudWatch metrics and logs. Test your application to ensure itβs working as expected.
Conclusion:
Deploying web applications on Amazon ECS streamlines the process using containerization technology. By following these key steps and leveraging AWS services like EC2, Docker, ECR, Load Balancer, and Fargate, you can achieve scalable, reliable, and efficient deployment of your web applications on AWS.