<?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: Challa Parthasaradi</title>
    <description>The latest articles on DEV Community by Challa Parthasaradi (@parthasaradi).</description>
    <link>https://dev.to/parthasaradi</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%2F2912335%2F3ad71841-b898-4046-9d6d-13112375dcc4.jpg</url>
      <title>DEV Community: Challa Parthasaradi</title>
      <link>https://dev.to/parthasaradi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/parthasaradi"/>
    <language>en</language>
    <item>
      <title>Implementation of EC2-based Application with Auto Scaling, CI/CD, and Enhanced Monitoring</title>
      <dc:creator>Challa Parthasaradi</dc:creator>
      <pubDate>Thu, 05 Jun 2025 07:47:47 +0000</pubDate>
      <link>https://dev.to/parthasaradi/implementation-of-ec2-based-application-with-auto-scaling-cicd-and-enhanced-monitoring-46cl</link>
      <guid>https://dev.to/parthasaradi/implementation-of-ec2-based-application-with-auto-scaling-cicd-and-enhanced-monitoring-46cl</guid>
      <description>&lt;p&gt;&lt;strong&gt;1. Executive Summary&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;This document outlines the steps to implement an EC2-based application using Auto Scaling, CI/CD, and enhanced monitoring. The goal is to create a scalable, high-availability infrastructure for a web application, leveraging AWS services such as EC2, RDS, CloudWatch, Code Deploy, and Auto Scaling.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Infrastructure Overview&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Architecture Diagram&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvnauehaz4ws84m1zmrab.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvnauehaz4ws84m1zmrab.png" alt=" " width="800" height="482"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.1 Components List&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;EC2 Instances: For hosting the web application.&lt;/li&gt;
&lt;li&gt;Amazon RDS: Provides managed database services.&lt;/li&gt;
&lt;li&gt;AWS Auto Scaling: Ensures application scalability and availability.&lt;/li&gt;
&lt;li&gt;CloudWatch and CloudTrail: Used for monitoring and logging.&lt;/li&gt;
&lt;li&gt;AWS Backup: Handles backups and disaster recovery.&lt;/li&gt;
&lt;li&gt;CI/CD Pipeline: Automates application deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2.2 Key Design Decisions&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scalability: Achieved through Auto Scaling.&lt;/li&gt;
&lt;li&gt;High Availability: Implemented with multi-AZ deployments.&lt;/li&gt;
&lt;li&gt;Security: Enhanced with IAM roles, security groups.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. Networking&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a VPC&lt;/li&gt;
&lt;li&gt;Go to the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Navigate to VPC &amp;gt; Your VPCs.&lt;/li&gt;
&lt;li&gt;Click Create VPC:&lt;/li&gt;
&lt;li&gt;Name tag: Mumbai-VPC&lt;/li&gt;
&lt;li&gt;IPv4 CIDR block: 10.10.0.0/16&lt;/li&gt;
&lt;li&gt;Leave other options as default and click Create.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. Create Subnets&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have 4 subnets: 2 public and 2 privates. Ensure subnets are in different availability zones for high availability.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Public Subnet 1&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to Subnets and click Create Subnet.&lt;/li&gt;
&lt;li&gt;Name tag: Public-Subnet-1&lt;/li&gt;
&lt;li&gt;VPC ID: Select Mumbai-VPC.&lt;/li&gt;
&lt;li&gt;Availability Zone: ap-south-1a (or any zone in Mumbai).&lt;/li&gt;
&lt;li&gt;IPv4 CIDR block: 10.10.0.0/24&lt;/li&gt;
&lt;li&gt;Click Create.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Public Subnet 2&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create Subnet again.&lt;/li&gt;
&lt;li&gt;Name tag: Public-Subnet-2&lt;/li&gt;
&lt;li&gt;VPC ID: Select Mumbai-VPC.&lt;/li&gt;
&lt;li&gt;Availability Zone: ap-south-1b.&lt;/li&gt;
&lt;li&gt;IPv4 CIDR block: 10.10.1.0/24&lt;/li&gt;
&lt;li&gt;Click Create.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Private Subnet 1&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create Subnet again.&lt;/li&gt;
&lt;li&gt;Name tag: Private-Subnet-1&lt;/li&gt;
&lt;li&gt;VPC ID: Select Mumbai-VPC.&lt;/li&gt;
&lt;li&gt;Availability Zone: ap-south-1a.&lt;/li&gt;
&lt;li&gt;IPv4 CIDR block: 10.10.2.0/24&lt;/li&gt;
&lt;li&gt;Click Create.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Private Subnet 2&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create Subnet again.&lt;/li&gt;
&lt;li&gt;Name tag: Private-Subnet-2&lt;/li&gt;
&lt;li&gt;VPC ID: Select Mumbai-VPC.&lt;/li&gt;
&lt;li&gt;Availability Zone: ap-south-1b.&lt;/li&gt;
&lt;li&gt;IPv4 CIDR block: 10.10.3.0/24&lt;/li&gt;
&lt;li&gt;Click Create.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Create an Internet Gateway&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to Internet Gateways and click Create Internet Gateway.&lt;/li&gt;
&lt;li&gt;Name tag: Mumbai-IGW.&lt;/li&gt;
&lt;li&gt;Attach it to the VPC:&lt;/li&gt;
&lt;li&gt;Select Mumbai-VPC.&lt;/li&gt;
&lt;li&gt;Click Attach Internet Gateway&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Create a NAT Gateway&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to NAT Gateways and click Create NAT Gateway.&lt;/li&gt;
&lt;li&gt;Name tag: Mumbai-NAT.&lt;/li&gt;
&lt;li&gt;Subnet: Select one of the public subnets (EX.Public-Subnet-1).&lt;/li&gt;
&lt;li&gt;Elastic IP: Allocate a new Elastic IP.&lt;/li&gt;
&lt;li&gt;Click Create NAT Gateway.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Create Route Tables&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;You need two route tables: one public and one private.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Public Route Table&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to Route Tables and click Create Route Table.&lt;/li&gt;
&lt;li&gt;Name tag: Public-RT.&lt;/li&gt;
&lt;li&gt;VPC: Select Mumbai-VPC.&lt;/li&gt;
&lt;li&gt;Click Create.&lt;/li&gt;
&lt;li&gt;Add a route:&lt;/li&gt;
&lt;li&gt;Go to Routes and click Edit routes.&lt;/li&gt;
&lt;li&gt;Destination: 0.0.0.0/0&lt;/li&gt;
&lt;li&gt;Target: Select the Internet Gateway (Mumbai-IGW).&lt;/li&gt;
&lt;li&gt;Click Save changes.&lt;/li&gt;
&lt;li&gt;Associate public subnets:&lt;/li&gt;
&lt;li&gt;Go to Subnet Associations, click Edit Subnet Associations.&lt;/li&gt;
&lt;li&gt;Select Public-Subnet-1 and Public-Subnet-2.&lt;/li&gt;
&lt;li&gt;Click Save associations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Private Route Table&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to Route Tables and click Create Route Table.&lt;/li&gt;
&lt;li&gt;Name tag: Private-RT.&lt;/li&gt;
&lt;li&gt;VPC: Select Mumbai-VPC.&lt;/li&gt;
&lt;li&gt;Click Create.&lt;/li&gt;
&lt;li&gt;Add a route:&lt;/li&gt;
&lt;li&gt;Go to Routes and click Edit routes.&lt;/li&gt;
&lt;li&gt;Destination: 0.0.0.0/0&lt;/li&gt;
&lt;li&gt;Target: Select the NAT Gateway (Mumbai-NAT).&lt;/li&gt;
&lt;li&gt;Click Save changes.&lt;/li&gt;
&lt;li&gt;Associate private subnets:&lt;/li&gt;
&lt;li&gt;Go to Subnet Associations, click Edit Subnet Associations.&lt;/li&gt;
&lt;li&gt;Select Private-Subnet-1 and Private-Subnet-2.&lt;/li&gt;
&lt;li&gt;Click Save associations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Finaly VPC Resource Map.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyf8bwgku0xfky42v0eew.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyf8bwgku0xfky42v0eew.png" alt=" " width="800" height="253"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2.IAM role We need have a Two role one is EC2 and another one is deployment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Create the Role for EC2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Go to IAM:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the IAM Management Console.&lt;/li&gt;
&lt;li&gt;Click Roles in the navigation pane.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Create a New Role:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create role.&lt;/li&gt;
&lt;li&gt;Select AWS service as the trusted entity type.&lt;/li&gt;
&lt;li&gt;Choose EC2 as the service that will use the role.&lt;/li&gt;
&lt;li&gt;Click Next.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Attach Policy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search for AmazonEC2RoleforAWSCodeDeploy,AmazonSSMFullAccess, CloudWatchActionsEC2Access in the list of policies.&lt;/li&gt;
&lt;li&gt;Select it by checking the box.&lt;/li&gt;
&lt;li&gt;Click Next.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Name the Role:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter a name for the role (EX. EC2CodeDeployRole).&lt;/li&gt;
&lt;li&gt;Review the settings and click Create role.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2.Create the Role for Code Deploy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Go to IAM:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the IAM Management Console.&lt;/li&gt;
&lt;li&gt;Click Roles in the navigation pane.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Create a New Role:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create role.&lt;/li&gt;
&lt;li&gt;Select AWS service as the trusted entity type.&lt;/li&gt;
&lt;li&gt;Choose Codedeploy as the service that will use the role.&lt;/li&gt;
&lt;li&gt;Click Next.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Attach Policy:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search for AWSCodeDeployRole and AmazonS3FullAccess in the list of policies.&lt;/li&gt;
&lt;li&gt;Select both policies by checking their boxes.&lt;/li&gt;
&lt;li&gt;Click Next.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Name the Role:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter a name for the role (EX. CodeDeployRoleWithS3).&lt;/li&gt;
&lt;li&gt;Review the settings and click Create role.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3.Launch Template Creation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the EC2 Dashboard in the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Select Launch Templates from the left-hand menu.&lt;/li&gt;
&lt;li&gt;Click Create Launch Template.&lt;/li&gt;
&lt;li&gt;Configure the Launch Template&lt;/li&gt;
&lt;li&gt;Launch Template Name: Enter a unique name (EX. AutoScalingTemplate).&lt;/li&gt;
&lt;li&gt;AMI: Select Amazon Linux 2 AMI (HVM).&lt;/li&gt;
&lt;li&gt;Instance Type: Choose t3.micro.&lt;/li&gt;
&lt;li&gt;Key Pair: Select an existing key pair or create one if required.&lt;/li&gt;
&lt;li&gt;IAM Instance Profile: Select EC2CodeDeployRole (or your specific IAM role).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2 Add the User Data Script&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#!/bin/bash
# Script to install aws cli and codedeploy agent
# Install aws cli
$ yum install pip -y
$ pip install awscli
# Install codedeploy agent
$ yum update
$ yum install ruby wget -y
$ cd /home/ec2-user
$ wget https://aws-codedeploy-ap-south-1.s3.ap-south-1.amazonaws.com/latest/install
$ chmod +x ./install
$ ./install auto
$ sudo service codedeploy-agent start
$ sudo service codedeploy-agent status
# Install httpd
$ yum install httpd -y
$ echo "&amp;lt;h1&amp;gt;Hello From EC2: v1.0&amp;lt;/h1&amp;gt;" &amp;gt; /var/www/html/index.html
$ service httpd start; chkconfig httpd on
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Explanation:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script installs the AWS CLI, CodeDeploy agent, and Apache HTTP server (httpd).&lt;/li&gt;
&lt;li&gt;It creates an HTML page to verify the deployment ("Hello From EC2: v1.0").&lt;/li&gt;
&lt;li&gt;It starts the httpd service to serve the page and configures it to start on boot.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3 Finalize Launch Template.&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Monitoring and Other Settings: Adjust settings as necessary, but the default options should be fine for most use cases.&lt;/li&gt;
&lt;li&gt;Click Create Launch Template.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feh7r6oje6grsppcudwup.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feh7r6oje6grsppcudwup.png" alt=" " width="800" height="127"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4.My target group configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create Target Group&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to EC2 Dashboard&lt;/li&gt;
&lt;li&gt;Go to the EC2 Dashboard in the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Go to Target Groups&lt;/li&gt;
&lt;li&gt;In the left-hand navigation panel, scroll down to Load Balancing and click on Target Groups.
&lt;strong&gt;- Create Target Group&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click the Create target group button.&lt;/li&gt;
&lt;li&gt;Select the following options:&lt;/li&gt;
&lt;li&gt;Target type: Choose Instances (for EC2 instances).&lt;/li&gt;
&lt;li&gt;Protocol: Choose HTTP or HTTPS&lt;/li&gt;
&lt;li&gt;Port: Set to 80 for HTTP or 443 for HTTPS.&lt;/li&gt;
&lt;li&gt;VPC: Select the VPC.&lt;/li&gt;
&lt;li&gt;Health check protocol: Choose HTTP.&lt;/li&gt;
&lt;li&gt;Health check path: Set to / or the relevant path to check health (EX. /health).&lt;/li&gt;
&lt;li&gt;Create the Target Group&lt;/li&gt;
&lt;li&gt;Click on Create to finalize the creation of the Target Group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fobjn252ic2oqqasz7p30.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fobjn252ic2oqqasz7p30.png" alt=" " width="619" height="238"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Application load balancer configuration.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create Application Load Balancer (ALB)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Navigate to EC2 Dashboard&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the EC2 Dashboard in the AWS Management Console.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Create Load Balancer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the left-hand navigation pane, under Load Balancing, click on Load balancers.&lt;/li&gt;
&lt;li&gt;Click Create Load Balancer.&lt;/li&gt;
&lt;li&gt;Choose Application Load Balancer.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Configure Load Balancer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name: Give your ALB a unique name (EX. MyALB).&lt;/li&gt;
&lt;li&gt;Scheme: Choose internet-facing to make the ALB publicly accessible.&lt;/li&gt;
&lt;li&gt;IP address type: Choose ipv4.&lt;/li&gt;
&lt;li&gt;Listeners: HTTP on port 80 is created. You can also add an HTTPS listener if needed (you would need an SSL certificate) you can add HTTPS ports 443.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Configure Availability Zones&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select Availability Zones and choose public subnets in each desired availability zone. These public subnets will route external traffic to your ALB.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5.Security Group&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Assign a security group that allows inbound traffic on the listener ports (EX.. HTTP port 80 or HTTPS port 443) from the public internet.&lt;/li&gt;
&lt;li&gt;Ensure your security group allows inbound access for HTTP/HTTPS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;6.Create Load Balancer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create Load Balancer to finalize the ALB creation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F38xl7bv4fihnutco6bmp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F38xl7bv4fihnutco6bmp.png" alt=" " width="785" height="405"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6.Create Auto Scaling Group&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to Auto Scaling Groups in the EC2 Dashboard.&lt;/li&gt;
&lt;li&gt;Click Create Auto Scaling Group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1.Configure the Auto Scaling Group&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Auto Scaling Group Name: Enter a name (EX. Partha-auto).&lt;/li&gt;
&lt;li&gt;Launch Template: Select the Launch Template (EX,  AutoScalingTemplate) created earlier.&lt;/li&gt;
&lt;li&gt;VPC and Subnets: Choose the private subnets where the instances will run.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Configure Group Size&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Minimum Instances: Set to 1.&lt;/li&gt;
&lt;li&gt;Maximum Instances: Set to 5.&lt;/li&gt;
&lt;li&gt;Desired Instances: Set to 1.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Configure Load Balancer Integration&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose Attach to a Load Balancer.&lt;/li&gt;
&lt;li&gt;Select Application Load Balancer (ALB).&lt;/li&gt;
&lt;li&gt;Listener Protocol: Select HTTP or HTTPS.&lt;/li&gt;
&lt;li&gt;Target Group: Select the Target Group created with private subnets.&lt;/li&gt;
&lt;li&gt;Health Check Path: Set to / or the relevant health check path.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Configure Scaling Policies&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scaling Policy Type: Select Target Tracking Scaling Policy.&lt;/li&gt;
&lt;li&gt;Metric: Choose Average CPU Utilization or Average Memory Utilization.&lt;/li&gt;
&lt;li&gt;Target Value: Set to 75% for CPU or a suitable value for memory.&lt;/li&gt;
&lt;li&gt;Instance Warm-up: Set to 300 seconds (5 minutes).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5.Health Checks&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;EC2 Health Checks: Enable to ensure instances are healthy before scaling.&lt;/li&gt;
&lt;li&gt;Enable ELB Health Checks (optional): If using the Load Balancer, enable this to ensure the instances are healthy before routing traffic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;6.Finalize Auto Scaling Group&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Review your settings and click Create Auto Scaling Group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F33q1myymt0muv9f95y07.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F33q1myymt0muv9f95y07.png" alt=" " width="639" height="389"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Add the Lifecycle hooks.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hc83syhoa7mjhaxw7dn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2hc83syhoa7mjhaxw7dn.png" alt=" " width="800" height="167"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ec2 instance server with Private&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdjzibwvcucurtmbb97y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffdjzibwvcucurtmbb97y.png" alt=" " width="800" height="288"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;7.Public OpenVPN Server Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1 Launch an OpenVPN Server&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a new EC2 instance in a public subnet:&lt;/li&gt;
&lt;li&gt;Use an Amazon Linux 2 AMI.&lt;/li&gt;
&lt;li&gt;Instance Type: t3.micro.&lt;/li&gt;
&lt;li&gt;Security Group: it is selected default.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Configure OpenVPN by following the OpenVPN setup guide document.&lt;/p&gt;

&lt;p&gt;3.Assign an Elastic IP to the instance for public accessibility.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F063wtwy8ol6r2n0vxr54.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F063wtwy8ol6r2n0vxr54.png" alt=" " width="800" height="136"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;OpenVPN connection&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft256q63t61r67k41uwhm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft256q63t61r67k41uwhm.png" alt=" " width="133" height="230"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;When I have launched the private server after that i can took Ip address then while i can paste it the browser it could showing like this small web site is open.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fckk6q3d3kdhk0l4z3ki6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fckk6q3d3kdhk0l4z3ki6.png" alt=" " width="607" height="199"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;8.Create an Amazon RDS MySQL Instance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Navigate to RDS Dashboard&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the AWS Management Console, navigate to RDS under Services.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Create a New Database&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on Create database.&lt;/li&gt;
&lt;li&gt;Database Creation Method: Select Standard Create.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Choose Database Engine&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose MySQL as the database engine.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Set Database Version&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the MySQL version you want to use. It’s recommended to choose the latest stable version.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5.Instance Configuration&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;DB Instance Class: Select db.t3.micro (for the smaller instance type).&lt;/li&gt;
&lt;li&gt;Storage: Configure the allocated storage (default of 20 GiB should suffice for testing purposes).&lt;/li&gt;
&lt;li&gt;Multi-AZ Deployment: Enable Multi-AZ Deployment to ensure high availability.&lt;/li&gt;
&lt;li&gt;DB Instance Identifier: Give your database instance a name (Ex. MyRDSInstance).&lt;/li&gt;
&lt;li&gt;Master Username: Set a Master Username (EX. admin).&lt;/li&gt;
&lt;li&gt;Master Password: Set a Master Password and confirm it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;6.VPC and Subnet Configuration&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;VPC: Choose the VPC where your EC2 instance resides &lt;/li&gt;
&lt;li&gt;Subnet Group: Choose a subnet group that includes private subnets to ensure that your RDS instance is deployed in a private subnet.&lt;/li&gt;
&lt;li&gt;Public Accessibility: Set No since the RDS instance should not be publicly accessible.&lt;/li&gt;
&lt;li&gt;VPC Security Group: Create a new security group or select an existing one. Make sure the security group allows traffic on port 3306 (MySQL).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;7.Additional Configuration&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Database Name: Optionally set a database name (EX. mydatabase).&lt;/li&gt;
&lt;li&gt;Backup: Enable automated backups for your RDS instance (this is enabled by default).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;8.Launch Database&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create database to launch the RDS instance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs68tatvnrxl3oer4br1v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fs68tatvnrxl3oer4br1v.png" alt=" " width="800" height="319"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10.Configure Security Group for RDS Access&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Create a Security Group for EC2 Access&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the EC2 Dashboard and navigate to Security Groups under Network &amp;amp; Security.&lt;/li&gt;
&lt;li&gt;Click Create Security Group.&lt;/li&gt;
&lt;li&gt;Name: Name it something like EC2-to-RDS-SG.&lt;/li&gt;
&lt;li&gt;Description: Add a description (EX.. "Security group allowing EC2 to access RDS").&lt;/li&gt;
&lt;li&gt;VPC: Select the VPC where both EC2 and RDS are deployed.&lt;/li&gt;
&lt;li&gt;Inbound Rules:&lt;/li&gt;
&lt;li&gt;Type: Select MySQL/Aurora.&lt;/li&gt;
&lt;li&gt;Protocol: TCP.&lt;/li&gt;
&lt;li&gt;Port Range: 3306 (MySQL default port).&lt;/li&gt;
&lt;li&gt;Source: Choose the Security Group ID.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fep760h25f3h6j9egvwxs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fep760h25f3h6j9egvwxs.png" alt=" " width="800" height="416"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Ec2 Instance Security Group&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frlqx203re5yxlz1v2vsy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frlqx203re5yxlz1v2vsy.png" alt=" " width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11.Create an AWS Backup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Go to AWS Backup in the AWS Management Console.&lt;br&gt;
2.Click Create backup plan.&lt;br&gt;
3.Choose Custom Backup Plan.&lt;br&gt;
4.Name your backup plan (EX. DailyBackupPlan).&lt;br&gt;
5.Set Backup frequency to Daily and choose a Backup window.&lt;br&gt;
6.Under Backup Vault, select the default or create a new vault.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Assign Resources (EC2 &amp;amp; RDS &amp;amp; EBS)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.In your backup plan, click Assign resources.&lt;br&gt;
2.Choose EC2 and RDS as the resource types.&lt;br&gt;
3.Select the specific EC2 instances and RDS databases you want to back up.&lt;br&gt;
4.Set an IAM role (the default role will be automatically created).&lt;br&gt;
5.Click Assign to confirm the resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure Retention Policy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.In the backup plan, under Backup rule, set Retain backups for to 1 day.&lt;br&gt;
2.This will automatically delete backups after 1 day.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Review &amp;amp; Save&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Review your backup plan.&lt;br&gt;
2.Click Create Plan to save and apply the plan.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwk0dbdk1v3hb5ojg3st3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwk0dbdk1v3hb5ojg3st3.png" alt=" " width="800" height="360"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Above screenshot EC2 Instance server and EBS volume Backup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;This is RDS database backup&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdre9xqaq1btnnxsnmoqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdre9xqaq1btnnxsnmoqo.png" alt=" " width="800" height="294"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whenever database is deleted or terminate at the time you can restore the same database for RDS AWS backup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu1yyog7ff9xuifg31ygi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu1yyog7ff9xuifg31ygi.png" alt=" " width="800" height="205"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;11.Source Control Integration (GitHub with AWS Code Pipeline)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Go to AWS CodePipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to AWS CodePipeline in the AWS Management Console.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Create a Pipeline:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click on Create Pipeline to start the setup.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Configure Pipeline Settings:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Provide a Pipeline Name.&lt;/li&gt;
&lt;li&gt;Choose or create a Service Role to allow CodePipeline to access AWS resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Source Stage Configuration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Under the Source stage, select GitHub as the source provider.&lt;/li&gt;
&lt;li&gt;Authenticate GitHub: Use OAuth or a Personal Access Token (PAT) to connect your GitHub account to AWS.&lt;/li&gt;
&lt;li&gt;Repository: Select the repository that contains your application code.&lt;/li&gt;
&lt;li&gt;Branch: Choose the branch (Ex.main) to monitor for changes.&lt;/li&gt;
&lt;li&gt;Set the Output Artifact to store the source code in an S3 bucket.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5.Save: Once everything is configured, click Next.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;12. Deployment Stage Setup (Using Code Deploy)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Add Deployment Stage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After the Source stage, click on Add Stage and name it Deploy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Select CodeDeploy as the Deployment Provider:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose AWS CodeDeploy as the deployment provider.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Create or Select CodeDeploy Application:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;If you haven't already, create a CodeDeploy Application in the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Choose EC2/On-Premises as the compute platform.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Create or Select Deployment Group:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a Deployment Group that specifies Auto Scaling Group to deploy the code to.&lt;/li&gt;
&lt;li&gt;Select the Target Deployment Group created earlier (or create a new one).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5.Define Deployment Configuration:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose the deployment configuration that suits your use case (EX. In-place)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;6.Define Deployment Actions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make sure you have an appspec.yml file in your repository that contains deployment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;7.Save: Once configured, click Next and Deploy the application.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtmuy21rmnja64ucgh5v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqtmuy21rmnja64ucgh5v.png" alt=" " width="800" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Revision S3 bucket&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whenever code deploy successful it will automatically store s3 bucket in zip file.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Code deploys stages.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrh28k29bibmiztfs60y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxrh28k29bibmiztfs60y.png" alt=" " width="697" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Next go to the Load balancer DNS url then copy the url while open the browser and pasted we can see the web application.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvdcwmwdgtfgwhmbeombn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvdcwmwdgtfgwhmbeombn.png" alt=" " width="800" height="429"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Steps to Generate SSL Certificates with load balancer DNS&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Step-1: create certificate in ACM.&lt;/li&gt;
&lt;li&gt;Step-2: Create record set in route53 and assign DNS url address in record set and create domain to the website.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j78qm1t3geh13ru1b18.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8j78qm1t3geh13ru1b18.png" alt=" " width="800" height="30"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;With Domain using for Load balancer DNS.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc0utftby60mi1qy4aiuu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fc0utftby60mi1qy4aiuu.png" alt=" " width="800" height="338"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;13.CloudTrail Setup&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Navigate to CloudTrail:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to AWS Management Console.&lt;/li&gt;
&lt;li&gt;In the Search bar, type CloudTrail and click on it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Create a Trail:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the CloudTrail Dashboard, click on Create trail.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Enable Trail in All Regions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose Apply trail to all regions to enable CloudTrail in all regions.&lt;/li&gt;
&lt;li&gt;This ensures that logs from every region are captured.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Configure S3 Bucket for Log Storage:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the Storage Location section, choose Create new S3 bucket or select an existing S3 bucket to store the logs.&lt;/li&gt;
&lt;li&gt;If creating a new bucket, provide a unique bucket name.&lt;/li&gt;
&lt;li&gt;Enable log file encryption (optional, for added security).&lt;/li&gt;
&lt;li&gt;Enable log file validation to ensure integrity.&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click Next.&lt;br&gt;
5.Confirm and Create:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Review your CloudTrail settings and click Create to activate the trail.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Cloud trail logs screenshot&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd5ew5wuztf9v472mlzgv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd5ew5wuztf9v472mlzgv.png" alt=" " width="800" height="232"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;whenever you need to check cloud trails logs user activities for example if you want check server start and stop who has server start and stop you can check&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft877hlsp04j6jlcwof4b.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft877hlsp04j6jlcwof4b.png" alt=" " width="800" height="115"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;14.CloudWatch Configuration&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1.Custom Metrics&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Navigate to CloudWatch:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to AWS Management Console.&lt;/li&gt;
&lt;li&gt;In the Search bar, type CloudWatch and click on it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Create Custom Metrics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the CloudWatch dashboard, click Metrics from the left-hand menu.&lt;/li&gt;
&lt;li&gt;Click Create Metric.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Monitor CPU Utilization:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select EC2 from the available metric namespaces.&lt;/li&gt;
&lt;li&gt;Choose Per-Instance Metrics and select CPUUtilization.&lt;/li&gt;
&lt;li&gt;Choose the EC2 instances you want to monitor and click Create.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Monitor Disk Space and Memory.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For monitoring disk space, you'll need to enable CloudWatch Agent on your EC2 instances.&lt;/li&gt;
&lt;li&gt;Go to the EC2 instance and install the CloudWatch agent by running the following below commands.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ sudo yum install amazon-cloudwatch-agent -y
$ cd /opt/aws/amazon-cloudwatch-agent/etc
$ sudo wget https://ibexcatalogapplication.s3.ap-southeast-2.amazonaws.com/instancemetrics.json
$ sudo chmod 777 instancemetrics.json
$ sudo /opt/aws/amazon-cloudwatch-agent/bin/amazon-cloudwatch-agent-ctl -a append-config -m ec2 -s -c file:/opt/aws/amazon-cloudwatch-agent/etc/instancemetrics.json
$ systemctl restart amazon-cloudwatch-agent.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2.Alarm Creation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.Create CloudWatch Alarms:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to CloudWatch Dashboard in the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Under the Alarms section in the left-hand menu, click Create Alarm.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;2.Choose Metric:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the metric you want to monitor (EX. CPUUtilization, DiskSpaceUtilization, MemoryUsage).&lt;/li&gt;
&lt;li&gt;If it's a custom metric, go to Custom Metrics and select the one you've created.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;3.Set Alarm Threshold:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select Threshold type: Static or Anomaly detection.&lt;/li&gt;
&lt;li&gt;For a static threshold:&lt;/li&gt;
&lt;li&gt;Choose Greater than a specific value.&lt;/li&gt;
&lt;li&gt;Set the threshold value (EX. CPU &amp;gt; 80%).&lt;/li&gt;
&lt;li&gt;Set the period (EX. 5 minutes).&lt;/li&gt;
&lt;li&gt;Choose Statistic (EX. Average, Maximum).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4.Set Actions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define what happens when the alarm is triggered. You can:&lt;/li&gt;
&lt;li&gt;Send a notification to an SNS topic (EX. email).&lt;/li&gt;
&lt;li&gt;Auto-scaling actions (EX. Add instance).&lt;/li&gt;
&lt;li&gt;Click Create Topic to create a new SNS topic for notifications.&lt;/li&gt;
&lt;li&gt;If you have already created SNS then you can select.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5.Configure Alarm:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name your alarm (EX. "High CPU Utilization").&lt;/li&gt;
&lt;li&gt;Set the actions (EX. Send a notification to an SNS topic).&lt;/li&gt;
&lt;li&gt;Click Create Alarm.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5uuvx70vlahecymz5o6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx5uuvx70vlahecymz5o6.png" alt=" " width="800" height="335"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Whenever we have loaded the server like CPU and disk, memory. then it will automatically get a notification for automatically create an ec2 instance through autoscaling, we can use stress commands&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;sudo yum install stress -y&lt;br&gt;
stress --cpu 4 --timeout 120, stress --hdd 2 --hdd-bytes 1G --timeout 120, stress --hdd 2 --hdd-bytes 1G --timeout 120.&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjihkn666xht2xrjic88l.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjihkn666xht2xrjic88l.png" alt=" " width="800" height="458"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Autoscaling to launch instance for load the server at to receive the notification.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9pdev329xpc6nqt6kbg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz9pdev329xpc6nqt6kbg.png" alt=" " width="800" height="348"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;GitHub repositories like in blow.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;(&lt;a href="https://github.com/pathasaradi/code_deploy_autoscaling" rel="noopener noreferrer"&gt;https://github.com/pathasaradi/code_deploy_autoscaling&lt;/a&gt;)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Conclusion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;This document outlined the step-by-step implementation of an EC2-based application with Auto Scaling, CI/CD integration, and enhanced monitoring. By following this guide, users can build a robust, scalable, and secure architecture leveraging key AWS services such as EC2, Auto Scaling, RDS, Code Deploy, CloudWatch, and Application Load Balancer.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Achievements&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scalability &amp;amp; High Availability: Configured Auto Scaling and multi-AZ deployments to handle traffic fluctuations and maintain uptime.&lt;/li&gt;
&lt;li&gt;Security: Implemented best practices with IAM roles, VPC design, security groups, and encryption mechanisms.&lt;/li&gt;
&lt;li&gt;Automation: Streamlined application deployment using CI/CD pipelines, reducing manual intervention.&lt;/li&gt;
&lt;li&gt;Monitoring: Enhanced observability with CloudWatch, providing actionable insights and logging for troubleshooting and performance optimization.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Troubleshoots&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Troubleshoots for the whenever I should deploy application it is showing like error IAM role issue and FileNotFoundError&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>codepipeline</category>
      <category>rds</category>
    </item>
    <item>
      <title>how to install aws q</title>
      <dc:creator>Challa Parthasaradi</dc:creator>
      <pubDate>Mon, 02 Jun 2025 02:38:36 +0000</pubDate>
      <link>https://dev.to/parthasaradi/how-to-install-aws-q-lpn</link>
      <guid>https://dev.to/parthasaradi/how-to-install-aws-q-lpn</guid>
      <description></description>
      <category>aws</category>
      <category>cloud</category>
      <category>tutorial</category>
      <category>howto</category>
    </item>
  </channel>
</rss>
