Nerd For Tech
Published in

Nerd For Tech

Creating the Amazon ECS Cluster and Task using the console

The architecture we will create in this article

Overview:
In this article, we will understand the high-level view of ECs and will do some basic stuff, that is to create the ECS Cluster and tasks using the console

  • Service : It defines, runs and maintains the tasks
  • Task : A running Container or A task is the instantiation of a task definition within a cluster.
  • ECS Container Agent : It allows container instances to connect to the Cluster.

Step 1: Creating Clusters
The first step is to create a Cluster. Goto ECS > Create Cluster >>Choose EC2 Linux + Networking, Since we are demonstrating the EC2 Type.

Choose Cluster Name(Any name), Instance Type(t2.micro to keep the cost as lowest as possible), Keypair(use existing pair), specify the number of tasks(2)>> Create Cluster

After my cluster is created, I will have the below output

Dashboard view after the cluster is created

Step 2: Creating Services and Tasks
Now let's create a service and add tasks to the cluster. Click Service > Create Service. When you will go through the step of creating the Service, choose

Any desired name
Launch Type: EC2
Any desired Service name
Number of task: 2
Choose existing Cluster VPC and Subnets

After you are done creating the service the dashboard will look like this:-

Dashboard after service creation

If I go to my Cluster and Service I see the below result :

Service is defined

Under Task, we see 2 tasks since we mentioned the number of tasks as 2, For me, the default name was picked by the AWS console as Fargate-Task even when I selected ec2 type.

if we click on our instances, we find they do not have the public IP. To connect them we have to go privately or we would need NAT Instances or Load Balancer for inbound traffic.

As a result, we are able to accomplish our goal. Do not forget to clean up to avoid any charges💰

Thanks for reading and Keep Pushing!!

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Manminder Singh

DevOps Engineer| 3x AWS Certified | Terraform Associate Certified | Linux Certified | Former IT HR | Naval Brat