Create Elastic Container Service (ECS)

Overview

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:

  • Capacity - The infrastructure where your containers run
  • Controller - Deploy and manage your applications that run on the containers
  • Provisioning - The tools that you can use to interface with the scheduler to deploy and manage your applications and containers

Content

  • Creating ECS Cluster
  • 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.

  • Creating ECS Capacity for Elastic Container Service (ECS)
  • Create Capacity for Amazon ECS, where your containers run. Includes creating launch template, auto scaling group, and capacity provider.

  • Creating ECS Task Definition
  • 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ạo ECS Service
  • 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 '.