<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Jun</title>
    <description>The latest articles on DEV Community by Jun (@jun_uen0).</description>
    <link>https://dev.to/jun_uen0</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F782615%2F81e91fa3-7309-41af-801d-5c485781aa7e.JPEG</url>
      <title>DEV Community: Jun</title>
      <link>https://dev.to/jun_uen0</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/jun_uen0"/>
    <language>en</language>
    <item>
      <title>Create an ECS Fargate Service Step by Step</title>
      <dc:creator>Jun</dc:creator>
      <pubDate>Sat, 06 Jun 2026 01:40:34 +0000</pubDate>
      <link>https://dev.to/jun_uen0/create-an-ecs-fargate-service-step-by-step-1a7d</link>
      <guid>https://dev.to/jun_uen0/create-an-ecs-fargate-service-step-by-step-1a7d</guid>
      <description>&lt;h2&gt;
  
  
  Prepare Docker Image at ECR
&lt;/h2&gt;

&lt;p&gt;If you don't have an image at ECR, please check this article and get it.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/jun_uen0/push-docker-image-to-aws-ecr-fb2"&gt;Push Docker image to AWS ECR&lt;/a&gt;&lt;br&gt;
In this article, I use React app image.&lt;/p&gt;

&lt;h2&gt;
  
  
  About ECS
&lt;/h2&gt;

&lt;p&gt;AWS Elastic Container Service &lt;br&gt;
It's a highly scalable and fast container management service.&lt;/p&gt;

&lt;p&gt;Terminologies in ECS&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Task / Task Definition: For setting container&lt;/li&gt;
&lt;li&gt;Service: For setting tasks, auto-scaling, VPC, etc&lt;/li&gt;
&lt;li&gt;Cluster: The cluster of services&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Hands-On Steps
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Create ECS Cluster&lt;/li&gt;
&lt;li&gt;Create ECS Task Definition&lt;/li&gt;
&lt;li&gt;Create ECS Service&lt;/li&gt;
&lt;li&gt;Confirm ECS Fargate running&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  1. Create ECS Cluster
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Select "Create Cluster" at the ECS console&lt;/li&gt;
&lt;li&gt;Select "Only net-working (Fargate)"&lt;/li&gt;
&lt;li&gt;Name cluster&lt;/li&gt;
&lt;li&gt;Create VPC (optional)&lt;/li&gt;
&lt;li&gt;Select "Create"&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;※ Wait 1 or 2 minutes.&lt;/p&gt;

&lt;h1&gt;
  
  
  2. Create ECS Task Definition
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;Task is like a Docker container. In this configure console, you can configure the container. So it's like a docker-compose.yml.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ol&gt;
&lt;li&gt;Select "Task Definitions" at the ECS console&lt;/li&gt;
&lt;li&gt;Select "Create new Task Definition"&lt;/li&gt;
&lt;li&gt;Select "Fargate"&lt;/li&gt;
&lt;li&gt;Name task definition&lt;/li&gt;
&lt;li&gt;Select "ecsTaskExecution" for task role&lt;/li&gt;
&lt;li&gt;Select "Linux" for Operating system family&lt;/li&gt;
&lt;li&gt;Select "0.5GB" for Task memory&lt;/li&gt;
&lt;li&gt;Select "0.25vCPU" for Task CPU&lt;/li&gt;
&lt;li&gt;Add container

&lt;ul&gt;
&lt;li&gt;Container name: Insert name&lt;/li&gt;
&lt;li&gt;Image: Copy ECR Image URI including tag&lt;/li&gt;
&lt;li&gt;Port mappings: "3000"&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Create&lt;/li&gt;
&lt;/ol&gt;

&lt;h1&gt;
  
  
  3 Create ECS Service
&lt;/h1&gt;

&lt;blockquote&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Configure service&lt;/li&gt;
&lt;li&gt;Select "Cluster" at the ECS console&lt;/li&gt;
&lt;li&gt;Select the cluster you created&lt;/li&gt;
&lt;li&gt;Select the "Service" tab&lt;/li&gt;
&lt;li&gt;Select "Create"&lt;/li&gt;
&lt;li&gt;Launch type: "Fargate"&lt;/li&gt;
&lt;li&gt;Task Definition: Select the task you created&lt;/li&gt;
&lt;li&gt;Service name: Insert name&lt;/li&gt;
&lt;li&gt;Number of tasks: 1&lt;/li&gt;
&lt;li&gt;&lt;p&gt;"Next step" and skip other items&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure network&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cluster VPC: choose your VPC for ECS (If you created VPC at "1. Create ECS Cluster", use it )&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select Subnets as many as you need&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Click "Edit" for Security groups&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add Inbound rules： custom TCP / Anywhere / port 3000&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;&lt;p&gt;"Next step" and skip other items&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Set Auto Scaling&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;Select "Do not adjust the service’s desired count"&lt;/p&gt;&lt;/li&gt;

&lt;li&gt;&lt;p&gt;"Next step"&lt;/p&gt;&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;⇒ Check all items again, and "Create Service"&lt;/p&gt;

&lt;h1&gt;
  
  
  4. Confirm ECS Fargate running
&lt;/h1&gt;

&lt;ol&gt;
&lt;li&gt;Select "Cluster" at the ECS console&lt;/li&gt;
&lt;li&gt;Select the cluster you created&lt;/li&gt;
&lt;li&gt;Select the "Tasks" tab&lt;/li&gt;
&lt;li&gt;Select task running&lt;/li&gt;
&lt;li&gt;Copy public IP&lt;/li&gt;
&lt;li&gt;Access to public IP with &lt;code&gt;:3000&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Good job.&lt;br&gt;
Please make sure you deleted the cluster.&lt;br&gt;
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.&lt;/p&gt;

</description>
      <category>aws</category>
      <category>ecs</category>
      <category>fargate</category>
      <category>docker</category>
    </item>
  </channel>
</rss>
