Skip to main content

Command Palette

Search for a command to run...

Amazon ECS and ECR Project

Updated
4 min read
Amazon ECS and ECR Project
G

Gurucharan DevOps Engineer | Continuous Integration/Continuous Deployment | Automation Enthusiast

Welcome to my LinkedIn profile! I'm an aspiring DevOps engineer with a strong background in software development and system administration. My goal is to bridge the gap between development and operations, delivering efficient and reliable software solutions through seamless collaboration.

With experience in continuous integration/continuous deployment (CI/CD) pipelines, I specialize in automating software delivery processes to enhance development efficiency and quality. I excel in fast-paced, dynamic environments, leveraging infrastructure as code (IaC) tools like Terraform and cloud platforms such as AWS, Azure, and GCP to create scalable and resilient architectures.

My technical skill set includes proficiency in scripting languages (Python, Bash), containerization technologies (Docker, Kubernetes), and configuration management tools (Ansible, Chef). I possess a deep understanding of networking protocols and security principles, ensuring robust and secure environments.

Beyond technical experience, I believe in collaboration, cross-functional teams, and continuous learning. I thrive on solving complex challenges and seek opportunities for growth and innovation.

If you're looking for a passionate DevOps engineer to streamline software delivery, enhance system reliability, and drive organizational success, let's connect! I'm open to exciting opportunities and collaborations. Feel free to reach out via LinkedIn or email.

Let's build the bridge between development and operations, enabling continuous improvement and innovation!

Overview of the project

Hello everyone in this project we gonna get code from GitHub and make a docker image with the help of a docker file and push it into Amazon ECR(Elastic Container Registry) and then run this in Amazon ECS(Elastic Container Service) with the help of Fargate which is a serverless architecture through task definition.

AWS Fargate

AWS Fargate is a serverless compute engine for containers that allows you to run Docker containers without managing the underlying infrastructure. It automatically provisions the required resources for your containers and integrates seamlessly with other AWS services, making it easy to deploy and manage container workloads at scale.


Prerequisite

  1. Should know how to create EC2 instance

    like this

    and connect it to EC2 connection or SSH client connection it's up to you in my case I will go with EC2 connection like this

  2. Making an IAM user and creating an access key through the command line

  3. Know how to create a repository in ECR

  4. Creating a cluster in ECS and task definition

Let's start with the project


Step 1: Create a IAM user

like this

With the permission Policies to this two

Step 2: Create a cluster

like this

Step 3: Create a Public Repository in ECR

like this

Step 4: In IAM user go to the security credentials

and create an access key like this

go through Commands Line Interface

and create access key

here you can see both the access key and secret access key

Step 5: In EC2 connection run this command

after this run these

Step 6: Now copy the Access key and paste it

now copy the Secret access key and paste it

and press two times "Enter" then you should see like this

Step 7: Copy the URL from GitHub

then clone it like this

go this directory

Step 8: Install docker in the server

then five the permission and reboot it once

Step 9: Go to ECR and click on View push command

will redirect to this page and then copy this URL

past it in server then you should see login succeeded

then go redirected page and copy this URL

past it in server like this

then again go redirected page and copy this URL

paste it server like this

go redirected page and copy this final URL

paste it in server again you should see like this image pushed

then click on "close"

Step 10: Go inside this repository

here you can see the image is pushed and click on "view public listing"

you will redirect to this page and copy this URL

Step 11: Go ECS and make a task definition

open port 8080 because we have expose this port number in Dockerfile and the crate task definition

here you can see successfully created task definition in deploy click on Run task

Step 12: Select the cluster you made

in security group copy this security group

and go to the VPC security group section

go inside this security group

and check whether port number 8080 is open or not if not open it

Step 13: Come back to ECS task definition

here you can see the task is up and running go inside that task

copy this public IP address

Step 14: Paste in a web browser

with adding IP address with ":8080"

Here you can see we have successfully deployed an application in ECS


Thank you for reading this blog and if any queries or if any corrections to be done in this blog please let me know.

contact us in Linkedin ,Twitter or email-id gurucharanu716@gmail.com

More from this blog

Gurucharan's blog

31 posts

Gurucharan DevOps Engineer | Continuous Integration/Continuous Deployment | Automation Enthusiast