<?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: Git-Geetansh</title>
    <description>The latest articles on DEV Community by Git-Geetansh (@gitgeetansh).</description>
    <link>https://dev.to/gitgeetansh</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%2F1437088%2F1b85c60c-86df-410b-af52-a491a6f0534b.png</url>
      <title>DEV Community: Git-Geetansh</title>
      <link>https://dev.to/gitgeetansh</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/gitgeetansh"/>
    <language>en</language>
    <item>
      <title>Installing and Accessing Tomcat Web-App server in EC2 server</title>
      <dc:creator>Git-Geetansh</dc:creator>
      <pubDate>Wed, 18 Sep 2024 14:50:09 +0000</pubDate>
      <link>https://dev.to/gitgeetansh/installing-and-accessing-tomcat-web-app-server-in-ec2-server-1g84</link>
      <guid>https://dev.to/gitgeetansh/installing-and-accessing-tomcat-web-app-server-in-ec2-server-1g84</guid>
      <description>&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;AWS Account: Ensure you have an active AWS account.&lt;/li&gt;
&lt;li&gt;EC2 Instance: Launch an Ubuntu EC2 instance.&lt;/li&gt;
&lt;li&gt;Security Group: Configure the security group to allow inbound traffic on 
port 22 (SSH) and port 8080 (Tomcat).&lt;/li&gt;
&lt;li&gt;SSH Client: Have an SSH client like PuTTY or terminal for connecting to 
your EC2 instance.&lt;/li&gt;
&lt;li&gt;Java Development Kit (JDK): Ensure you have JDK installed on your local 
machine for compiling Java code.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Safety Best Practices
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Use IAM Roles: Assign an IAM role to your EC2 instance for secure 
access to AWS services.&lt;/li&gt;
&lt;li&gt;Security Groups: Restrict access to your EC2 instance by configuring 
security group rules.&lt;/li&gt;
&lt;li&gt;Regular Updates: Keep your system and software up to date with the 
latest security patches.&lt;/li&gt;
&lt;li&gt;Backup: Regularly backup your data and configurations.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Steps to Install Tomcat on AWS EC2 Ubuntu Instance
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Launch an EC2 Instance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log in to your AWS Management Console.&lt;/li&gt;
&lt;li&gt;Navigate to the EC2 Dashboard and click on “Launch Instance”.&lt;/li&gt;
&lt;li&gt;Choose the Ubuntu Server.&lt;/li&gt;
&lt;li&gt;Select an instance type (e.g., t2.micro for free tier).&lt;/li&gt;
&lt;li&gt;Configure instance details and add storage as needed.&lt;/li&gt;
&lt;li&gt;Configure the security group to allow SSH (port 22) and HTTP (port 
 80) traffic.&lt;/li&gt;
&lt;li&gt;Review and launch the instance. Download the key pair for SSH access.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdf4l398toysbjj4em5p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhdf4l398toysbjj4em5p.png" alt="Inbound rules for security group" width="800" height="388"&gt;&lt;/a&gt;&lt;br&gt;
Allow custom TCP rule for port 8080&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Connect to Your EC2 Instance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open your terminal or SSH client.&lt;/li&gt;
&lt;li&gt;Connect to your instance using the command:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;ssh -i /path/to/your-key-pair.pem ubuntu@your-ec2-public-ip&lt;/strong&gt;&lt;br&gt;
(You can simply connect using EC2 instance connect )&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Update the System&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Update the package lists:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;sudo apt update&lt;/strong&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdomubjlkqd0jwqjcnqw8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdomubjlkqd0jwqjcnqw8.png" alt="package updates" width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Upgrade the installed packages:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;sudo apt upgrade -y&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Install Java&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install OpenJDK 11:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;sudo apt install openjdk-11-jdk -y&lt;/strong&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Verify the installation:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;java -version&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Install Tomcat&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download the latest version of Tomcat:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;wget &lt;a href="https://downloads.apache.org/tomcat/tomcat-9/v9.0.95/bin/apache-tomcat-9.0.95.tar.gz" rel="noopener noreferrer"&gt;https://downloads.apache.org/tomcat/tomcat-9/v9.0.95/bin/apache-tomcat-9.0.95.tar.gz&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
**&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqb0qsrom46aayoo2qk8u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqb0qsrom46aayoo2qk8u.png" alt="Install tomcat" width="800" height="73"&gt;&lt;/a&gt;&lt;br&gt;
(see if version is updated)&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Extract the Tomcat archive:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;tar -xvzf apache-tomcat-9.0.95.tar.gz&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Move the extracted folder to /opt:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;sudo mv apache-tomcat-9.0.95 /opt/tomcat&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Configure Tomcat&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add execute permissions to the Tomcat scripts:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;sudo chmod +x /opt/tomcat/bin/*.sh&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Start the Tomcat server:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;/opt/tomcat/bin/startup.sh&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Step 7: Access Tomcat&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open your web browser.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;a href="http://your-ec2-public-ip:8080" rel="noopener noreferrer"&gt;http://your-ec2-public-ip:8080&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;You should see the Tomcat welcome page.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;By following these steps, you have successfully installed and configured the Tomcat web application server on an AWS EC2 Ubuntu instance, created a simple Java servlet, and deployed it to Tomcat. You can now develop and deploy more complex Java web applications using this setup.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Working with AWS IAM Service</title>
      <dc:creator>Git-Geetansh</dc:creator>
      <pubDate>Wed, 11 Sep 2024 13:35:10 +0000</pubDate>
      <link>https://dev.to/gitgeetansh/working-with-aws-iam-service-57e6</link>
      <guid>https://dev.to/gitgeetansh/working-with-aws-iam-service-57e6</guid>
      <description>&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;1.AWS Account: Ensure you have an active AWS account.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;IAM Permissions: You need sufficient permissions to create IAM users, roles, and groups.&lt;/li&gt;
&lt;li&gt;MFA Device: Set up Multi-Factor Authentication (MFA) for enhanced security.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Security Best Practices
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Use MFA: Enable MFA for all IAM users to add an extra layer of security.&lt;/li&gt;
&lt;li&gt;Least Privilege Principle: Grant only the permissions necessary for users to perform their tasks.&lt;/li&gt;
&lt;li&gt;Regular Audits: Regularly review and remove unused IAM users, roles, and permissions.&lt;/li&gt;
&lt;li&gt;Strong Password Policies: Enforce strong password policies for all IAM users.&lt;/li&gt;
&lt;li&gt;Temporary Credentials: Use temporary credentials for applications and services instead of long-term access keys12.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Steps to Create IAM User, Role, and Group
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Login to AWS Console&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Enter your credentials and complete MFA if enabled.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb0m3zpjuw6qyxprzxhwu.png" alt="AWS management console" width="800" height="407"&gt;
&lt;strong&gt;2. Create IAM Group&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;In the IAM dashboard, click on  User Groups &amp;gt; Create New Group.&lt;/li&gt;
&lt;li&gt;Enter a group name.&lt;/li&gt;
&lt;li&gt;Attach policies to the group to define permissions.&lt;/li&gt;
&lt;li&gt;Review and create the group.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example Use Case: Create a group named &lt;strong&gt;Developers&lt;/strong&gt; and attach the AmazonEC2FullAccess policy. Add all developer IAM users to this group to manage EC2 instances without needing to assign permissions individually.&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fstnh60gwxjn2m2p8q3hc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fstnh60gwxjn2m2p8q3hc.png" alt="IAM groups" width="800" height="407"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Create IAM User&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the IAM Service, Click on Users &amp;gt; Add user.&lt;/li&gt;
&lt;li&gt;Enter a username and select the type of access (Programmatic access, 
AWS Management Console access).
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu3fxgz5w8e3e7xx6smj4.png" alt="IAM USer" width="800" height="380"&gt;
&lt;/li&gt;
&lt;li&gt;Set permissions by attaching policies directly or adding the user to a 
group.(Here we are adding user to the group created in the previous step)&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqipvottg0wez4gq7yhu.png" alt="adding user toGroup" width="800" height="284"&gt;
&lt;/li&gt;
&lt;li&gt;Review and create the user. Download the .csv file with access keys if 
programmatic access is enabled.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example Use Case: An IAM user named John-Doe is created for a new developer joining your team. This user is granted programmatic access to interact with AWS services via the AWS CLI.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Create an IAM Role&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the IAM Console: &lt;/li&gt;
&lt;li&gt;Create Role:
In the navigation pane, choose Roles and then Create role.&lt;/li&gt;
&lt;li&gt;Select Trusted Entity:
Choose AWS service and select EC2.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpxseedwxr2cot1nlpjnf.png" alt="Creating a role for ec2" width="800" height="390"&gt;
&lt;/li&gt;
&lt;li&gt;Attach Policies:
Choose Next: Permissions.
Attach a policy like AmazonS3FullAccess.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F33zsz3clhu1ekdnx7bmk.png" alt="attach policy" width="800" height="387"&gt;
&lt;/li&gt;
&lt;li&gt;Role Name:
Enter a Role name (e.g., S3AccessRole) and choose Create role.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9zi119g3a5e6onrhfgmc.png" alt="JSON policy" width="800" height="391"&gt;
this is how a policy looks like in JSON&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Create an S3 bucket&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an s3 bucket that we will access through the ec2 instance.&lt;/li&gt;
&lt;li&gt;ACLs : Disabled&lt;/li&gt;
&lt;li&gt;Unblock all public access.&lt;/li&gt;
&lt;li&gt;Upload a few images to s3 bucket
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fx2598jgv9c1afow8t851.png" alt="creating an s3 bucket" width="800" height="376"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;6. accessing s3 bucket using ec2 instance&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;launch an ec2 instance that will be used to access the s3 bucket.&lt;/li&gt;
&lt;li&gt;use an ssh agent like (Putty/Mobaxterm) to connect to you instance.
     (steps for the above are depicted in my other posts)&lt;/li&gt;
&lt;li&gt;modify the IAM role of the instance by 
selecting the instance &amp;gt; security &amp;gt; modify IAM role
attach the role we created earlier.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5pgog2lhwhi8rypxt4nn.png" alt="attaching the role" width="800" height="252"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;7. Install AWS CLI (if not already installed)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install AWS CLI:&lt;/li&gt;
&lt;li&gt;&lt;p&gt;If the AWS CLI is not installed, you can install it using the following &lt;br&gt;
commands:&lt;br&gt;
&lt;strong&gt;sudo yum update -y&lt;br&gt;
sudo yum install aws-cli -y&lt;/strong&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure AWS CLI:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You don’t need to configure the AWS CLI with access keys because the &lt;br&gt;
instance will use the IAM role. However, you can verify the &lt;br&gt;
configuration:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;aws configure&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Leave the access key and secret access key fields empty and set the &lt;br&gt;
default region and output format.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Access the S3 Bucket&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;List Buckets:&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Verify that you can list your S3 buckets:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;aws s3 ls&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Access Your Specific Bucket:&lt;/li&gt;
&lt;li&gt;List the contents of your specific bucket:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;aws s3 ls s3://your-bucket-name&lt;/strong&gt;&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;You can also copy files to and from the bucket. For example, to copy a 
file from your bucket to your instance:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;aws s3 cp s3://your-bucket-name/your-file.txt /path/to/destination&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this project, we successfully demonstrated how to manage AWS Identity and Access Management (IAM) by creating an IAM user, role, and group. We also explored how to assign an IAM role to an EC2 instance to enable it to access an S3 bucket. These tasks are fundamental for ensuring secure and efficient management of AWS resources, which is crucial for any cloud-based project.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Launching and Connecting to an AWS EC2 Ubuntu Instance Using PuTTY</title>
      <dc:creator>Git-Geetansh</dc:creator>
      <pubDate>Mon, 09 Sep 2024 15:09:47 +0000</pubDate>
      <link>https://dev.to/gitgeetansh/launching-and-connecting-to-an-aws-ec2-ubuntu-instance-using-putty-1ell</link>
      <guid>https://dev.to/gitgeetansh/launching-and-connecting-to-an-aws-ec2-ubuntu-instance-using-putty-1ell</guid>
      <description>&lt;h2&gt;
  
  
  Prerequisites :-
&lt;/h2&gt;

&lt;p&gt;Before starting, ensure you have the following:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;AWS Account: Sign up for an AWS account if you don’t have one.&lt;/li&gt;
&lt;li&gt;PuTTY and PuTTYgen: Download and install PuTTY and PuTTYgen from the official website.&lt;/li&gt;
&lt;li&gt;Basic Knowledge: Familiarity with AWS Management Console and basic 
networking concepts.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Security Best Practices :-
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Use IAM Roles: Assign least-privilege IAM roles to your instances.&lt;/li&gt;
&lt;li&gt;Regular Updates: Keep your instance’s OS and applications updated.&lt;/li&gt;
&lt;li&gt;Security Groups: Implement the least permissive rules for your security 
groups.&lt;/li&gt;
&lt;li&gt;Encryption: Use encrypted EBS volumes and snapshots.&lt;/li&gt;
&lt;li&gt;Key Management: Protect your EC2 key pairs and use strong passwords.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Steps to Launch and Connect to an EC2 Instance :-
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Sign In to AWS Management Console&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Sign in with your AWS credentials.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffu9i7l0mjondt5salw3d.png" alt="AWS management console" width="800" height="407"&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Launch an EC2 Instance&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to the EC2 Dashboard by selecting Services &amp;gt; EC2.&lt;/li&gt;
&lt;li&gt;Click on Launch Instance.&lt;/li&gt;
&lt;li&gt;Choose an Amazon Machine Image (AMI):

&lt;ul&gt;
&lt;li&gt;Search for “Ubuntu” and select the desired version.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Choose an Instance Type:

&lt;ul&gt;
&lt;li&gt;Select t2.micro for free tier eligibility.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fqvi7j7njpaai9k917a3j.png" alt="AMI and instance type" width="800" height="390"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Configure Instance Details:&lt;/li&gt;
&lt;li&gt;Keep default settings unless specific configurations are needed.&lt;/li&gt;
&lt;li&gt;Add Storage:

&lt;ul&gt;
&lt;li&gt;Default is 8 GB SSD; adjust if necessary.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Add Tags:

&lt;ul&gt;
&lt;li&gt;Add a tag with Key: Name and Value: MyUbuntuInstance.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Configure Security Group:

&lt;ul&gt;
&lt;li&gt;Create a new security group with the following rule:
Type: SSH
Protocol: TCP
Port Range: 22
Source: My IP
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58nvg147xlw27ly1x2i8.png" alt="Security Group" width="800" height="375"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Review and Launch:

&lt;ul&gt;
&lt;li&gt;Click Launch.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Select a Key Pair:

&lt;ul&gt;
&lt;li&gt;Create a new key pair&lt;/li&gt;
&lt;li&gt;select RSA under key pair type&lt;/li&gt;
&lt;li&gt;select and download the .ppk file,and keep it secure.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

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

&lt;h2&gt;
  
  
  Step 3 : Connect to Your Instance Using PuTTY
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Open PuTTY.&lt;/li&gt;
&lt;li&gt;In the Host Name field, copy and paste the public IP address of the 
instance that you launched.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F36ndx8mro1wli4vr7zf3.png" alt="putty " width="596" height="531"&gt;
&lt;/li&gt;
&lt;li&gt;In the Category pane, go to Connection &amp;gt; SSH &amp;gt; Auth &amp;gt; credentials&lt;/li&gt;
&lt;li&gt;Browse and select your .ppk file.
&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnp9uolj7tem4cdqhp7tv.png" alt="putty" width="601" height="540"&gt;
&lt;/li&gt;
&lt;li&gt;Click Open to connect.&lt;/li&gt;
&lt;/ol&gt;

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

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;In this project, we learned how to:&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Launch an Ubuntu EC2 instance on AWS.&lt;/li&gt;
&lt;li&gt;Apply security best practices to ensure the instance is secure.&lt;/li&gt;
&lt;li&gt;Connect to the EC2 instance using PuTTY.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This project demonstrates the practical steps involved in setting up and securing a cloud-based server, which is a valuable skill in today’s tech landscape.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Creating a Highly-Available website in AWS</title>
      <dc:creator>Git-Geetansh</dc:creator>
      <pubDate>Thu, 02 May 2024 17:55:09 +0000</pubDate>
      <link>https://dev.to/gitgeetansh/creating-a-highly-available-website-in-aws-o04</link>
      <guid>https://dev.to/gitgeetansh/creating-a-highly-available-website-in-aws-o04</guid>
      <description>&lt;p&gt;1.Prerequisites:&lt;/p&gt;

&lt;p&gt;AWS Account: You'll need an active AWS account with appropriate permissions to create EC2 instances, Application Load Balancers, Auto Scaling Groups, and related resources.&lt;/p&gt;

&lt;p&gt;Basic Knowledge of AWS Services: Familiarity with EC2, Auto Scaling, Application Load Balancer, and related AWS services is recommended.&lt;/p&gt;

&lt;p&gt;2.Aim:&lt;/p&gt;

&lt;p&gt;The aim of this project is to create a highly available website infrastructure using AWS services including EC2 instances, Application Load Balancer, and Auto Scaling Group.&lt;/p&gt;

&lt;p&gt;Ensure that the website remains accessible and responsive even during high traffic loads or in the event of instance failures.&lt;/p&gt;

&lt;p&gt;Implement auto-scaling to automatically adjust the number of EC2 instances based on demand, optimizing costs and performance.&lt;/p&gt;

&lt;p&gt;3.Resources Used: VPC(subnets, internet gateway, route tables) EC2, Security Groups, Load Balancer, Template, Auto Scaling Group.&lt;/p&gt;

&lt;p&gt;4.Steps:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Set up VPC (Virtual Private Cloud): Create a VPC (Select an appropriate region of your choice ) to isolate your resources and provide network security. &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;points to remember:&lt;br&gt;
When creating a VPC you will have two options - VPC only and VPC and more. &lt;br&gt;
In a VPC-only scenario:&lt;br&gt;
You create the VPC itself, but it doesn’t automatically include any subnets, internet gateways, or route tables.&lt;/p&gt;

&lt;p&gt;You have to manually add subnets to the VPC, allocate IP addresses, and configure routing.&lt;/p&gt;

&lt;p&gt;Here, we will be manually adding all the resources so as to get the underlying concepts and working of our architecture.&lt;/p&gt;

&lt;p&gt;No internet gateway is automatically created, so instances within the VPC cannot directly access the internet.&lt;/p&gt;

&lt;p&gt;VPC with More Options:&lt;br&gt;
When you choose to create a VPC with more options, AWS automatically sets up additional components along with the VPC&lt;br&gt;
You need to set up custom route tables to define how traffic flows within the VPC.&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;Create Subnets: Create subnets, one in each availability zone of the region selected. &lt;br&gt;
points to remember - &lt;br&gt;
CIDR block of the subnets should not overlap with each other, or it will show an error. you can use online available subnet calculator tool or simple use the arrows highlighted.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq2fwf1t0h7g8laocx628.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq2fwf1t0h7g8laocx628.png" alt="Creating subnets" width="505" height="768"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create an Internet gateway and attach the gateway to the above vpc created.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxu7sjejp3ermb80d95qs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxu7sjejp3ermb80d95qs.png" alt="Internet gateway in aws" width="800" height="562"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create Route tables: &lt;br&gt;
create a route table and associate it with all 3 subnets that you created earlier.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fotn6egwnwnfuw1nhjt37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fotn6egwnwnfuw1nhjt37.png" alt="creating route table" width="800" height="637"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;also edit routes&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;Creating Security Groups:&lt;br&gt;
Security Group for Application Load Balancer.&lt;br&gt;
inbound rules:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpp26458x7k1rib29d1ri.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpp26458x7k1rib29d1ri.png" alt="Inbound Rules for Load Balancer" width="800" height="488"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Security group for EC2 fleet.&lt;br&gt;
inbound rules &lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F809mru6ajwr2zy1re4l1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F809mru6ajwr2zy1re4l1.png" alt="Inbound rules for ec2 instances" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;only inbound rules for security group for ec2 fleet is that it will receive traffic from security group of your load balancer. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Launch EC2 Instances:&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Launch an EC2 instance, select the same region, VPC, any 1 subnet, Security group for EC2, and enable auto-allocation of public IP.&lt;/p&gt;

&lt;p&gt;in the use data script, add the following script.&lt;/p&gt;

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

&lt;blockquote&gt;
&lt;p&gt;Create a template from the EC2 created, this template will be used to create your Auto Scaling group.&lt;/p&gt;

&lt;p&gt;Create Application Load Balancer (ALB): Set up an ALB to distribute incoming traffic across multiple EC2 instances.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futx91kjkcyg28k3rxc0q.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Futx91kjkcyg28k3rxc0q.png" alt="Application Load Balancer" width="800" height="627"&gt;&lt;/a&gt;&lt;br&gt;
points to remember:&lt;br&gt;
select security group created for ALB&lt;br&gt;
select all the subnets&lt;br&gt;
for target groups create a target group, add the created instance in the target group.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz0u18zlvl8vo0bsygqdg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz0u18zlvl8vo0bsygqdg.png" alt="Target Group" width="697" height="828"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6le40iv6kznvm2xhvcrr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6le40iv6kznvm2xhvcrr.png" alt="Target Group" width="588" height="692"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;check your Elastic load balancer by copying its DNS name and pasting it to a browser, preferably in a new Cognito window.&lt;br&gt;
your should see the Hello world page, along with private IP of your instance&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Create Auto Scaling Group (ASG):&lt;br&gt;
 Configure an ASG to automatically adjust the number of EC2 instances based on demand&lt;br&gt;
points to remember:&lt;br&gt;
select the template we created earlier.&lt;br&gt;
select the VPC and all the subnets&lt;br&gt;
&lt;a href="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq893lrwaid3j3bnxrs9i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/cdn-cgi/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fq893lrwaid3j3bnxrs9i.png" alt="auto scaling group" width="775" height="853"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;select the elastic load balancer option, and select the target group created above.&lt;/p&gt;

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

&lt;p&gt;check the activity tab of your auto scaling group, it shows alerts regarding....well it's activities. instances will spin up in accordance with your Desired capacities.&lt;/p&gt;

&lt;p&gt;refresh the tab where you pasted the DNS name. you should see the change in private ip addresses, that means the load balancer is working and distributing load to all EC2 instances.&lt;/p&gt;

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

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

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

&lt;p&gt;Test High Availability: Conduct tests to ensure that your website remains accessible and responsive even during instance failures or high traffic loads.&lt;/p&gt;

&lt;p&gt;try terminating instances, auto scaling group will automatically spin up more to take its place.&lt;/p&gt;

&lt;p&gt;5.Conclusion:&lt;/p&gt;

&lt;p&gt;By implementing the above steps, you have successfully created a highly available website infrastructure on AWS using EC2 instances, Application Load Balancer, and Auto Scaling Group.&lt;br&gt;
Your website is now capable of handling varying levels of traffic and instances failures without affecting user experience.&lt;br&gt;
Regular monitoring and optimization of your infrastructure will help ensure continued high availability and performance.&lt;/p&gt;

&lt;p&gt;6.Clean-Up:&lt;/p&gt;

&lt;p&gt;Once you have completed testing and are finished with your project, remember to clean up all resources to avoid unnecessary costs.&lt;br&gt;
Terminate EC2 instances, delete Auto Scaling Group, remove Application Load Balancer, and delete any other associated resources.&lt;br&gt;
Optionally, you may also want to delete the VPC and related networking resources if they are no longer needed.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
