<?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: Rafil</title>
    <description>The latest articles on DEV Community by Rafil (@mohamed_rafil).</description>
    <link>https://dev.to/mohamed_rafil</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%2F2746690%2Fbb842ef2-ac4b-4224-be81-e324b63b4027.jpg</url>
      <title>DEV Community: Rafil</title>
      <link>https://dev.to/mohamed_rafil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mohamed_rafil"/>
    <language>en</language>
    <item>
      <title>Three-Tier Architecture Application Deployment</title>
      <dc:creator>Rafil</dc:creator>
      <pubDate>Mon, 31 Mar 2025 18:20:07 +0000</pubDate>
      <link>https://dev.to/mohamed_rafil/three-tier-architecture-application-deployment-f8c</link>
      <guid>https://dev.to/mohamed_rafil/three-tier-architecture-application-deployment-f8c</guid>
      <description>&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%2Fpfpdv9em7p09bc3iuftv.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%2Fpfpdv9em7p09bc3iuftv.png" alt=" " width="800" height="361"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Download Code From Git Repo
&lt;/h2&gt;

&lt;p&gt;Download the code Repo file from Git-hub and unzip it&lt;br&gt;
Sample :-(&lt;a href="https://github.com/aws-samples/aws-three-tier-web-architecture-workshop.git" rel="noopener noreferrer"&gt;https://github.com/aws-samples/aws-three-tier-web-architecture-workshop.git&lt;/a&gt;)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/Naveen3251/AWS_3Tier.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  2. S3 Bucket Creation
&lt;/h2&gt;

&lt;p&gt;Create a S3 bucket&lt;br&gt;
Block public access for now&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%2Fxr97r56dyzheuwvyl2vu.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%2Fxr97r56dyzheuwvyl2vu.png" alt=" " width="800" height="533"&gt;&lt;/a&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%2Fdwtki8u4svwbjm23k6of.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%2Fdwtki8u4svwbjm23k6of.png" alt=" " width="800" height="533"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  3. Create IAM Role
&lt;/h2&gt;

&lt;p&gt;IAM &amp;gt; Roles &amp;gt; create role&lt;br&gt;
Use case -&amp;gt; EC2&lt;br&gt;
Apply these 2 permissions:&lt;br&gt;
&lt;strong&gt;1.AmazonSSMManagedInstanceCore&lt;br&gt;
2.AmazonS3ReadOnlyAccess&lt;/strong&gt;&lt;br&gt;
Give your role a name, and then click &lt;strong&gt;Create Role&lt;/strong&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%2Fl0cjsk5f6gkhtpyzvgjr.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%2Fl0cjsk5f6gkhtpyzvgjr.png" alt=" " width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  4. VPC Creation
&lt;/h2&gt;

&lt;p&gt;VPC &amp;gt; Your VPCs &amp;gt; create VPC&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%2Frr1voide36y4fuv0iw11.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%2Frr1voide36y4fuv0iw11.png" alt=" " width="800" height="605"&gt;&lt;/a&gt; VPC created successfully...&lt;/p&gt;
&lt;h2&gt;
  
  
  5. Subnet Creation
&lt;/h2&gt;

&lt;p&gt;Create 6 subnets &lt;br&gt;
&lt;strong&gt;&lt;em&gt;Note:&lt;/em&gt; Remember, your CIDR range for the subnets will be subsets of your VPC CIDR range.&lt;/strong&gt;&lt;br&gt;
&lt;em&gt;&lt;strong&gt;AZ-1&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
Availability zone-1 =&amp;gt; (1-public, 2-private)&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%2Fj2c958z6mzul3m5r07wn.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%2Fj2c958z6mzul3m5r07wn.png" alt=" " width="800" height="519"&gt;&lt;/a&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%2F70irkkhhux5snxph6wu5.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%2F70irkkhhux5snxph6wu5.png" alt=" " width="800" height="326"&gt;&lt;/a&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%2Fw50p0hx8kkzfdhu5xyqx.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%2Fw50p0hx8kkzfdhu5xyqx.png" alt=" " width="800" height="323"&gt;&lt;/a&gt;&lt;em&gt;&lt;strong&gt;AZ-2&lt;/strong&gt;&lt;/em&gt;&lt;br&gt;
Create subnets as created in AZ-1 with different CIDR range.&lt;br&gt;
Availability zone-2 =&amp;gt; (1-public, 2-private)&lt;/p&gt;
&lt;h2&gt;
  
  
  6. Internet Gateway Creation
&lt;/h2&gt;

&lt;p&gt;To give internet access to the public subnets in our VPC, we will have to create and attach an Internet Gateway.&lt;br&gt;
VPC &amp;gt; Internet gateways &amp;gt; Create internet gateway&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%2Fixjl250r8ig1ei3ocgzh.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%2Fixjl250r8ig1ei3ocgzh.png" alt=" " width="800" height="289"&gt;&lt;/a&gt; After internet gateway creation, attach it to your VPC.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select IGW &amp;gt; Actions &amp;gt; Attach to VPC &lt;/li&gt;
&lt;li&gt;Select the correct VPC and click on &lt;strong&gt;Attach internet gateway&lt;/strong&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%2Fvff8snrchvr42boxnch8.png" alt=" " width="800" height="165"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  7. NAT gateway Creation
&lt;/h2&gt;

&lt;p&gt;For our instances in the app layer private subnet to access the internet, they will have to go through a NAT Gateway.&lt;br&gt;
Create two NAT gateway for 2 public subnets on the 2 availability zones&lt;br&gt;
VPC &amp;gt; NAT gateways &amp;gt; Create NAT gateway&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the correct public subnet in AZ-1 &lt;/li&gt;
&lt;li&gt;Allocate elastic IP&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create NAT gateway&lt;/strong&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%2Fl25q8xaiarqv1vo0rmji.png" alt=" " width="800" height="383"&gt;
&lt;/li&gt;
&lt;li&gt;Follow the same steps for the creation of the second NAT gateway
&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%2Fyjjnwxz4azzzss8fxfhq.png" alt=" " width="800" height="395"&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%2Fo80mwzqxf94gp0k4swnw.png" alt=" " width="800" height="93"&gt;Two NAT gateways in two AZs has been created successfully...&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  8. Routing Configuration
&lt;/h2&gt;

&lt;p&gt;create one route table for the web layer public subnets.&lt;br&gt;
VPC &amp;gt; Route table &amp;gt; Create route table&lt;br&gt;
Click &lt;strong&gt;Create route table&lt;/strong&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%2Fquk6uolgzfejrqeltg0b.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%2Fquk6uolgzfejrqeltg0b.png" alt=" " width="800" height="271"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scroll down and click on &lt;strong&gt;Routes&lt;/strong&gt; and click on &lt;strong&gt;Edit routes&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Add route&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select the destination &lt;strong&gt;0.0.0.0/0&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Target&lt;/strong&gt; section, select &lt;strong&gt;Internet Gateway&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Then select the created IGW&lt;/li&gt;
&lt;li&gt;Then click &lt;strong&gt;Save changes&lt;/strong&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%2Fldrlnjemfvzu2gu0y3ms.png" alt=" " width="800" height="184"&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Subnet Associations&lt;/strong&gt; and click &lt;strong&gt;Edit subnet associations&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the web layer public subnets which has been created&lt;/li&gt;
&lt;li&gt;Then click &lt;strong&gt;Save associations&lt;/strong&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%2F978xtwnx1fut29u3bf2h.png" alt=" " width="800" height="285"&gt;
&lt;strong&gt;&lt;em&gt;Create 2 more route tables, one for each app layer private subnet in each availability zone&lt;/em&gt;&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;1.Private route table 1&lt;/em&gt;&lt;/strong&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%2Fhs1mhslu1dyfpumji1pc.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%2Fhs1mhslu1dyfpumji1pc.png" alt=" " width="800" height="291"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Scroll down and click on &lt;strong&gt;Routes&lt;/strong&gt; and click on &lt;strong&gt;Edit routes&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click on &lt;strong&gt;Add route&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select the destination &lt;strong&gt;0.0.0.0/0&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;In &lt;strong&gt;Target&lt;/strong&gt; section, select &lt;strong&gt;Internet Gateway&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Then select the created NAT gateway in AZ-1&lt;/li&gt;
&lt;li&gt;Then click &lt;strong&gt;Save changes&lt;/strong&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%2Fzfuu2mm5oyvx1hjidrne.png" alt=" " width="800" height="178"&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Subnet Associations&lt;/strong&gt; and click &lt;strong&gt;Edit subnet associations&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Select the app layer private subnet on AZ-1 &lt;/li&gt;
&lt;li&gt;Then click &lt;strong&gt;Save associations&lt;/strong&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%2Ftumusq8c9xstqsgx6333.png" alt=" " width="800" height="285"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;&lt;em&gt;2. Private route table 2&lt;/em&gt;&lt;/strong&gt;&lt;br&gt;
For creating the Private route table 2, follow the steps performed in the creation of above private subnet route table  with their availability zone accordingly.&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%2F05dlk55szpp68vmhxc1f.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%2F05dlk55szpp68vmhxc1f.png" alt=" " width="800" height="294"&gt;&lt;/a&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%2Fdhjrt0x3sy4wkf87zdl4.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%2Fdhjrt0x3sy4wkf87zdl4.png" alt=" " width="800" height="175"&gt;&lt;/a&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%2Fhnb1ggcz7glfd70n1zh4.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%2Fhnb1ggcz7glfd70n1zh4.png" alt=" " width="800" height="275"&gt;&lt;/a&gt;These route tables will route app layer traffic destined for outside the VPC to the NAT gateway in the respective availability zone, so add the appropriate routes for that.&lt;/p&gt;
&lt;h2&gt;
  
  
  9. Security groups
&lt;/h2&gt;

&lt;p&gt;1 for database&lt;br&gt;
2 for load balancer&lt;br&gt;
1 for public EC2&lt;br&gt;
1 for private EC2&lt;br&gt;
While creating sg, don't change anything in outbound rules.&lt;br&gt;
&lt;strong&gt;1. Security group for internet facing load balancer(internet facing)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The first security group you’ll create is for the public, internet facing load balancer. &lt;/li&gt;
&lt;li&gt;After typing a name and description, add an inbound rule to allow HTTP type traffic for your IP.
&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%2Fnsizx4ks2jbuiyyb5qix.png" alt=" " width="800" height="495"&gt;
&lt;strong&gt;2.Security group for allowing ELB access to EC2 instances(web tier)&lt;/strong&gt;
In creation of this security group, in inbound rules allow HTTP type traffic for your IP
Add rule - Allow 'HTTP' type and select the 'internet facing security group'
&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%2F5furgw6qwt0gufyt7t6i.png" alt=" " width="800" height="445"&gt;
&lt;strong&gt;3.Security group for Internal load balancer(Internal facing)&lt;/strong&gt;
The third security group will be for our internal load balancer. Create this new security group and add an inbound rule that allows HTTP type traffic from your public instance security group
&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%2Fexr3uz03bmv55ymwkadd.png" alt=" " width="800" height="425"&gt;
&lt;strong&gt;4.Security group for app tier&lt;/strong&gt;
The fourth security group we’ll configure is for our private instances. 
Add an inbound rule that will allow TCP type traffic on port 4000 from the internal load balancer security group you created in the previous step
&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%2Fbr33qammggyi84nkgg82.png" alt=" " width="800" height="418"&gt;
&lt;strong&gt;5.Database security group&lt;/strong&gt;
Add an inbound rule that will allow traffic from the private instance security group to the MYSQL/Aurora port (3306)
&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%2Fxr7305nr1ch95marehnj.png" alt=" " width="800" height="496"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  10. DB subnet group creation
&lt;/h2&gt;

&lt;p&gt;Aurora and RDS &amp;gt; Subnet groups &amp;gt; Create DB subnet group&lt;br&gt;
choose the VPC we created.&lt;br&gt;
While adding subnets, make sure to add the subnets we created in each availability zone for our database layer. Navigate back to the VPC dashboard and check to make sure to select the correct subnet IDs.&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%2Fcf2p48l137ewae96yf4c.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%2Fcf2p48l137ewae96yf4c.png" alt=" " width="800" height="495"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  11. Database Creation
&lt;/h2&gt;

&lt;p&gt;Start with a Standard create for this MySQL-Compatible Amazon Aurora database. Leave the rest of the defaults in the Engine options as default.&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%2Ff7nxch8w3bilt6073ngm.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%2Ff7nxch8w3bilt6073ngm.png" alt=" " width="800" height="474"&gt;&lt;/a&gt;&lt;br&gt;
Under the Templates section choose Dev/Test since this isn't being used for production at the moment. Under Settings set a username and password of your choice and note them down since we'll be using password authentication to access our database.&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%2Fb30v22s12lqxydk3dp7h.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%2Fb30v22s12lqxydk3dp7h.png" alt=" " width="800" height="511"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;under Availability and durability change the option to create an Aurora Replica or reader node in a different availability zone.&lt;/li&gt;
&lt;li&gt;Under Connectivity, select the VPC, choose the subnet group we created earlier, and select no for public access.
&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%2Fnfcyyqb6ch6l9mihhena.png" alt=" " width="800" height="502"&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%2Fcv47f2e63xl5g6bcd8ck.png" alt=" " width="800" height="513"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  12. App Instance Creation
&lt;/h2&gt;

&lt;p&gt;EC2 &amp;gt; Instances &amp;gt; Launch an instance&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%2F3gvmvcavstlctnil68m3.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%2F3gvmvcavstlctnil68m3.png" alt=" " width="800" height="495"&gt;&lt;/a&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%2Fl9qvnay3zhixijzhb96s.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%2Fl9qvnay3zhixijzhb96s.png" alt=" " width="800" height="496"&gt;&lt;/a&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%2F5k553yac2z3v1fyea3gp.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%2F5k553yac2z3v1fyea3gp.png" alt=" " width="800" height="505"&gt;&lt;/a&gt;Finally click "Launch Instance"&lt;/p&gt;
&lt;h2&gt;
  
  
  Connect Instance
&lt;/h2&gt;

&lt;p&gt;click the connect button on the top right corner of the dashboard. Select the Session Manager tab and click &lt;strong&gt;connect&lt;/strong&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Switch to ec2-user by executing the following command in the browser terminal:
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; sudo -su ec2-user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;2.If your network is configured correctly up till this point, you should be able to ping the google DNS servers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ping 8.8.8.8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configure Database
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Start by downloading the MySQL CLI:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; sudo yum install mysql -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Initiate your DB connection with your Aurora RDS writer endpoint. Execute the following command in the browser after changing to your RDS end point and to your user name:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; mysql -h CHANGE-TO-YOUR-RDS-ENDPOINT -u CHANGE-TO-USER-NAME -p
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a database called webappdb in MYSQL CLI:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; CREATE DATABASE webappdb;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.Create a data table by first navigating to the database we created:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;USE webappdb;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.create the following transactions table by executing this create table command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; CREATE TABLE IF NOT EXISTS transactions(id INT NOT NULL
 AUTO_INCREMENT, amount DECIMAL(10,2), description
 VARCHAR(100), PRIMARY KEY(id));
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6.Insert data into table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; INSERT INTO transactions (amount, description) VALUES ('400','groceries');
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7.View the data inserted in table:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; SELECT * FROM transactions;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8.When finished, just type &lt;strong&gt;exit&lt;/strong&gt; and hit enter to exit the MySQL client.&lt;/p&gt;

&lt;h2&gt;
  
  
  Configure App Instance
&lt;/h2&gt;

&lt;p&gt;1.The first thing we will do is update our database credentials for the app tier. To do this, open the application-code/app-tier/DbConfig.js file&lt;br&gt;
2.Fill this in with the credentials you configured for your database, the writer endpoint of your database as the hostname, and webappdb for the database. Save the file.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Upload the app-tier folder to the S3 bucket
&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%2Fhoz3zageky9hkaqat92u.png" alt=" " width="800" height="354"&gt;4.Go to your SSM session. Start by installing NVM (node version manager)
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
 source ~/.bashrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ol&gt;
&lt;li&gt;install Node.js and make sure it's being used.
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; nvm install 16
 nvm use 16
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;6.Install PM2. PM2 is a daemon process manager that will keep our node.js app running when we exit the instance.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; npm install -g pm2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7.Now we need to download our code from our s3 buckets onto our instance. Perform the following command with proper changes in bucket name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; cd ~/
 aws s3 cp s3://BUCKET_NAME/app-tier/ app-tier --recursive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8.Navigate to the app directory, install dependencies, and start the app with pm2.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; cd ~/app-tier
 npm install
 pm2 start index.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the following to make sure the app is running correctly&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; pm2 list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To look at the latest errors, use this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; pm2 logs
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;9.Right now, pm2 is just making sure our app stays running when we leave the SSM session. This is also important for the AMI we will create:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; pm2 startup
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After you run it, save the current list of node processes with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; pm2 save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Test App Tier
&lt;/h2&gt;

&lt;p&gt;1.To hit out health check endpoint, run this command into your SSM terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; curl http://localhost:4000/health
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Next, test your database connection. You can do that by hitting the following endpoint locally:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; curl http://localhost:4000/transaction
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Your app layer is fully configured and ready to go.&lt;/p&gt;

&lt;h2&gt;
  
  
  App Tier AMI
&lt;/h2&gt;

&lt;p&gt;Select the app tier instance and click &lt;strong&gt;Actions&lt;/strong&gt;, select &lt;strong&gt;Image and templates&lt;/strong&gt;. Click &lt;strong&gt;Create Image&lt;/strong&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%2F22xw2jipcgmhajf6pqt7.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%2F22xw2jipcgmhajf6pqt7.png" alt=" " width="800" height="114"&gt;&lt;/a&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%2Fecdn6zfz7hvp8hh6jmtv.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%2Fecdn6zfz7hvp8hh6jmtv.png" alt=" " width="800" height="470"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Target Group
&lt;/h2&gt;

&lt;p&gt;EC2 &amp;gt; Load Balancing &amp;gt; Target Groups &amp;gt; Create Target Group&lt;br&gt;
Navigate to &lt;strong&gt;Target Groups&lt;/strong&gt;. Click on &lt;strong&gt;Create Target Group&lt;/strong&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%2F893m459p640os1jgddsd.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%2F893m459p640os1jgddsd.png" alt=" " width="800" height="511"&gt;&lt;/a&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%2F0wwddnpwwjtyq4u6pldp.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%2F0wwddnpwwjtyq4u6pldp.png" alt=" " width="800" height="415"&gt;&lt;/a&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%2F1gc52a9fwg5p6tjwlc7e.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%2F1gc52a9fwg5p6tjwlc7e.png" alt=" " width="800" height="313"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Internal Load Balancer
&lt;/h2&gt;

&lt;p&gt;EC2 &amp;gt; Load Balancing &amp;gt; Load Balancers &amp;gt; Create load balancer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;click &lt;strong&gt;Create Load Balancer&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;We'll be using an Application Load Balancer for our HTTP traffic so click the create button for that option.&lt;/li&gt;
&lt;li&gt;After giving the load balancer a name, be sure to select &lt;strong&gt;internal&lt;/strong&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%2Fttanix4540nlfgt29zk2.png" alt=" " width="800" height="342"&gt;
-Select the correct network configuration for VPC and private subnets.&lt;/li&gt;
&lt;li&gt;Select the security group we created for this internal ALB. Now, this ALB will be listening for HTTP traffic on port 80.
&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%2F8uqg2sdav029lw3d5ya9.png" alt=" " width="800" height="532"&gt;
##Launch Template
EC2 &amp;gt; Instances &amp;gt; Launch Template &amp;gt; Create Launch Template&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Launch Template&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Application and OS Images&lt;/strong&gt; include the app tier AMI you created.
&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%2Fy4j7vzzpgqevrpmfeiqa.png" alt=" " width="800" height="452"&gt;
&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Instance&lt;/strong&gt; Type select t2.micro. For &lt;strong&gt;Key pair&lt;/strong&gt; and &lt;strong&gt;Network Settings&lt;/strong&gt; don't include it in the template.
&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%2Fkyrw10w35uwvi4wmqiyq.png" alt=" " width="800" height="446"&gt;
&lt;/li&gt;
&lt;li&gt;under Advanced details use the same IAM instance profile we have been using for our EC2 instances.
&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%2F5rqj7zdqufvz9tklf8yg.png" alt=" " width="800" height="441"&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  Auto Scaling
&lt;/h2&gt;

&lt;p&gt;EC2 &amp;gt; Auto Scaling &amp;gt; Auto Scaling Groups &amp;gt; Create Auto Scaling Group&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;select the Launch Template we just created and click &lt;strong&gt;next&lt;/strong&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%2Fj398edkzx48rsvh692al.png" alt=" " width="800" height="469"&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%2F8nsplywnr4lwi0fbvjrn.png" alt=" " width="800" height="493"&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%2Fkjuro6iyi9mz5yol4y9k.png" alt=" " width="800" height="529"&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%2Ftf0sqo3shr5y3fuy83ih.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%2Ftf0sqo3shr5y3fuy83ih.png" alt=" " width="800" height="507"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After the above step Click &lt;strong&gt;next&lt;/strong&gt;, next finally click &lt;strong&gt;Create Auto Scaling group&lt;/strong&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Updation of Config File
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open up the application-code/nginx.conf file.&lt;/li&gt;
&lt;li&gt;Scroll down to line 58 and replace [INTERNAL-LOADBALANCER-DNS] with your internal load balancer’s DNS entry.
&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%2Fduogza0ofcmb009rj4q3.png" alt=" " width="800" height="407"&gt;
&lt;/li&gt;
&lt;li&gt;Then, upload this file and the application-code/web-tier folder to the &lt;strong&gt;s3 bucket&lt;/strong&gt; you created for this lab.
##Web Instance Deployment
EC2 &amp;gt; Instances &amp;gt; Launch an Instance&lt;/li&gt;
&lt;li&gt;Select the first Amazon Linux 2 AMI.&lt;/li&gt;
&lt;li&gt;We'll be using the free tier eligible &lt;strong&gt;t2.micro&lt;/strong&gt; instance type.
&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%2Fw84fusvqkaqridta9v62.png" alt=" " width="800" height="509"&gt;
&lt;/li&gt;
&lt;li&gt;When configuring the instance details, make sure to select to correct Network, subnet, and IAM role we created.&lt;/li&gt;
&lt;li&gt;We are using already created VPC and Public Subnet AZ-1 and Enable auto assign Public IP&lt;/li&gt;
&lt;li&gt;We are using already created web tier security group
&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%2Fioccwr55ve4mmjd9drx3.png" alt=" " width="800" height="519"&gt;
&lt;/li&gt;
&lt;li&gt;We are using already created IAM role&lt;/li&gt;
&lt;li&gt;Finally click "Launch Instance"
&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%2F3xgnh4dwveorsuis0r5b.png" alt=" " width="800" height="480"&gt;
##Connect to Instance
click the connect button on the top right corner of the EC2 dashboard. Select the Session Manager tab and click &lt;strong&gt;connect&lt;/strong&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%2F2jf98h3iu5xs3hb9sjyx.png" alt=" " width="800" height="171"&gt;
&lt;/li&gt;
&lt;li&gt;Switch to ec2-user by executing the following command in the browser terminal:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; sudo -su ec2-user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;2.If your network is configured correctly up till this point, you should be able to ping the google DNS servers:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; ping 8.8.8.8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Configure Web Instance
&lt;/h2&gt;

&lt;p&gt;1.We now need to install all of the necessary components needed to run our front-end application. Again, start by installing NVM and node&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
 source ~/.bashrc
 nvm install 16
 nvm use 16

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2.Now we need to download our web tier code from our s3 bucket:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; cd ~/
 aws s3 cp s3://rafil3tierwebappbucket1/web-tier/ web-tier --recursive
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;3.Navigate to the web-layer folder and create the build folder for the react app so we can serve our code:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; cd ~/web-tier
 npm install 
 npm run build
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;4.NGINX can be used for different use cases like load balancing, content caching. But we will be using it as a web server that we will configure to serve our application on port 80, as well as help direct our API calls to the internal load balancer.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; sudo amazon-linux-extras install nginx1 -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;5.We will now have to configure NGINX. Navigate to the Nginx configuration file with the following commands and list the files in the directory&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; cd /etc/nginx
 ls
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;6.You should see an nginx.conf file. We’re going to delete this file and use the one we uploaded to s3.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; sudo rm nginx.conf
 sudo aws s3 cp s3://BUCKET_NAME/nginx.conf .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7.Restart Nginx with the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; sudo service nginx restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;8.To make sure Nginx has permission to access our files execute this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; chmod -R 755 /home/ec2-user
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;9.Then to make sure the service starts on boot, run this command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; sudo chkconfig nginx on
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Web Tier AMI
&lt;/h2&gt;

&lt;p&gt;Select the web tier instance and click &lt;strong&gt;Actions&lt;/strong&gt;, select &lt;strong&gt;Image and templates&lt;/strong&gt;. Click &lt;strong&gt;Create Image&lt;/strong&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%2Fv95limzakwqekhisgkbe.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%2Fv95limzakwqekhisgkbe.png" alt=" " width="800" height="461"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Target Group
&lt;/h2&gt;

&lt;p&gt;EC2 &amp;gt; Load Balancing &amp;gt; Target Groups &amp;gt; Create Target Group&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%2Fycbxi89kmpq1k72qb296.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%2Fycbxi89kmpq1k72qb296.png" alt=" " width="800" height="489"&gt;&lt;/a&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%2F46rnqi639b7rq978c39x.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%2F46rnqi639b7rq978c39x.png" alt=" " width="800" height="544"&gt;&lt;/a&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%2F7l9kydh7nnmbafvjaw6u.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%2F7l9kydh7nnmbafvjaw6u.png" alt=" " width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Internet Facing Load Balancer
&lt;/h2&gt;

&lt;p&gt;EC2 &amp;gt; Load Balancing &amp;gt; Load Balancers &amp;gt; Create load balancer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;click &lt;strong&gt;Create Load Balancer&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;We'll be using an Application Load Balancer for our HTTP traffic so click the create button for that option.&lt;/li&gt;
&lt;li&gt;After giving the load balancer a name, be sure to select &lt;strong&gt;Internet facing&lt;/strong&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%2Fhfbcg8q1mbotuskgtjcv.png" alt=" " width="800" height="372"&gt;
-Select the correct network configuration for VPC and private subnets.&lt;/li&gt;
&lt;li&gt;Select the security group we created for this internet facing ALB. Now, this ALB will be listening for HTTP traffic on port 80.
&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%2Fr78566a0kdi5pfk33sf6.png" alt=" " width="800" height="525"&gt;
##Launch Template&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create Launch Template&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Application and OS Images&lt;/strong&gt; include the web tier AMI you created.
&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%2Fg4ssk1x9cjb3scah6gw9.png" alt=" " width="800" height="424"&gt;
&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Instance&lt;/strong&gt; Type select t2.micro. For &lt;strong&gt;Key pair&lt;/strong&gt; and &lt;strong&gt;Network Settings&lt;/strong&gt; don't include it in the template.
&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%2Fi8ync07jw0cnka19jrht.png" alt=" " width="800" height="454"&gt;
&lt;/li&gt;
&lt;li&gt;under Advanced details use the same IAM instance profile we have been using for our EC2 instances.
&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%2Fwka58zqju39tpu6z3jnp.png" alt=" " width="800" height="442"&gt;
##Auto Scaling
EC2 &amp;gt; Auto Scaling &amp;gt; Auto Scaling Groups &amp;gt; Create Auto Scaling Group&lt;/li&gt;
&lt;li&gt;select the Launch Template we just created and click &lt;strong&gt;next&lt;/strong&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%2Fukq8f2wqh9iirjc73lck.png" alt=" " width="800" height="486"&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%2F2ixgemyrpcb4vb505pib.png" alt=" " width="800" height="486"&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%2Fja43k44yvfp67zb24m48.png" alt=" " width="800" height="514"&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%2F5vkxb3mnkd9fualumzsd.png" alt=" " width="800" height="488"&gt;
After the above step Click &lt;strong&gt;next&lt;/strong&gt;, next finally click &lt;strong&gt;Create Auto Scaling group&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Finally we get our &lt;strong&gt;"webapp"&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Website Building &amp; Hosting</title>
      <dc:creator>Rafil</dc:creator>
      <pubDate>Mon, 31 Mar 2025 18:12:45 +0000</pubDate>
      <link>https://dev.to/mohamed_rafil/website-building-28ld</link>
      <guid>https://dev.to/mohamed_rafil/website-building-28ld</guid>
      <description>&lt;h2&gt;
  
  
  VPC Creation
&lt;/h2&gt;

&lt;p&gt;VPC &amp;gt; Your VPCs &amp;gt; create VPC&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select &lt;strong&gt;VPC and more&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%2Fb2neka1z6hnowdo5dc87.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%2Fb2neka1z6hnowdo5dc87.png" alt=" " width="800" height="404"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the NAT gateways section, select &lt;strong&gt;1 per AZ&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create VPC&lt;/strong&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%2Fvaygma03a9p0ugy37g7o.png" alt=" " width="800" height="333"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Security Groups
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1.Security group for internet facing load balancer&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click &lt;strong&gt;Create security group&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;In the Inbound rules section click Add rule and Type: "HTTP", Protocol: "TCP", Port Range: "80" &amp;amp; Source: "Anywhere-IPv4".
&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%2Fdp2ji0ocibrbzhk43bt1.png" alt=" " width="800" height="504"&gt;
&lt;strong&gt;2.Security group for Web Server&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Create security group&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;In the Inbound rules section click Add rule and Type: "HTTP", Protocol: "TCP", Port Range: "80" &amp;amp; Source: "Custom" and also select the load balancer security group 
&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%2F8emd5w2vrnq3gdzhlr9t.png" alt=" " width="800" height="490"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Access Management(IAM)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a new IAM role and associate it with the EC2 instance profile for the web server.
IAM &amp;gt;Roles &amp;gt; Create role&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Roles&lt;/strong&gt;, click &lt;strong&gt;Create role&lt;/strong&gt;.
Select &lt;strong&gt;AWS Service&lt;/strong&gt;. Choose &lt;strong&gt;EC2&lt;/strong&gt; for the service or use case.&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;EC2 Role for AWS Systems Manager&lt;/strong&gt; and click &lt;strong&gt;Next&lt;/strong&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%2Fdpy7jw1o8vxm5k265cox.png" alt=" " width="800" height="331"&gt;Confirm that the AmazonSSMManagedInstanceCore policy has been added.
&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%2Fb6blagl3nh1xr8tah1xl.png" alt=" " width="800" height="149"&gt;Name the role and click Create role.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Instance Creation
&lt;/h2&gt;

&lt;p&gt;EC2 &amp;gt; Instances &amp;gt; Launch an instance&lt;br&gt;
Name the server&lt;br&gt;
Select the &lt;strong&gt;t2.micro&lt;/strong&gt; instance type&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%2F19o0og5s3axvog3t38aq.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%2F19o0og5s3axvog3t38aq.png" alt=" " width="800" height="389"&gt;&lt;/a&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%2Fta4b4yuw638mg49zl80f.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%2Fta4b4yuw638mg49zl80f.png" alt=" " width="800" height="345"&gt;&lt;/a&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%2Fxa2deojd3kohmsvi9clw.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%2Fxa2deojd3kohmsvi9clw.png" alt=" " width="800" height="346"&gt;&lt;/a&gt;&lt;br&gt;
!/bin/bash&lt;br&gt;
yum update -y&lt;br&gt;
 Install Session Manager agent&lt;br&gt;
yum install -y &lt;a href="https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm" rel="noopener noreferrer"&gt;https://s3.amazonaws.com/ec2-downloads-windows/SSMAgent/latest/linux_amd64/amazon-ssm-agent.rpm&lt;/a&gt;&lt;br&gt;
systemctl enable amazon-ssm-agent&lt;br&gt;
 Install and start the php web server&lt;br&gt;
dnf install -y httpd wget php-json php&lt;br&gt;
chkconfig httpd on&lt;br&gt;
systemctl start httpd&lt;br&gt;
systemctl enable httpd&lt;/p&gt;

&lt;p&gt;Install AWS SDK for PHP&lt;br&gt;
wget &lt;a href="https://docs.aws.amazon.com/aws-sdk-php/v3/download/aws.zip" rel="noopener noreferrer"&gt;https://docs.aws.amazon.com/aws-sdk-php/v3/download/aws.zip&lt;/a&gt;&lt;br&gt;
unzip aws.zip -d /var/www/html/sdk&lt;br&gt;
rm aws.zip&lt;/p&gt;

&lt;p&gt;Install the web pages for our lab&lt;br&gt;
if [ ! -f /var/www/html/index.html ]; then&lt;br&gt;
rm index.html&lt;br&gt;
fi&lt;br&gt;
cd /var/www/html&lt;br&gt;
wget &lt;a href="https://ws-assets-prod-iad-r-iad-ed304a55c2ca1aee.s3.us-east-1.amazonaws.com/2aa53d6e-6814-4705-ba90-04dfa93fc4a3/index.php" rel="noopener noreferrer"&gt;https://ws-assets-prod-iad-r-iad-ed304a55c2ca1aee.s3.us-east-1.amazonaws.com/2aa53d6e-6814-4705-ba90-04dfa93fc4a3/index.php&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Update existing packages&lt;br&gt;
dnf update -y&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%2F69y7l1eufpv97957qkvr.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%2F69y7l1eufpv97957qkvr.png" alt=" " width="800" height="237"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  SSM
&lt;/h2&gt;

&lt;p&gt;Ensure the web server instance is still selected and click &lt;strong&gt;Connect&lt;/strong&gt;.&lt;br&gt;
Select the &lt;strong&gt;Session Manager&lt;/strong&gt; tab and click &lt;strong&gt;Connect&lt;/strong&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%2F2d5ru0twfvo8mwcoc3f5.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%2F2d5ru0twfvo8mwcoc3f5.png" alt=" " width="800" height="93"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Load Balancing
&lt;/h2&gt;

&lt;p&gt;EC2 &amp;gt; Load Balancing &amp;gt; Load Balancers &amp;gt; Create load balancer&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;click &lt;strong&gt;Create Load Balancer&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;We'll be using an Application Load Balancer for our HTTP traffic so click the create button for that option.&lt;/li&gt;
&lt;li&gt;After giving the load balancer a name, be sure to select &lt;strong&gt;Internet facing&lt;/strong&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%2Fwv2zhake2rw1izvypu5q.png" alt=" " width="800" height="357"&gt;
&lt;/li&gt;
&lt;li&gt;Select the correct network configuration for VPC and private subnets.&lt;/li&gt;
&lt;li&gt;Select the security group we created for this internet facing ALB. Now, this ALB will be listening for HTTP traffic on port 80.
&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%2F4fvm10qisz7hcme3lc75.png" alt=" " width="800" height="456"&gt;
&lt;strong&gt;Create a Target group&lt;/strong&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%2Fgqbiogj9klklk8d37lh6.png" alt=" " width="800" height="313"&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%2Fqzzjvoyhudrp09daygn5.png" alt=" " width="800" height="510"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Testing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Copy the DNS name from the Load Balancer page and paste it into a new browser tab.&lt;/li&gt;
&lt;li&gt;Please open new tab, type http:// and the paste copied DNS name.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  S3 Bucket Creation
&lt;/h2&gt;

&lt;p&gt;Click &lt;strong&gt;Create Bucket&lt;/strong&gt;&lt;br&gt;
Give the S3 bucket a fun and unique name&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%2F6qxgc7qomgvio1tnk6b7.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%2F6qxgc7qomgvio1tnk6b7.png" alt=" " width="800" height="504"&gt;&lt;/a&gt;Next, let's upload some files to the bucket&lt;br&gt;
Use the S3 console to upload the files you downloaded. Click Add files and select all the unarchived files.&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%2F298xu2y9gspg7q5johs9.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%2F298xu2y9gspg7q5johs9.png" alt=" " width="800" height="225"&gt;&lt;/a&gt;Switch back to the website and enter the bucket name and region in the provided fields.&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%2Fe5op4h081bcmc3oqg9aq.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%2Fe5op4h081bcmc3oqg9aq.png" alt=" " width="800" height="430"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Uploading objects into S3 bucket using EC2(PuTTY) + IAM + S3</title>
      <dc:creator>Rafil</dc:creator>
      <pubDate>Fri, 24 Jan 2025 02:42:26 +0000</pubDate>
      <link>https://dev.to/mohamed_rafil/uploading-objects-into-s3-bucket-using-ec2putty-iam-s3-4d4d</link>
      <guid>https://dev.to/mohamed_rafil/uploading-objects-into-s3-bucket-using-ec2putty-iam-s3-4d4d</guid>
      <description>&lt;h2&gt;
  
  
  &lt;strong&gt;1.Launch an Instance&lt;/strong&gt;
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open &lt;strong&gt;EC2&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Open "Launch Instances"&lt;/li&gt;
&lt;li&gt;Select a server name&lt;/li&gt;
&lt;li&gt;Select an AMI (Amazon Linux)&lt;/li&gt;
&lt;li&gt;Select Instance type (t2.micro)&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Create new Key pair&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%2Fgzh9tuvlkfvi2orscw9u.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%2Fgzh9tuvlkfvi2orscw9u.png" alt=" " width="589" height="613"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then, select &lt;strong&gt;"Launch Instance"&lt;/strong&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%2Foz7lw2ochlq33gqsk0xy.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%2Foz7lw2ochlq33gqsk0xy.png" alt=" " width="800" height="84"&gt;&lt;/a&gt;&lt;br&gt;
Instance created Successfully !&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. PuTTY Installation
&lt;/h2&gt;

&lt;p&gt;Install PuTTY in the system, if not already installed...&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Whitewash IP address
&lt;/h2&gt;

&lt;p&gt;Check the public IP of your device in online website like "(&lt;a href="https://whatismyip.com/)" rel="noopener noreferrer"&gt;https://whatismyip.com/)&lt;/a&gt;"&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Change Security Group Rules
&lt;/h2&gt;

&lt;p&gt;After getting your device 'IP' change the inbound rules of the security group by following the below mentioned steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Select the "Security" to change the security group&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Then, select the 'security group' and change the 'inbound rules'&lt;br&gt;
*&lt;em&gt;security-&amp;gt; security-group -&amp;gt; Edit inbound rules *&lt;/em&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;In the 'Edit inbound rules' sections, change the type: 'SSH' , Source: 'Custom' and then put the public IP of your device&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on 'Save changes'&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%2F6puvkr9c0klsrxyy2ol3.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%2F6puvkr9c0klsrxyy2ol3.png" alt=" " width="800" height="195"&gt;&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  5. PuTTYgen Key Configuration
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Open &lt;strong&gt;'PuTTYgen'&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select 'Load'&lt;/li&gt;
&lt;li&gt;Then select the created 'pem key' to convert it into a 'private key'&lt;/li&gt;
&lt;li&gt;Click 'Save private key'&lt;/li&gt;
&lt;li&gt;Then save it in the system...&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. IAM Role Creation
&lt;/h2&gt;

&lt;p&gt;Open &lt;strong&gt;IAM&lt;/strong&gt;&lt;br&gt;
IAM -&amp;gt; Roles -&amp;gt; Create role&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%2Fs11rysf55b11hrd0u396.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%2Fs11rysf55b11hrd0u396.png" alt=" " width="800" height="366"&gt;&lt;/a&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%2Fodi8sn58m80cszumfu0k.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%2Fodi8sn58m80cszumfu0k.png" alt=" " width="800" height="350"&gt;&lt;/a&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%2Fyvl5qaianmvcr9wux313.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%2Fyvl5qaianmvcr9wux313.png" alt=" " width="800" height="368"&gt;&lt;/a&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%2F7foqr33rt9kf7o7htq2e.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%2F7foqr33rt9kf7o7htq2e.png" alt=" " width="328" height="60"&gt;&lt;/a&gt;&lt;br&gt;
IAM role created successfully !&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Modify IAM role for the instance
&lt;/h2&gt;

&lt;p&gt;Select the instance&lt;br&gt;
&lt;strong&gt;Actions -&amp;gt; Security -&amp;gt; modify IAM role -&amp;gt; Update IAM role&lt;/strong&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%2F7xw0w9xarvh3s6e9d84u.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%2F7xw0w9xarvh3s6e9d84u.png" alt=" " width="800" height="148"&gt;&lt;/a&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%2F3kkxlwa1ui26fejr64dv.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%2F3kkxlwa1ui26fejr64dv.png" alt=" " width="800" height="151"&gt;&lt;/a&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%2Fh8rujc50l9e216sqgc03.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%2Fh8rujc50l9e216sqgc03.png" alt=" " width="800" height="139"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  8. PuTTY configuration
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Copy the created EC2 instance's public ip address&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;'PuTTY'&lt;/strong&gt; 
In the PuTTY configuration:&lt;/li&gt;
&lt;li&gt;In the 'Host Name or ( IP address)' column paste the ip address of the EC2 instance&lt;/li&gt;
&lt;li&gt;Then in the side bar, select '+' that's before 'SSH' and then select the '+' before 'Auth'.&lt;/li&gt;
&lt;li&gt;After that, click on 'Credentials' and browse the private key from your device.&lt;/li&gt;
&lt;li&gt;Then click 'Open'&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Category- + SSH -&amp;gt; + Auth -&amp;gt; Credentials -&amp;gt; Browse private key -&amp;gt; Open&lt;/strong&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%2Fim0cf9gei7lwe56bklvg.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%2Fim0cf9gei7lwe56bklvg.png" alt=" " width="674" height="680"&gt;&lt;/a&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  9. Linux CLI Operations
&lt;/h2&gt;

&lt;p&gt;Now, Linux command line will be opened...&lt;br&gt;
Login as 'ec2-user'&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%2Faeqn5fnd523egefgk0as.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%2Faeqn5fnd523egefgk0as.png" alt=" " width="800" height="534"&gt;&lt;/a&gt;&lt;br&gt;
Then run the following commands:&lt;br&gt;
&lt;code&gt;aws&lt;br&gt;
aws s3 ls&lt;/code&gt;&lt;br&gt;
Then create a text file using 'echo' command&lt;br&gt;
Example : &lt;code&gt;echo "this is a text file" &amp;gt; details.txt&lt;/code&gt;&lt;br&gt;
At last, run the following command to upload the text file into the s3 bucket&lt;br&gt;
&lt;code&gt;aws s3 cp file-name s3://bucket-name/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now go to amazon S3 and click on bucket to check whether the object is uploaded or not.&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%2F70gs38qjl83b8bl91gx5.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%2F70gs38qjl83b8bl91gx5.png" alt=" " width="800" height="163"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;10. Terminate the instance and delete the bucket&lt;/strong&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AWS CloudTrail</title>
      <dc:creator>Rafil</dc:creator>
      <pubDate>Thu, 23 Jan 2025 03:30:31 +0000</pubDate>
      <link>https://dev.to/mohamed_rafil/aws-cloudtrail-4e37</link>
      <guid>https://dev.to/mohamed_rafil/aws-cloudtrail-4e37</guid>
      <description>&lt;h2&gt;
  
  
  1. Service Overview
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;AWS - CloudTrail&lt;/strong&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%2Fajs11jyeawsfyeayut9p.jpg" 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%2Fajs11jyeawsfyeayut9p.jpg" alt=" " width="397" height="270"&gt;&lt;/a&gt;&lt;br&gt;
AWS CloudTrail is an AWS service that helps you enable governance, compliance, and operational &amp;amp; risk auditing of your AWS account. Actions taken by a user, role, or an AWS service are recorded as events in CloudTrail.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Key Features
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Tracks All Activities&lt;/strong&gt;: Records every API call and user action in your AWS account.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Region Support&lt;/strong&gt;: Monitors activities across all AWS regions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security and Integrity&lt;/strong&gt;: Ensures logs are tamper-proof and can be encrypted.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-Time Alerts&lt;/strong&gt;: Integrates with CloudWatch to send alerts for unusual activity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Change Monitoring&lt;/strong&gt;: Helps track resource changes and detect potential issues.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Reliable Storage&lt;/strong&gt;: Stores logs securely with Amazon S3's high durability. &lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  3. Use cases
&lt;/h2&gt;

&lt;p&gt;AWS CloudTrail tracks user activities and API calls, helping to identify unauthorized access or suspicious behavior. The service also plays a key role in troubleshooting operational issues and monitoring changes to resources, such as security group updates or instance launches. With its detailed logs, CloudTrail facilitates forensic analysis during security incidents and ensures better visibility across multiple AWS accounts through centralized logging.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Pricing model
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Management Events&lt;/strong&gt;: Free for the last 90 days; additional storage incurs S3 charges.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Events&lt;/strong&gt;: $0.10 per 100,000 events for S3 and Lambda logging.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Insights Events&lt;/strong&gt;: $0.35 per 100,000 events for anomaly detection.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Log Delivery&lt;/strong&gt;: Charges apply for S3 storage and CloudWatch Logs if used.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Free Tier&lt;/strong&gt;: One free trail per region for management events.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  5. Comparison with other similar services
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Azure Monitor&lt;/strong&gt;: Tracks activity in Azure but lacks AWS-specific API tracking like CloudTrail.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Google Cloud Audit Logs&lt;/strong&gt;: Similar to CloudTrail but focused on Google Cloud resources.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IBM Cloud Activity Tracker&lt;/strong&gt;: Tracks user activity on IBM Cloud, but less AWS-specific integration.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Datadog Cloud Security Monitoring&lt;/strong&gt;: Focuses on real-time monitoring and security, not detailed activity logs like CloudTrail.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Sumo Logic Cloud SIEM&lt;/strong&gt;: Provides event correlation for security but lacks AWS-specific activity tracking.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  6. Benefits and Challenges
&lt;/h2&gt;

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

&lt;ul&gt;
&lt;li&gt;Improved Security
&lt;/li&gt;
&lt;li&gt;Compliance Support
&lt;/li&gt;
&lt;li&gt;Operational Insights
&lt;/li&gt;
&lt;li&gt;Change Tracking
&lt;/li&gt;
&lt;li&gt;Cost-Effective
&lt;/li&gt;
&lt;/ul&gt;

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

&lt;ul&gt;
&lt;li&gt;Storage Costs
&lt;/li&gt;
&lt;li&gt;Log Management
&lt;/li&gt;
&lt;li&gt;Complex Setup for Multi-Account
&lt;/li&gt;
&lt;li&gt;Data Retention Complexity &lt;/li&gt;
&lt;li&gt;Potential Performance Impact
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  7. Real - world Example
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Security Breach Investigation&lt;/strong&gt;:
A financial institution identified unauthorized access to sensitive data using CloudTrail logs. They tracked the source of the breach, revoked compromised credentials, and implemented stricter IAM policies.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Compliance Monitoring&lt;/strong&gt;:
A healthcare company used CloudTrail to meet HIPAA compliance by logging all API calls and user activities, ensuring transparency and audit readiness.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Troubleshooting Errors&lt;/strong&gt;:
An e-commerce platform experienced application downtime. By analyzing CloudTrail logs, they identified a misconfigured security group and quickly resolved the issue.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost Optimization&lt;/strong&gt;:
A startup identified unused EC2 instances by reviewing CloudTrail activity logs, helping them reduce unnecessary costs.
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Account Logging&lt;/strong&gt;:
A multinational corporation used CloudTrail to centralize logs from multiple AWS accounts, improving visibility and simplifying audits for their global operations.
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>aws</category>
      <category>awscloudtrail</category>
    </item>
  </channel>
</rss>
