Amazon Elastic Container Service (Amazon ECS) is a fully managed container orchestration service that helps you easily deploy, manage, and scale containerized applications.
There are three layers in Amazon ECS:
Create and manage an Amazon ECS cluster, which is a logical grouping of tasks or services, along with the necessary infrastructure resources like EC2 instances, AWS Fargate, or on-premises virtual machines.
Create Capacity for Amazon ECS, where your containers run. Includes creating launch template, auto scaling group, and capacity provider.
Create Task Definition. Task Definition is a blueprint for your application. It is a text file in JSON format that describes the parameters and one or more containers that form your application.
Tổng quan Amazon ECS (Elastic Container Service) Service is a service that run and maintain a specified number of instances of a task definition simultaneously in an Amazon ECS cluster. Creating ECS Service Create an ECS service based on an existing task definition using the following commands: ecs_service_name=$project-service # Create Service aws ecs create-service \ --cluster $ecs_cluster_name \ --service-name $ecs_service_name \ --task-definition $ecs_task_arn \ --desired-count 1 \ --network-configuration "awsvpcConfiguration={subnets=[$ecs_instance_subnet_id],securityGroups=[$ecs_instance_sgr_id]}" aws ecs update-service --cluster $ecs_cluster_name \ --service $ecs_service_name \ --desired-count 1 \ --load-balancers targetGroupArn=$alb_tgr_arn,containerName=`echo $ecs_task_definition | jq -r '.