0% found this document useful (0 votes)
38 views

Simple AWS Project

This document provides steps to automate the deployment of a Node.js application on AWS ECS Fargate using serverless architecture. It includes building a Docker container with the application, pushing the image to ECR, creating an ECS cluster and service, and integrating CloudWatch logging. The steps are: 1) containerize the Node.js app using Docker, 2) build and push the image to ECR, 3) create an ECS cluster, 4) define the task with JSON and register it, 5) create an ECS service, and 6) set up CloudWatch logs and verify the deployment.

Uploaded by

Tanishsadan A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
38 views

Simple AWS Project

This document provides steps to automate the deployment of a Node.js application on AWS ECS Fargate using serverless architecture. It includes building a Docker container with the application, pushing the image to ECR, creating an ECS cluster and service, and integrating CloudWatch logging. The steps are: 1) containerize the Node.js app using Docker, 2) build and push the image to ECR, 3) create an ECS cluster, 4) define the task with JSON and register it, 5) create an ECS service, and 6) set up CloudWatch logs and verify the deployment.

Uploaded by

Tanishsadan A
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

AWS PROJECT

Automated deployment of Node.js application on serverless AWS ECS Fargate


with the image repository on ECR and the cloudwatch logging integrated with
proper IAM roles and configuration.

Prerequisites:
• AWS Account: Ensure you have an AWS account with the necessary permissions to
create ECS clusters, ECR repositories, and set up Cloud Watch Logs.
• Install the AWS CLI on created EC2 Instance.
NOTE: After creating instance connect and do update it.

Containerize Your Node.js App:


• Dockerize your Node.js application by creating a Dockerfile in the root of your
project.

Build and Push Docker Image to ECR:


• # Login to AWS ECR
$(aws ecr get-login --no-include-email --region your-region)
• # Create ECR repository
aws ecr create-repository --repository-name your-repo-name --region
your-region
• # Build Docker image
docker build -t your-repo-name .
• # Tag Docker image
docker tag your-repo-name:latest your-ecr-repo-url/your-repo-
name:latest
• # Push Docker image to ECR
docker push your-ecr-repo-url/your-repo-name:latest
NOTE: Please install docker in created instance and add the current user to
docker list.

Create ECS Cluster:


• # Create ECS cluster
aws ecs create-cluster --cluster-name your-cluster-name --region your-
region

Create ECS Task Definition:


• Create a file named ecs-task-definition.json with your configuration.
Replace placeholders with your values OR we can choose another option
in AWS to configure in GUI.
Example for json format.

• # Register ECS Task Definition


aws ecs register-task-definition --cli-input-json file://ecs-task-
definition.json --region your-region

Create ECS Service:


• # Create ECS Service
aws ecs create-service --cluster your-cluster-name --service-name your-
service-name --task-definition your-task-family --desired-count 1 --
region your-region

Set Up CloudWatch Logs:


• Go to the AWS Management Console.
• Navigate to CloudWatch.
• Create a new log group and set up log streams in ECS service

Update ECS Service to Enable CloudWatch Logs:


• Update your ECS service to enable CloudWatch logs by adding the
logConfiguration section to your task definition.
Verify Deployment:
• Check the ECS console to ensure your service is running. Access your
Node.js app using the public IP and port defined in your task definition.

You might also like