Create an ECS Fargate Service Step by Step

Published: (June 5, 2026 at 09:40 PM EDT)
3 min read
Source: Dev.to

Source: Dev.to

Prepare Docker Image at ECR

If you don’t have an image at ECR, please check this article and get it. Push Docker image to AWS ECR AWS Elastic Container Service Terminologies in ECS Task / Task Definition: For setting container Service: For setting tasks, auto-scaling, VPC, etc Cluster: The cluster of services Create ECS Cluster Create ECS Task Definition Create ECS Service Confirm ECS Fargate running ECS Cluster is a cluster of services that is EC3 instances. But no one can control the EC2 via SSH access because each EC2 instance is hidden. Select “Create Cluster” at the ECS console Select “Only net-working (Fargate)” Name cluster Create VPC (optional) Select “Create” ※ Wait 1 or 2 minutes. Task is like a Docker container. In this configure console, you can configure the container. So it’s like a docker-compose.yml. Select “Task Definitions” at the ECS console Select “Create new Task Definition” Select “Fargate” Name task definition Select “ecsTaskExecution” for task role Select “Linux” for Operating system family Select “0.5GB” for Task memory Select “0.25vCPU” for Task CPU Add container

Container name: Insert name Image: Copy ECR Image URI including tag Port mappings: “3000” Create ECS Service is the collection of ECS Tasks and it’s related to ALB and AutoScaling Group. ECS Service needs ECS Task when created, but it’s technically not a subordinate of ECS Task because you can assign ECS Task to ECS Cluster without Service setting. Configure service Select “Cluster” at the ECS console Select the cluster you created Select the “Service” tab Select “Create” Launch type: “Fargate” Task Definition: Select the task you created Service name: Insert name Number of tasks: 1 “Next step” and skip other items

Configure network

Cluster VPC: choose your VPC for ECS (If you created VPC at “1. Create ECS Cluster”, use it )

Select Subnets as many as you need

Click “Edit” for Security groups Add Inbound rules: custom TCP / Anywhere / port 3000 “Next step” and skip other items

Set Auto Scaling

Select “Do not adjust the service’s desired count”

“Next step”

⇒ Check all items again, and “Create Service” Select “Cluster” at the ECS console Select the cluster you created Select the “Tasks” tab Select task running Copy public IP Access to public IP with :3000

Good job. Please make sure you deleted the cluster. It’s better to delete any resources in AWS if you don’t need to operate it for a long time or if you just created it for learning.

0 views
Back to Blog

Related posts

Read more »

Mobile Midsommer Madness

!Cover image for Mobile Midsommer Madnesshttps://media2.dev.to/dynamic/image/width=1000,height=420,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploa...