Skip to main content

Command Palette

Search for a command to run...

AWS Day 38: Deploying Containerized Applications with Amazon ECS

Updated
3 min readView as Markdown
AWS Day 38: Deploying Containerized Applications with Amazon ECS
A

"I'm a 3rd-year Computer Engineering student at Marwadi University with skills in C++, web development (MERN stack), and DevOps tools like Kubernetes. I contribute to open-source projects and share tech knowledge on GitHub and LinkedIn. I'm learning cloud technologies and app deployment. As an Internshala Student Partner, I help others find jobs and courses." now currently focusing on #90DaysOfDevops

Containerization has become the standard way to package and deploy modern applications. Instead of installing software directly on virtual machines, developers package everything—including dependencies—inside Docker containers.

AWS simplifies container deployments through two powerful managed services:

  • Amazon Elastic Container Registry (ECR) for storing Docker images.

  • Amazon Elastic Container Service (ECS) for running containers.

When combined with AWS Fargate, you don't even need to manage EC2 instances. AWS provisions and manages the infrastructure while you focus on your application.

In today's lab, I deployed a Dockerized web application from Amazon ECR to Amazon ECS using the Fargate launch type.

Step 1 — Create a Private Amazon ECR Repository

Created a private repository named:

xfusion-ecr

This repository securely stores Docker images that can later be deployed to Amazon ECS.

Step 2 — Authenticate Docker with Amazon ECR

Logged in to Amazon ECR using AWS CLI.

This allows Docker to push images securely into the private repository.

Step 3 — Build Docker Image

Built the Docker image from the Dockerfile located inside:

/root/pyapp

After building successfully, Docker generated the local image.

Step 4 — Tag the Docker Image

Tagged the image using the repository URI.

Using tags helps version container images and identify releases.

Step 5 — Push Docker Image to Amazon ECR

Pushed the image successfully to Amazon ECR.

Now the image becomes available for ECS deployments.

Step 6 — Create Amazon ECS Cluster

Created an ECS Cluster named:

xfusion-cluster

Selected

  • AWS Fargate

instead of EC2 launch type.

Since Fargate is serverless, AWS manages the infrastructure automatically.

Step 7 — Create ECS Task Definition

Created

xfusion-taskdefinition

Configured

  • Docker Image URI

  • CPU

  • Memory

  • Port Mapping

The Task Definition acts as a blueprint describing how the container should run.

Step 8 — Create ECS Service

Created

xfusion-service

Configured the service to maintain:

  • Desired Tasks = 1

This ensures ECS automatically keeps one healthy container running.

Step 9 — Verify Deployment

Once deployment completed,

The task entered the Running state.

Accessing the application through the public IP displayed the web page successfully.

Deployment completed successfully.

Conclusion

This lab demonstrated a complete end-to-end container deployment workflow on AWS. Starting with a Docker image, storing it securely in Amazon ECR, and deploying it through Amazon ECS Fargate highlights how AWS simplifies modern application deployment without requiring server management.

Understanding Amazon ECS, Amazon ECR, and AWS Fargate is a foundational skill for Cloud Engineers and DevOps Engineers building scalable, cloud-native applications.

100 Days Of Cloud (AWS)

Part 1 of 32

This series documents my 100 Days of Cloud journey with AWS using KodeKloud. Each blog covers one daily task with hands-on practice, simple explanations, and real learning for beginners and cloud aspirants.

Up next

AWS Day 37: Managing EC2 Access with S3 Role-based Permissions | KodeKloud 100 Days of Cloud

On Day 37 of the KodeKloud 100 Days of Cloud Challenge, I explored one of the AWS security best practices—granting an EC2 instance access to Amazon S3 using IAM Roles instead of storing AWS credential

More from this blog

A

Anand Raval

134 posts

I'm Anand Raval, a Cloud & DevOps Engineer with AWS Solutions Architect Associate (SAA-C03), Certified Kubernetes Administrator (CKA), and Azure Fundamentals (AZ-900) certifications. This blog covers AWS, Kubernetes, Terraform, CI/CD, cloud architecture, automation, cost optimization, troubleshooting guides, and hands-on DevOps projects.