<?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: Hritik Raj</title>
    <description>The latest articles on DEV Community by Hritik Raj (@hritikraj8804).</description>
    <link>https://dev.to/hritikraj8804</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%2F1197959%2F3ed78f73-4341-4cb6-b659-0176328c8751.jpeg</url>
      <title>DEV Community: Hritik Raj</title>
      <link>https://dev.to/hritikraj8804</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hritikraj8804"/>
    <language>en</language>
    <item>
      <title>Building a Global HTTP Load Balancer with Managed Instance Groups</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Sat, 28 Feb 2026 16:05:51 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/building-a-global-http-load-balancer-with-managed-instance-groups-352m</link>
      <guid>https://dev.to/hritikraj8804/building-a-global-http-load-balancer-with-managed-instance-groups-352m</guid>
      <description>&lt;h2&gt;
  
  
  🚀 Scaling Applications the Right Way: My First GCP Load Balancer Setup
&lt;/h2&gt;

&lt;p&gt;Hey Engineers 👋  &lt;/p&gt;

&lt;p&gt;Today, I stepped into something that every production system relies on a &lt;strong&gt;Global HTTP Load Balancer&lt;/strong&gt; on Google Cloud Platform.&lt;/p&gt;

&lt;p&gt;Instead of running a single VM and hoping it survives traffic spikes, I built a proper architecture with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Managed Instance Group&lt;/li&gt;
&lt;li&gt;Health Checks&lt;/li&gt;
&lt;li&gt;Backend Service&lt;/li&gt;
&lt;li&gt;Global HTTP Load Balancer&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let’s break it down.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create an Instance Template with Nginx installed&lt;/li&gt;
&lt;li&gt;Launch 2 VM instances using a Managed Instance Group&lt;/li&gt;
&lt;li&gt;Configure HTTP Health Checks&lt;/li&gt;
&lt;li&gt;Create a Global HTTP Load Balancer&lt;/li&gt;
&lt;li&gt;Verify traffic distribution across VMs&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🏗️ Architecture Overview
&lt;/h2&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%2Fezebhq6vlyruxa2kptlo.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%2Fezebhq6vlyruxa2kptlo.png" alt="Load Balancer" width="800" height="449"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This setup ensures:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;High availability&lt;/li&gt;
&lt;li&gt;Traffic distribution&lt;/li&gt;
&lt;li&gt;Automatic health monitoring&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Phase A: Create Instance Template
&lt;/h2&gt;

&lt;p&gt;I first created an Instance Template to ensure uniform VM configuration.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Machine Type:&lt;/strong&gt; e2-micro&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Region:&lt;/strong&gt; us-central1&lt;br&gt;&lt;br&gt;
&lt;strong&gt;Firewall:&lt;/strong&gt; Allow HTTP traffic  &lt;/p&gt;

&lt;p&gt;Startup Script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
apt update &lt;span class="nt"&gt;-y&lt;/span&gt;
apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"Hello from &lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;hostname&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /var/www/html/index.html
systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fr7ggfod8i50hqmudkrkg.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%2Fr7ggfod8i50hqmudkrkg.jpg" alt=" " width="800" height="162"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Each VM now serves its hostname via Nginx.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Phase B: Create Managed Instance Group
&lt;/h2&gt;

&lt;p&gt;Using the template, I created a Managed Instance Group (MIG) with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;2 instances&lt;/li&gt;
&lt;li&gt;Same zone&lt;/li&gt;
&lt;li&gt;Auto-healing enabled&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%2Fj7k5zpn61ceza0l4xmqy.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%2Fj7k5zpn61ceza0l4xmqy.jpg" alt=" " width="800" height="156"&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%2Fnwgz0imno08bkwzo6ouv.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%2Fnwgz0imno08bkwzo6ouv.jpg" alt=" " width="800" height="125"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Why MIG?&lt;/p&gt;

&lt;p&gt;Because:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Ensures identical VM deployment&lt;/li&gt;
&lt;li&gt;Supports auto scaling&lt;/li&gt;
&lt;li&gt;Works seamlessly with Load Balancer&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Phase C: Configure Health Check
&lt;/h2&gt;

&lt;p&gt;I created an HTTP health check with:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Protocol: HTTP&lt;/li&gt;
&lt;li&gt;Port: 80&lt;/li&gt;
&lt;li&gt;Path: /&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This ensures the Load Balancer only routes traffic to healthy instances.&lt;/p&gt;

&lt;p&gt;Without this, traffic distribution will fail.&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%2Ft2g3fwillhlfdzxnnelw.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%2Ft2g3fwillhlfdzxnnelw.jpg" alt=" " width="800" height="252"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠️ Phase D: Create Global HTTP Load Balancer
&lt;/h2&gt;

&lt;p&gt;Under:&lt;/p&gt;

&lt;p&gt;Network Services → Load Balancing → Create Load Balancer&lt;/p&gt;

&lt;p&gt;Configuration:&lt;/p&gt;

&lt;h3&gt;
  
  
  Backend
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Backend Type: Instance Group&lt;/li&gt;
&lt;li&gt;Attached: Managed Instance Group&lt;/li&gt;
&lt;li&gt;Attached: Health Check&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Frontend
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Protocol: HTTP&lt;/li&gt;
&lt;li&gt;IP: Ephemeral public IP&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Deployment took around 3–5 minutes (important: GCP takes time to propagate globally).&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%2F6k1jttylsk7nyn0p5905.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%2F6k1jttylsk7nyn0p5905.jpg" alt=" " width="800" height="98"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Testing Traffic Distribution
&lt;/h2&gt;

&lt;p&gt;After deployment, I accessed the Load Balancer IP in the browser.&lt;/p&gt;

&lt;p&gt;Refreshing multiple times showed:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Hello from instance-1
Hello from instance-2
Hello from instance-1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F2juyeol7yp4l67sjmkfz.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%2F2juyeol7yp4l67sjmkfz.jpg" alt=" " width="800" height="201"&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%2F16h6h1ypy9x0gsrhj949.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%2F16h6h1ypy9x0gsrhj949.jpg" alt=" " width="800" height="222"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To test via terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="k"&gt;while &lt;/span&gt;&lt;span class="nb"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;do &lt;/span&gt;curl http://LOAD_BALANCER_IP&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;sleep &lt;/span&gt;1&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="k"&gt;done&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This confirmed proper traffic rotation.&lt;/p&gt;




&lt;h2&gt;
  
  
  🧠 Key Concepts Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Managed Instance Groups simplify scaling.&lt;/li&gt;
&lt;li&gt;Health checks are mandatory for traffic routing.&lt;/li&gt;
&lt;li&gt;Firewall rules directly impact load balancer behaviour.&lt;/li&gt;
&lt;li&gt;Global HTTP Load Balancer configuration takes propagation time.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚀 What’s Next
&lt;/h2&gt;

&lt;p&gt;To take this further, I plan to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enable auto scaling&lt;/li&gt;
&lt;li&gt;Add HTTPS with SSL certificates&lt;/li&gt;
&lt;li&gt;Attach a custom domain&lt;/li&gt;
&lt;li&gt;Deploy a real application instead of static Nginx&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📝 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This was my first hands-on experience building a scalable web architecture in GCP.&lt;/p&gt;

&lt;p&gt;Instead of just reading about load balancing, I implemented it debugged it and understood how production-grade systems maintain availability.&lt;/p&gt;

&lt;p&gt;That’s the difference between theory and engineering.&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💼 LinkedIn: &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;https://www.linkedin.com/in/hritik-raj-8804hr/&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If you're also building in cloud, let’s learn together 🚀&lt;/p&gt;

</description>
      <category>gcp</category>
      <category>loadbalancing</category>
      <category>devops</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>💽 AWS 150: Zero-Downtime Storage Scaling - Expanding EBS Volumes</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Fri, 30 Jan 2026 04:05:39 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-150-zero-downtime-storage-scaling-expanding-ebs-volumes-1oik</link>
      <guid>https://dev.to/hritikraj8804/aws-150-zero-downtime-storage-scaling-expanding-ebs-volumes-1oik</guid>
      <description>&lt;h1&gt;
  
  
  🚀 Scaling without Stopping: Expanding EBS Volumes on the Fly
&lt;/h1&gt;

&lt;p&gt;Hey Cloud Architects 👋&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%2F6ylq1osxc7hfgf60y4nk.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%2F6ylq1osxc7hfgf60y4nk.jpg" alt="AWS EBS Storage" width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 50 of the #100DaysOfCloud Challenge&lt;/strong&gt;! &lt;/p&gt;

&lt;p&gt;Today, we are solving a common production headache: a server running out of disk space. The &lt;code&gt;datacenter-ec2&lt;/code&gt; instance is hitting its limit, and we need to increase its storage from &lt;strong&gt;8 GiB to 12 GiB&lt;/strong&gt;. We’ll be performing a "hot" expansion modifying the infrastructure in the AWS Console and then extending the filesystem via the CLI all without a reboot.&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%2Frws5eajmrlxmkzoenyqh.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%2Frws5eajmrlxmkzoenyqh.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, which is perfect for mastering Linux storage management.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Identify the Elastic Block Store (EBS) volume attached to &lt;code&gt;datacenter-ec2&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Modify the volume size in the AWS Management Console from 8 GiB to 12 GiB.&lt;/li&gt;
&lt;li&gt;SSH into the instance using the provided &lt;code&gt;.pem&lt;/code&gt; key.&lt;/li&gt;
&lt;li&gt;Use Linux CLI tools (&lt;code&gt;growpart&lt;/code&gt; and &lt;code&gt;resize2fs&lt;/code&gt; or &lt;code&gt;xfs_growfs&lt;/code&gt;) to reflect the new size in the root partition.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why Online Expansion?
&lt;/h2&gt;

&lt;p&gt;In a traditional data center, adding storage often meant downtime, mounting new drives, or complex RAID re-configurations. With AWS EBS, the physical hardware change is virtualized. However, increasing the "container" size (the volume) doesn't automatically grow the "room" inside (the partition and filesystem). We must manually tell the OS to use the newly available space.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Elastic Block Store (EBS):&lt;/strong&gt; Scalable block-level storage volumes for EC2 instances.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Volume Modification:&lt;/strong&gt; The AWS API action that changes the block device size.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partition vs. Filesystem:&lt;/strong&gt; The partition is the "slice" of the disk, while the filesystem (like ext4 or XFS) is the actual data structure inside that slice. Both must be expanded.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: Storage Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: AWS Console Modification
&lt;/h3&gt;

&lt;p&gt;First, we tell AWS to increase the physical allocation of the block device.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Find Volume:&lt;/strong&gt; Navigate to the EC2 Dashboard, select &lt;code&gt;datacenter-ec2&lt;/code&gt;, and click on the "Storage" tab to find the Volume ID.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftqsi7okljqe4kcq29nqx.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%2Ftqsi7okljqe4kcq29nqx.jpg" alt=" " width="800" height="435"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Modify Volume:&lt;/strong&gt; Go to &lt;strong&gt;Volumes&lt;/strong&gt;, select the ID, click &lt;strong&gt;Actions &amp;gt; Modify Volume&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%2Fx9ta9k3xyprwffwh4npz.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%2Fx9ta9k3xyprwffwh4npz.jpg" alt=" " width="800" height="274"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;New Size:&lt;/strong&gt; Change the size from &lt;code&gt;8&lt;/code&gt; to &lt;code&gt;12&lt;/code&gt; GiB and click Modify.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Status:&lt;/strong&gt; Wait for the volume state to show "in-use - optimized" (though you can proceed while it's optimizing).&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%2F7cbynrn48d5dzao4ncyb.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%2F7cbynrn48d5dzao4ncyb.jpg" alt=" " width="800" height="367"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase B: Connect to the Instance
&lt;/h3&gt;

&lt;p&gt;Now we move to the command line to finalize the change within the OS.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SSH Command:&lt;/strong&gt; Use the key located at &lt;code&gt;/root/datacenter-keypair.pem&lt;/code&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  ssh &lt;span class="nt"&gt;-i&lt;/span&gt; /root/datacenter-keypair.pem ubuntu@&amp;lt;EC2_PUBLIC_IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Verify Block Device:&lt;/strong&gt; Run &lt;code&gt;lsblk&lt;/code&gt; to confirm the OS sees 12GB at the disk level but still shows 8GB at the partition level.&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%2F0ph29mlxzs206tagd6qj.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%2F0ph29mlxzs206tagd6qj.jpg" alt=" " width="393" height="157"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase C: Expanding the Partition (CLI)
&lt;/h3&gt;

&lt;p&gt;We must extend the partition to fill the new 12GB of space.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Grow Partition:&lt;/strong&gt; Use the &lt;code&gt;growpart&lt;/code&gt; command on the root disk (usually &lt;code&gt;/dev/xvda&lt;/code&gt; or &lt;code&gt;/dev/nvme0n1&lt;/code&gt;).
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;growpart /dev/xvda 1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fie4nkgbmhrzu1wkaqsv0.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%2Fie4nkgbmhrzu1wkaqsv0.jpg" alt=" " width="442" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Verify:&lt;/strong&gt; Run &lt;code&gt;lsblk&lt;/code&gt; again. You should now see the partition size has increased to 12G.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase D: Expanding the Filesystem (CLI)
&lt;/h3&gt;

&lt;p&gt;The final step is to stretch the filesystem into the new partition space.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check Filesystem Type:&lt;/strong&gt; Run &lt;code&gt;df -hT&lt;/code&gt; to see if it is &lt;code&gt;ext4&lt;/code&gt; or &lt;code&gt;xfs&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resize (for ext4):&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;resize2fs /dev/xvda1
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Resize (for XFS):&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;xfs_growfs &lt;span class="nt"&gt;-d&lt;/span&gt; /
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F173fftsvddtk8sb9qim1.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%2F173fftsvddtk8sb9qim1.jpg" alt=" " width="800" height="325"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Disk Usage Check:&lt;/strong&gt; Run &lt;code&gt;df -h&lt;/code&gt; and confirm that &lt;code&gt;/&lt;/code&gt; now shows a total size of &lt;strong&gt;12 GiB&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service Health:&lt;/strong&gt; Ensure your application is still running without issues.&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%2F8dadozj6lyp58lfl2n5b.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%2F8dadozj6lyp58lfl2n5b.jpg" alt=" " width="707" height="317"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;No Reboot Needed:&lt;/strong&gt; Modern Linux kernels and EBS volumes support live resizing, which is critical for 24/7 operations.&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;Snapshot First:&lt;/strong&gt; In production, always take an EBS Snapshot before modifying a volume, just in case something goes wrong during the partition resize.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Optimization Time:&lt;/strong&gt; While the size change is immediate, the underlying AWS hardware may take time to "optimize" the performance of the new space.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Incorrect Device Name:&lt;/strong&gt; Running &lt;code&gt;growpart&lt;/code&gt; on the wrong disk or forgetting the partition number (the &lt;code&gt;1&lt;/code&gt; in &lt;code&gt;/dev/xvda 1&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Skipping the Filesystem:&lt;/strong&gt; Many forget the &lt;code&gt;resize2fs&lt;/code&gt; step; if you skip this, &lt;code&gt;lsblk&lt;/code&gt; will show 12GB but &lt;code&gt;df -h&lt;/code&gt; will still show 8GB.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permission Denied:&lt;/strong&gt; Always use &lt;code&gt;sudo&lt;/code&gt; for storage commands as they require root-level access to the block devices.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Storage management is a bread-and-butter skill for DevOps. By mastering the transition from AWS Console changes to Linux CLI execution, you ensure that your team's development environment stays performant and scalable without ever hitting a "Disk Full" wall.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;Want to master Linux storage and AWS EBS? Practice here:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>ebs</category>
      <category>ec2</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>🌐 AWS 149: Multi-VPC Log Aggregation - Peering, IAM Roles, and S3 Integration</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Thu, 29 Jan 2026 09:45:57 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-149-multi-vpc-log-aggregation-peering-iam-roles-and-s3-integration-666</link>
      <guid>https://dev.to/hritikraj8804/aws-149-multi-vpc-log-aggregation-peering-iam-roles-and-s3-integration-666</guid>
      <description>&lt;h1&gt;
  
  
  🚀 Secure Pipelines: Aggregating Logs across Private and Public VPCs
&lt;/h1&gt;

&lt;p&gt;Hey Cloud Architects 👋&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%2F6ylq1osxc7hfgf60y4nk.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%2F6ylq1osxc7hfgf60y4nk.jpg" alt="Cloud Networking" width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 49 of the #100DaysOfCloud Challenge&lt;/strong&gt;! &lt;br&gt;
Today, we are building a sophisticated log management architecture. The Nautilus DevOps team needs to move logs from an isolated private environment to a public aggregation server, and finally to long-term storage in S3. This requires mastering &lt;strong&gt;VPC Peering&lt;/strong&gt;, &lt;strong&gt;Route Tables&lt;/strong&gt;, and &lt;strong&gt;IAM Instance Profiles&lt;/strong&gt; to ensure data flows securely across different network boundaries.&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%2Frws5eajmrlxmkzoenyqh.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%2Frws5eajmrlxmkzoenyqh.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, which provides excellent scenarios for complex networking.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Provision a Public VPC (&lt;code&gt;devops-pub-vpc&lt;/code&gt;) with an Internet Gateway and proper routing.&lt;/li&gt;
&lt;li&gt;Launch a public aggregator instance (&lt;code&gt;devops-pub-ec2&lt;/code&gt;) with an IAM role for S3 access.&lt;/li&gt;
&lt;li&gt;Establish a &lt;strong&gt;VPC Peering Connection&lt;/strong&gt; between the private and public VPCs.&lt;/li&gt;
&lt;li&gt;Update Route Tables in both VPCs to allow traffic via the peering link.&lt;/li&gt;
&lt;li&gt;Automate log transfers using &lt;strong&gt;cron jobs&lt;/strong&gt; to move &lt;code&gt;boots.log&lt;/code&gt; from Private EC2 ➔ Public EC2 ➔ S3 Bucket.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why VPC Peering for Log Collection?
&lt;/h2&gt;

&lt;p&gt;VPC Peering allows you to connect two VPCs using private IP addresses. This means traffic between your instances never traverses the public internet, reducing latency and increasing security. It's the standard way to connect a "Management" or "Logging" VPC to your "Production" VPCs.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;VPC Peering:&lt;/strong&gt; A networking connection between two VPCs that enables you to route traffic between them privately.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;IAM Instance Profile:&lt;/strong&gt; Attaching a role directly to an EC2 instance so it can interact with S3 without needing hardcoded credentials.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;CIDR Routing:&lt;/strong&gt; Explicitly telling each VPC how to reach the other by adding destination CIDR blocks to the Route Tables.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: Infrastructure &amp;amp; Log Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: Building the Public Infrastructure
&lt;/h3&gt;

&lt;p&gt;We need a landing zone for our logs that has internet access to reach the S3 service.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VPC Setup:&lt;/strong&gt; Create &lt;code&gt;devops-pub-vpc&lt;/code&gt; and attach an &lt;strong&gt;Internet Gateway&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public Route Table:&lt;/strong&gt; Configure &lt;code&gt;devops-pub-rt&lt;/code&gt; with a route &lt;code&gt;0.0.0.0/0&lt;/code&gt; targeting the IGW.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public Instance:&lt;/strong&gt; Launch &lt;code&gt;devops-pub-ec2&lt;/code&gt; using the &lt;code&gt;devops-key.pem&lt;/code&gt;. &lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IAM Role:&lt;/strong&gt; Create &lt;code&gt;devops-s3-role&lt;/code&gt; with &lt;code&gt;PutObject&lt;/code&gt; permissions and attach it to the public instance.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase B: Establishing the Peering Connection
&lt;/h3&gt;

&lt;p&gt;Now we "bridge" the two VPCs so they can communicate over private IPs.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Peering Request:&lt;/strong&gt; Create &lt;code&gt;devops-vpc-peering&lt;/code&gt; from the private VPC to the public VPC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Acceptance:&lt;/strong&gt; Accept the peering request in the console.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Route Table Updates:&lt;/strong&gt; * In &lt;code&gt;devops-priv-rt&lt;/code&gt;, add a route to the Public VPC CIDR via the Peering Connection.

&lt;ul&gt;
&lt;li&gt;In &lt;code&gt;devops-pub-rt&lt;/code&gt;, add a route to the Private VPC CIDR via the Peering Connection.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&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%2F2hviwipnmpf51zb783qh.jpg" alt=" " width="800" height="164"&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔹 Phase C: Log Transfer Configuration (Private ➔ Public)
&lt;/h3&gt;

&lt;p&gt;On the &lt;code&gt;devops-priv-ec2&lt;/code&gt; instance, we set up the first leg of the journey.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;SSH Setup:&lt;/strong&gt; Ensure the public key is trusted between instances.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cron Job:&lt;/strong&gt; Set a cron task to periodically send the log file.

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;* * * * * scp -i ~/.ssh/devops-key.pem /var/log/boots.log ubuntu@&amp;lt;PUBLIC_INSTANCE_PRIVATE_IP&amp;gt;:/tmp/&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase D: Final Upload (Public ➔ S3)
&lt;/h3&gt;

&lt;p&gt;On the &lt;code&gt;devops-pub-ec2&lt;/code&gt; instance, we handle the final archival.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;S3 Bucket:&lt;/strong&gt; Create the private bucket &lt;code&gt;devops-s3-logs-28057&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cron Job:&lt;/strong&gt; Set a cron task to push the local file to S3 using the AWS CLI.

&lt;ul&gt;
&lt;li&gt;&lt;code&gt;* * * * * aws s3 cp /tmp/boots.log s3://devops-s3-logs-xxxx/devops-priv-vpc/boot/boots.log&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Peering Status:&lt;/strong&gt; The connection is marked as "Active" in the VPC console.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Check:&lt;/strong&gt; The &lt;code&gt;devops-priv-ec2&lt;/code&gt; can ping or SSH into &lt;code&gt;devops-pub-ec2&lt;/code&gt; using its Private IP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Final Archival:&lt;/strong&gt; Confirm the file exists in S3.&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%2Fa82joq7lbrv6d6lgmdo5.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%2Fa82joq7lbrv6d6lgmdo5.jpg" alt=" " width="800" height="159"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;Zero Credentials:&lt;/strong&gt; By using an IAM Role on the public EC2, we avoided storing secret keys on the server.&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;Network Isolation:&lt;/strong&gt; The private instance remains private; it only communicates with our trusted public aggregator over the peering link.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Standardized Paths:&lt;/strong&gt; Using bucket prefixes (folders) like &lt;code&gt;devops-priv-vpc/boot/&lt;/code&gt; makes it easier to manage logs as your infrastructure grows.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Overlapping CIDRs:&lt;/strong&gt; VPC Peering will fail if both VPCs use the exact same IP range (e.g., both using &lt;code&gt;10.0.0.0/16&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing Route Back:&lt;/strong&gt; Remember that routing is a two-way street; if you only update the private RT, the public instance won't know how to send a response back.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Group Blocks:&lt;/strong&gt; Ensure the Security Group on the public instance allows inbound SSH/SCP traffic from the Private VPC's CIDR range.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Building a multi-tier logging architecture is a hallmark of professional cloud engineering. You've successfully implemented a system that is secure, automated, and scalable. This setup ensures that critical logs are always backed up while maintaining strict network isolation for your private assets.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;Want to master VPC Peering and secure data pipelines? Get hands-on experience here:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>vpc</category>
      <category>s3</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>📜 AWS 148: Serverless IaC - Deploying Python Lambda Functions via CloudFormation</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Wed, 28 Jan 2026 05:24:21 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-148-serverless-iac-deploying-python-lambda-functions-via-cloudformation-50m</link>
      <guid>https://dev.to/hritikraj8804/aws-148-serverless-iac-deploying-python-lambda-functions-via-cloudformation-50m</guid>
      <description>&lt;h1&gt;
  
  
  🏗️ Automated Serverless: Building the nautilus-lambda-app Stack
&lt;/h1&gt;

&lt;p&gt;Hey Cloud Architects 👋&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%2F6ylq1osxc7hfgf60y4nk.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%2F6ylq1osxc7hfgf60y4nk.jpg" alt="AWS CloudFormation" width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 48 of the #100DaysOfCloud Challenge&lt;/strong&gt;! &lt;br&gt;
Today, we are moving beyond manual console clicks and embracing &lt;strong&gt;Infrastructure as Code (IaC)&lt;/strong&gt; to deploy serverless logic. The Nautilus DevOps team is standardizing their function deployments, and we are creating a &lt;strong&gt;CloudFormation&lt;/strong&gt; template to provision a Python-based Lambda function and its security role in one go.&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%2Frws5eajmrlxmkzoenyqh.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%2Frws5eajmrlxmkzoenyqh.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, ensuring perfect configuration for automated environments.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Author a CloudFormation template (&lt;code&gt;nautilus-lambda.yml&lt;/code&gt;) for a serverless application.&lt;/li&gt;
&lt;li&gt;Provision an IAM Execution Role named &lt;code&gt;lambda_execution_role&lt;/code&gt; with trust relationships for Lambda.&lt;/li&gt;
&lt;li&gt;Create a Lambda function named &lt;code&gt;nautilus-lambda&lt;/code&gt; using the &lt;strong&gt;Python&lt;/strong&gt; runtime.&lt;/li&gt;
&lt;li&gt;Implement inline code that returns a &lt;strong&gt;200 OK&lt;/strong&gt; status and the message &lt;strong&gt;"Welcome to KKE AWS Labs!"&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Deploy the stack named &lt;code&gt;nautilus-lambda-app&lt;/code&gt; and verify success via the AWS Console.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why Inline Code in CloudFormation?
&lt;/h2&gt;

&lt;p&gt;For simple functions, CloudFormation allows you to embed your Python code directly in the YAML file using the &lt;code&gt;ZipFile&lt;/code&gt; property. This is highly efficient for utility scripts or simple APIs because you don't need to manage separate &lt;code&gt;.zip&lt;/code&gt; files in S3 buckets for the initial deployment.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Execution Role:&lt;/strong&gt; The identity the Lambda function "assumes" to run. It must have a trust policy allowing &lt;code&gt;lambda.amazonaws.com&lt;/code&gt; to use it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Inline Handler:&lt;/strong&gt; In Python, the default handler is usually &lt;code&gt;index.lambda_handler&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stack Management:&lt;/strong&gt; Using a stack allows you to update or delete the function and its role as a single unit.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: IaC Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: Authoring the nautilus-lambda.yml Template
&lt;/h3&gt;

&lt;p&gt;The template must define the IAM role first so the Lambda function can reference it immediately.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File Path:&lt;/strong&gt; &lt;code&gt;/root/nautilus-lambda.yml&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration:&lt;/strong&gt; Use &lt;code&gt;Type: AWS::IAM::Role&lt;/code&gt; for the execution role and &lt;code&gt;Type: AWS::Lambda::Function&lt;/code&gt; for the compute resource.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Logic:&lt;/strong&gt; The &lt;code&gt;ZipFile&lt;/code&gt; property under &lt;code&gt;Code&lt;/code&gt; should contain the &lt;code&gt;lambda_handler&lt;/code&gt; function returning the specific "Welcome to KKE AWS Labs!" string.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase B: Deploying the Stack via Console
&lt;/h3&gt;

&lt;p&gt;With the YAML file ready, we use the AWS Management Console to create the resources.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Upload:&lt;/strong&gt; Upload the &lt;code&gt;nautilus-lambda.yml&lt;/code&gt; file in the CloudFormation dashboard.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Stack Name:&lt;/strong&gt; Set it to &lt;code&gt;nautilus-lambda-app&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Capabilities:&lt;/strong&gt; You &lt;strong&gt;must&lt;/strong&gt; check the box "I acknowledge that AWS CloudFormation might create IAM resources" before clicking Create.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase C: Verification of Resources
&lt;/h3&gt;

&lt;p&gt;Once the status is &lt;code&gt;CREATE_COMPLETE&lt;/code&gt;, we verify the components.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Lambda Inspection:&lt;/strong&gt; Navigate to the Lambda console and ensure &lt;code&gt;nautilus-lambda&lt;/code&gt; is present and using the Python runtime.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Execution:&lt;/strong&gt; Run a test event to confirm the output.&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%2Fdqwbp9znr5y5obat7du1.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%2Fdqwbp9znr5y5obat7du1.jpg" alt=" " width="800" height="305"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase D: Confirming Output
&lt;/h3&gt;

&lt;p&gt;The final test is ensuring the logic matches the requirement perfectly.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Status:&lt;/strong&gt; 200&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Body:&lt;/strong&gt; "Welcome to KKE AWS Labs!"&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%2Fh2zyrf8r623h4qchn3m8.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%2Fh2zyrf8r623h4qchn3m8.jpg" alt=" " width="800" height="578"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stack Identity:&lt;/strong&gt; The stack &lt;code&gt;nautilus-lambda-app&lt;/code&gt; shows &lt;code&gt;CREATE_COMPLETE&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Code Integrity:&lt;/strong&gt; The function code exactly matches the requirement message.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security:&lt;/strong&gt; The function is correctly linked to the &lt;code&gt;lambda_execution_role&lt;/code&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%2Fd1f2gbvco13myic6h4xz.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%2Fd1f2gbvco13myic6h4xz.jpg" alt=" " width="800" height="617"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;CAPABILITY_IAM:&lt;/strong&gt; When your template creates roles, AWS requires explicit permission to do so don't miss that checkbox in the console!&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;Inline Limitations:&lt;/strong&gt; &lt;code&gt;ZipFile&lt;/code&gt; is limited to 4096 characters. For larger applications, you should upload your code to S3 first.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Handler Mapping:&lt;/strong&gt; &lt;code&gt;index.lambda_handler&lt;/code&gt; tells AWS to look for a function called &lt;code&gt;lambda_handler&lt;/code&gt; inside a virtual file named &lt;code&gt;index.py&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;YAML Indentation:&lt;/strong&gt; A single misplaced space in the &lt;code&gt;ZipFile&lt;/code&gt; block will cause the Python code to fail with a &lt;code&gt;SyntaxError&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trust Policy Missing:&lt;/strong&gt; If the IAM role doesn't have a Trust Relationship with &lt;code&gt;lambda.amazonaws.com&lt;/code&gt;, the function will not launch.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Case Sensitivity:&lt;/strong&gt; Ensure the stack name and function name exactly match the requirements, as AWS is case-sensitive.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Building serverless apps through CloudFormation is the bridge between development and production. It ensures your infrastructure is as professional as your code. You've now successfully automated the deployment of a secure, functional AWS Lambda environment!&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;Want to master Infrastructure as Code? Sharpen your skills here:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>lambda</category>
      <category>cloudformation</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>📜 AWS 147: Infrastructure as Code - Priority Queuing with SNS, SQS, and CloudFormation</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Tue, 27 Jan 2026 05:50:57 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-147-infrastructure-as-code-priority-queuing-with-sns-sqs-and-cloudformation-4eko</link>
      <guid>https://dev.to/hritikraj8804/aws-147-infrastructure-as-code-priority-queuing-with-sns-sqs-and-cloudformation-4eko</guid>
      <description>&lt;h1&gt;
  
  
  🏗️ Automated Priorities: Deploying SQS &amp;amp; SNS with CloudFormation
&lt;/h1&gt;

&lt;p&gt;Hey Cloud Architects 👋&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%2F6ylq1osxc7hfgf60y4nk.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%2F6ylq1osxc7hfgf60y4nk.jpg" alt="Cloud Automation" width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 47 of the #100DaysOfCloud Challenge&lt;/strong&gt;! &lt;br&gt;
Today, we are moving away from manual console configuration and embracing &lt;strong&gt;Infrastructure as Code (IaC)&lt;/strong&gt;. The Nautilus DevOps team needs a reliable priority queuing system where "High Priority" messages are processed before "Low Priority" ones. We'll be using &lt;strong&gt;AWS CloudFormation&lt;/strong&gt; to deploy an entire stack consisting of SNS, multiple SQS queues, and a Lambda consumer.&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%2Frws5eajmrlxmkzoenyqh.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%2Frws5eajmrlxmkzoenyqh.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, which is essential for mastering automated resource provisioning.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Author a CloudFormation template (&lt;code&gt;nautilus-priority-stack.yml&lt;/code&gt;) to define the infrastructure.&lt;/li&gt;
&lt;li&gt;Provision two SQS queues: &lt;code&gt;nautilus-High-Priority-Queue&lt;/code&gt; and &lt;code&gt;nautilus-Low-Priority-Queue&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Create an SNS Topic to act as the message dispatcher.&lt;/li&gt;
&lt;li&gt;Deploy a Lambda function with an IAM role (&lt;code&gt;lambda_execution_role&lt;/code&gt;) to consume and process messages.&lt;/li&gt;
&lt;li&gt;Verify the priority logic by publishing attributed messages via the AWS CLI.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why Priority Queuing?
&lt;/h2&gt;

&lt;p&gt;In production, not all data is created equal. Some messages (like payment processing) must be handled immediately, while others (like weekly reports) can wait. By using SNS message attributes and SQS subscriptions, we can route urgent data to a dedicated "Fast Track" queue.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;CloudFormation Stack:&lt;/strong&gt; A single unit of management for a collection of AWS resources defined in a YAML or JSON template.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SNS Subscription Filter Policies:&lt;/strong&gt; The logic that tells SNS: "Only send messages with the attribute &lt;code&gt;priority: high&lt;/code&gt; to this specific queue."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lambda Trigger:&lt;/strong&gt; The mechanism that automatically invokes our function as soon as a message lands in either queue.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: IaC Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: Authoring the Template
&lt;/h3&gt;

&lt;p&gt;We define our resources in the &lt;code&gt;nautilus-priority-stack.yml&lt;/code&gt; file. This includes the SQS queues, the SNS topic, and the subscription logic that separates the "High" from the "Low" priority traffic.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Template Path:&lt;/strong&gt; &lt;code&gt;/root/nautilus-priority-stack.yml&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Resource Logic:&lt;/strong&gt; Ensure the SNS subscriptions include &lt;code&gt;FilterPolicy&lt;/code&gt; to look for the "priority" attribute.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase B: Deploying the Stack
&lt;/h3&gt;

&lt;p&gt;Once the template is ready, we use the AWS CLI to launch the infrastructure.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Command:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   aws cloudformation create-stack &lt;span class="nt"&gt;--stack-name&lt;/span&gt; nautilus-priority-stack &lt;span class="nt"&gt;--template-body&lt;/span&gt; file:///root/nautilus-priority-stack.yml &lt;span class="nt"&gt;--capabilities&lt;/span&gt; CAPABILITY_NAMED_IAM

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

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Note:&lt;/strong&gt; The &lt;code&gt;CAPABILITY_NAMED_IAM&lt;/code&gt; is required because our template creates a specific IAM role for the Lambda function.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase C: Message Publishing &amp;amp; Testing
&lt;/h3&gt;

&lt;p&gt;With the stack &lt;code&gt;CREATE_COMPLETE&lt;/code&gt;, we publish messages to the SNS topic. We include message attributes so the SNS Filter Policy knows which queue to target.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Publishing High Priority:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws sns publish &lt;span class="nt"&gt;--topic-arn&lt;/span&gt; &lt;span class="nv"&gt;$topicarn&lt;/span&gt; &lt;span class="nt"&gt;--message&lt;/span&gt; &lt;span class="s1"&gt;'High Priority message'&lt;/span&gt; &lt;span class="nt"&gt;--message-attributes&lt;/span&gt; &lt;span class="s1"&gt;'{"priority" : { "DataType":"String", "StringValue":"high"}}'&lt;/span&gt;

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

&lt;/div&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%2Fu05js2i5kqmq8img0fql.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%2Fu05js2i5kqmq8img0fql.jpg" alt=" " width="800" height="584"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Publishing Low Priority:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws sns publish &lt;span class="nt"&gt;--topic-arn&lt;/span&gt; &lt;span class="nv"&gt;$topicarn&lt;/span&gt; &lt;span class="nt"&gt;--message&lt;/span&gt; &lt;span class="s1"&gt;'Low Priority message'&lt;/span&gt; &lt;span class="nt"&gt;--message-attributes&lt;/span&gt; &lt;span class="s1"&gt;'{"priority" : { "DataType":"String", "StringValue":"low"}}'&lt;/span&gt;

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

&lt;/div&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%2F5lvu2b1tqpkymskz85i3.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%2F5lvu2b1tqpkymskz85i3.jpg" alt=" " width="800" height="675"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase D: Verification
&lt;/h3&gt;

&lt;p&gt;The final step is observing the Lambda function's behavior.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Log Inspection:&lt;/strong&gt; Check CloudWatch Logs for the &lt;code&gt;nautilus-priorities-queue-function&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Verification:&lt;/strong&gt; Confirm that the high-priority messages appear in the logs processed before the low-priority ones, validating our routing and processing order.&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%2F78a58t7amck9v7s6vot8.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%2F78a58t7amck9v7s6vot8.jpg" alt=" " width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Stack Status:&lt;/strong&gt; &lt;code&gt;nautilus-priority-stack&lt;/code&gt; is in the &lt;code&gt;CREATE_COMPLETE&lt;/code&gt; state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Routing:&lt;/strong&gt; Messages are successfully filtered into the correct queues based on their attributes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Processing:&lt;/strong&gt; The Lambda function successfully consumes from both queues using its IAM permissions.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;Repeatability:&lt;/strong&gt; If we need to deploy this in another region, we just run the CloudFormation template again—no manual clicking required.&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;Granular Filtering:&lt;/strong&gt; SNS Filter Policies are incredibly powerful for decoupled architectures, reducing the amount of "junk" data a Lambda has to parse.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;IAM Lifecycle:&lt;/strong&gt; By including the IAM role in the stack, the permissions are created and destroyed alongside the infrastructure, preventing "zombie" roles.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Missing Capabilities Flag:&lt;/strong&gt; Forgetting &lt;code&gt;--capabilities CAPABILITY_NAMED_IAM&lt;/code&gt; will cause the stack creation to fail immediately.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Incorrect ARN Reference:&lt;/strong&gt; Hardcoding ARNs in the template instead of using &lt;code&gt;!Ref&lt;/code&gt; or &lt;code&gt;!GetAtt&lt;/code&gt; makes the template less portable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attribute Mismatch:&lt;/strong&gt; If the &lt;code&gt;StringValue&lt;/code&gt; in your publish command doesn't exactly match the &lt;code&gt;FilterPolicy&lt;/code&gt; in the template (case sensitivity matters!), the message will be dropped or ignored.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Infrastructure as Code is the standard for modern DevOps. By mastering CloudFormation, you've moved from "Cloud Admin" to "Cloud Engineer." You now have the power to deploy complex, secure, and filtered messaging systems with a single command.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;Want to master AWS CloudFormation? Get hands-on experience here:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>cloudformation</category>
      <category>sqs</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>⚡ AWS 146: Event-Driven Automation - Syncing S3 Buckets with Lambda &amp; DynamoDB</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Mon, 26 Jan 2026 13:51:06 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-146-event-driven-automation-syncing-s3-buckets-with-lambda-dynamodb-5df6</link>
      <guid>https://dev.to/hritikraj8804/aws-146-event-driven-automation-syncing-s3-buckets-with-lambda-dynamodb-5df6</guid>
      <description>&lt;h1&gt;
  
  
  🚀 Serverless Sync: Automating File Transfers with AWS Lambda
&lt;/h1&gt;

&lt;p&gt;Hey Cloud Architects 👋&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%2F6ylq1osxc7hfgf60y4nk.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%2F6ylq1osxc7hfgf60y4nk.jpg" alt="Serverless Automation" width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 46 of the #100DaysOfCloud Challenge&lt;/strong&gt;! &lt;br&gt;
Today, we are moving into advanced serverless workflows. The Nautilus DevOps team needs to automate file management between a public upload bucket and a secure private storage bucket. We are implementing an event-driven solution where an upload to S3 triggers a &lt;strong&gt;Lambda function&lt;/strong&gt; to copy the file and log the entire transaction into &lt;strong&gt;DynamoDB&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frws5eajmrlxmkzoenyqh.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%2Frws5eajmrlxmkzoenyqh.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, perfect for mastering serverless integration and IAM roles.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Provision a public upload bucket (&lt;code&gt;xfusion-public-27433&lt;/code&gt;) and a private storage bucket (&lt;code&gt;xfusion-private-26642&lt;/code&gt;).&lt;/li&gt;
&lt;li&gt;Create a DynamoDB table named &lt;code&gt;xfusion-S3CopyLogs&lt;/code&gt; for auditing.&lt;/li&gt;
&lt;li&gt;Configure an IAM Role (&lt;code&gt;lambda_execution_role&lt;/code&gt;) with permissions for S3, DynamoDB, and CloudWatch.&lt;/li&gt;
&lt;li&gt;Deploy a Lambda function (&lt;code&gt;xfusion-copyfunction&lt;/code&gt;) to handle the copy logic and metadata logging.&lt;/li&gt;
&lt;li&gt;Verify the automated workflow by uploading &lt;code&gt;sample.zip&lt;/code&gt; and checking the logs.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 The Power of Event-Driven Design
&lt;/h2&gt;

&lt;p&gt;In an event-driven system, code only runs when something happens (like a file upload). This is highly cost-effective and scalable because you aren't paying for idle servers you only pay for the few milliseconds the Lambda function runs.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;S3 Event Notifications:&lt;/strong&gt; A feature that detects uploads and sends a signal (JSON event) to Lambda.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Lambda Execution Role:&lt;/strong&gt; A set of permissions that allows your code to "talk" to other AWS services like S3 and DynamoDB securely.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Boto3 (Python SDK):&lt;/strong&gt; The library used within the Lambda function to interact with AWS resources programmatically.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: Serverless Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: Storage &amp;amp; Database Setup
&lt;/h3&gt;

&lt;p&gt;First, we prepare our data "landing" and "logging" zones.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Public Bucket:&lt;/strong&gt; Create &lt;code&gt;xfusion-public-27433&lt;/code&gt; and ensure public access is enabled.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Private Bucket:&lt;/strong&gt; Create &lt;code&gt;xfusion-private-26642&lt;/code&gt; with all public access blocked.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DynamoDB Table:&lt;/strong&gt; Create &lt;code&gt;xfusion-S3CopyLogs&lt;/code&gt; with a Partition Key named &lt;code&gt;LogID&lt;/code&gt; (String).&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%2Fsyaa6tisszjyh87pzcfy.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%2Fsyaa6tisszjyh87pzcfy.jpg" alt=" " width="616" height="335"&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%2F40ud6af9mnwggtc6talf.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%2F40ud6af9mnwggtc6talf.jpg" alt=" " width="612" height="330"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&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%2Fxekxwbj44hzpiqedbd8c.jpg" alt=" " width="800" height="163"&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔹 Phase B: Identity Management (IAM)
&lt;/h3&gt;

&lt;p&gt;The Lambda function needs permission to read from one bucket and write to another.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create Role:&lt;/strong&gt; Named &lt;code&gt;lambda_execution_role&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attach Policies:&lt;/strong&gt; Add permissions for &lt;code&gt;s3:GetObject&lt;/code&gt; (Public), &lt;code&gt;s3:PutObject&lt;/code&gt; (Private), and &lt;code&gt;dynamodb:PutItem&lt;/code&gt; (Logs). Also, include CloudWatch Logs permissions for troubleshooting.&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%2Fauuzugr5afeqhu889rmc.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%2Fauuzugr5afeqhu889rmc.jpg" alt=" " width="762" height="545"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase C: Lambda Function Deployment
&lt;/h3&gt;

&lt;p&gt;Now, we deploy the logic that bridges the two buckets.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Function Name:&lt;/strong&gt; &lt;code&gt;xfusion-copyfunction&lt;/code&gt; (Python).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration:&lt;/strong&gt; Replace the placeholders in the &lt;code&gt;lambda-function.py&lt;/code&gt; script with your specific private bucket name and DynamoDB table name.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trigger:&lt;/strong&gt; Add an S3 trigger to the &lt;code&gt;xfusion-public-27433&lt;/code&gt; bucket for the "All object create events" type.&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%2F9ne3hd1we1fvd5loles2.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%2F9ne3hd1we1fvd5loles2.jpg" alt=" " width="800" height="233"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase D: Testing &amp;amp; Verification
&lt;/h3&gt;

&lt;p&gt;With the infrastructure live, it’s time to test the automation.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Upload:&lt;/strong&gt; Use the CLI or console to upload &lt;code&gt;sample.zip&lt;/code&gt; to the public bucket.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;S3 Check:&lt;/strong&gt; Navigate to the private bucket to confirm &lt;code&gt;sample.zip&lt;/code&gt; has appeared.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;DynamoDB Check:&lt;/strong&gt; View the &lt;code&gt;xfusion-S3CopyLogs&lt;/code&gt; items to verify a log entry exists with the source, destination, and object key.&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%2F235hr19y7z4710dt1h9h.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%2F235hr19y7z4710dt1h9h.jpg" alt=" " width="507" height="97"&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%2Fuue7leudbavc74hz64us.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%2Fuue7leudbavc74hz64us.jpg" alt=" " width="800" height="226"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&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%2F38nzlnw5a5717jab2q34.jpg" alt=" " width="705" height="387"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Automation:&lt;/strong&gt; The file appeared in the private bucket without any manual move command.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Auditing:&lt;/strong&gt; A new entry in DynamoDB accurately reflects the transfer details.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permissions:&lt;/strong&gt; The Lambda function successfully assumed the &lt;code&gt;lambda_execution_role&lt;/code&gt; to perform the task.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&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%2Fxlv02c4yfpg1p08p6b0o.jpg" alt=" " width="461" height="168"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;Zero Server Management:&lt;/strong&gt; Everything we built today is serverless; AWS handles the underlying scaling and availability.&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;Principle of Least Privilege:&lt;/strong&gt; By creating a custom IAM role, we ensured the Lambda function only has access to exactly what it needs and nothing more.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Visibility:&lt;/strong&gt; Logging to DynamoDB provides a persistent audit trail that is much easier to query than raw CloudWatch logs.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Circular Triggers:&lt;/strong&gt; Never set a Lambda to trigger on a bucket it writes to, or you will create an infinite loop and a massive AWS bill!&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing Placeholder Update:&lt;/strong&gt; Forgetting to update the Python script with your actual bucket and table names will cause the Lambda to fail with a "ResourceNotFound" error.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IAM Policy Delay:&lt;/strong&gt; Sometimes it takes a minute for new IAM permissions to propagate; if your first test fails, wait 60 seconds and try again.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;This project is a perfect example of how serverless components can be stitched together to solve complex business problems. You’ve just built an automated, secure, and auditable data pipeline that forms the core of many modern enterprise applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;Want to master serverless architectures? Sharpen your skills here:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>lambda</category>
      <category>s3</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>🌐 AWS 145: Private Subnet Internet Access - Implementing NAT Gateways</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Sun, 25 Jan 2026 04:31:26 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-145-private-subnet-internet-access-implementing-nat-gateways-1e0a</link>
      <guid>https://dev.to/hritikraj8804/aws-145-private-subnet-internet-access-implementing-nat-gateways-1e0a</guid>
      <description>&lt;h1&gt;
  
  
  🚀 Bridge to the Cloud: Enabling Secure Outbound Traffic with NAT Gateway
&lt;/h1&gt;

&lt;p&gt;Hey Cloud Architects 👋&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%2F6ylq1osxc7hfgf60y4nk.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%2F6ylq1osxc7hfgf60y4nk.jpg" alt="AWS Networking" width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 45 of the #100DaysOfCloud Challenge&lt;/strong&gt;! &lt;br&gt;
Today, we are solving a classic networking puzzle. The Nautilus DevOps team has an EC2 instance isolated in a private subnet. It needs to upload data to an S3 bucket, but it has no path to the internet. Our job is to build the "bridge" a &lt;strong&gt;NAT Gateway&lt;/strong&gt; to allow secure, one-way outbound communication.&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%2Frws5eajmrlxmkzoenyqh.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%2Frws5eajmrlxmkzoenyqh.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, which is perfect for mastering VPC routing and connectivity.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Provision a Public Subnet and an Internet Gateway (IGW) for the VPC.&lt;/li&gt;
&lt;li&gt;Create a Public Route Table to enable external connectivity for the NAT Gateway.&lt;/li&gt;
&lt;li&gt;Deploy a NAT Gateway with an Elastic IP in the public subnet.&lt;/li&gt;
&lt;li&gt;Configure the Private Route Table to point all outbound traffic (&lt;code&gt;0.0.0.0/0&lt;/code&gt;) to the NAT Gateway.&lt;/li&gt;
&lt;li&gt;Verify success by checking the S3 bucket &lt;code&gt;nautilus-nat-18582&lt;/code&gt; for the automated upload.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why Private Subnets Need NAT
&lt;/h2&gt;

&lt;p&gt;A private subnet has no direct route to an Internet Gateway. To allow instances to reach the internet (for patches or S3 uploads) while staying hidden from hackers, we use a NAT (Network Address Translation) Gateway. It acts as a middleman that sends requests on behalf of the private instance.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Internet Gateway (IGW):&lt;/strong&gt; The VPC's gate to the public internet.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NAT Gateway:&lt;/strong&gt; Lives in a public subnet and allows private instances to connect to the internet but prevents the internet from initiating a connection with those instances.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Elastic IP (EIP):&lt;/strong&gt; A static, public IPv4 address required by the NAT Gateway so it can be identified on the web.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Route Tables:&lt;/strong&gt; The "GPS" of your VPC that tells packets where to go based on their destination IP.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: Connectivity Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: Establishing the Public Infrastructure
&lt;/h3&gt;

&lt;p&gt;For a NAT Gateway to work, it must reside in a subnet that has a direct path to an Internet Gateway.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create Public Subnet:&lt;/strong&gt; Name it &lt;code&gt;nautilus-pub-subnet&lt;/code&gt; within the &lt;code&gt;nautilus-priv-vpc&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Internet Gateway:&lt;/strong&gt; Create a new IGW and attach it to your VPC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public Route Table:&lt;/strong&gt; Create &lt;code&gt;nautilus-pub-rt&lt;/code&gt;, add a route for &lt;code&gt;0.0.0.0/0&lt;/code&gt; targeting the Internet Gateway, and associate it with &lt;code&gt;nautilus-pub-subnet&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase B: Deploying the NAT Gateway
&lt;/h3&gt;

&lt;p&gt;Now we set up the translation service that the private subnet will use.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Allocate Elastic IP:&lt;/strong&gt; Request a new EIP from the Amazon pool.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Create NAT Gateway:&lt;/strong&gt; Name it &lt;code&gt;nautilus-natgw&lt;/code&gt;, place it in the &lt;code&gt;nautilus-pub-subnet&lt;/code&gt;, and associate it with the EIP you just allocated.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase C: Updating the Private Route
&lt;/h3&gt;

&lt;p&gt;This is the "handshake" that connects the private instance to the new gateway.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Modify Private RT:&lt;/strong&gt; Locate the route table associated with &lt;code&gt;nautilus-priv-subnet&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Add Route:&lt;/strong&gt; Add a destination for &lt;code&gt;0.0.0.0/0&lt;/code&gt; (all internet traffic) and select &lt;strong&gt;NAT Gateway&lt;/strong&gt; as the target, picking the &lt;code&gt;nautilus-natgw&lt;/code&gt; you created.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase D: Verification &amp;amp; S3 Check
&lt;/h3&gt;

&lt;p&gt;The EC2 instance has a cron job waiting for this connection.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Wait Period:&lt;/strong&gt; Give the system 2–3 minutes for the NAT Gateway to initialize and the cron job to fire.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;S3 Validation:&lt;/strong&gt; Open the S3 console, navigate to bucket &lt;code&gt;nautilus-nat-18582&lt;/code&gt;, and verify that the test file has been successfully uploaded.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Route Check:&lt;/strong&gt; The private subnet now has a valid path to the internet via the NAT Gateway.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EIP Association:&lt;/strong&gt; The NAT Gateway is correctly mapped to a static public IP.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Flow:&lt;/strong&gt; The presence of the file in S3 confirms that outbound traffic is successfully traversing the VPC.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;Public/Private Balance:&lt;/strong&gt; Always place NAT Gateways in Public subnets; placing them in Private subnets will result in no connectivity.&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;One-Way Traffic:&lt;/strong&gt; NAT Gateways provide a massive security boost because they don't allow "Inbound" connections from the internet to your servers.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Cost Awareness:&lt;/strong&gt; NAT Gateways are billed per hour and per GB of data processed; for large S3 transfers, consider using a &lt;strong&gt;VPC Endpoint&lt;/strong&gt; for S3 to save on data costs!&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Missing IGW:&lt;/strong&gt; If the Public Subnet doesn't have a route to an Internet Gateway, the NAT Gateway will fail to reach the web.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrong Subnet Association:&lt;/strong&gt; Attaching the public route table to the private subnet would make the subnet public, violating security requirements.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;EIP Requirement:&lt;/strong&gt; Forgetting to allocate an Elastic IP NAT Gateways cannot function without a static public identity.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Configuring NAT Gateways is a fundamental skill for securing cloud workloads. By mastering this, you ensure your databases and backend servers stay private and protected while still having the ability to communicate with the outside world when necessary.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;Ready to build your own secure VPC architectures? Practice here:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>networking</category>
      <category>vpc</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>🚀 AWS 144: Scaling for Success - High Availability with ASG and ALB</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Sat, 24 Jan 2026 04:03:20 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-144-scaling-for-success-high-availability-with-asg-and-alb-2l9p</link>
      <guid>https://dev.to/hritikraj8804/aws-144-scaling-for-success-high-availability-with-asg-and-alb-2l9p</guid>
      <description>&lt;h1&gt;
  
  
  🌐 Building Resilience: Auto Scaling and Load Balancing in AWS
&lt;/h1&gt;

&lt;p&gt;Hey Cloud Architects 👋&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%2F6ylq1osxc7hfgf60y4nk.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%2F6ylq1osxc7hfgf60y4nk.jpg" alt="AWS Architecture" width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 44 of the #100DaysOfCloud Challenge&lt;/strong&gt;! &lt;br&gt;
Today, we are moving into the realm of &lt;strong&gt;High Availability (HA)&lt;/strong&gt;. No more single-point-of-failure servers! We are setting up a self-healing infrastructure where an &lt;strong&gt;Application Load Balancer (ALB)&lt;/strong&gt; distributes traffic and an &lt;strong&gt;Auto Scaling Group (ASG)&lt;/strong&gt; monitors our server health and CPU load to scale up or down automatically.&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%2Frws5eajmrlxmkzoenyqh.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%2Frws5eajmrlxmkzoenyqh.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, focusing on real-world infrastructure scaling.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create a Launch Template with a &lt;strong&gt;User Data script&lt;/strong&gt; to auto-install Nginx.&lt;/li&gt;
&lt;li&gt;Provision an Application Load Balancer (ALB) with a dedicated Target Group.&lt;/li&gt;
&lt;li&gt;Configure an Auto Scaling Group (ASG) with a &lt;strong&gt;Target Tracking Policy&lt;/strong&gt; (50% CPU).&lt;/li&gt;
&lt;li&gt;Verify end-to-end traffic flow from the ALB DNS to the Nginx instances.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 The Power of Elasticity
&lt;/h2&gt;

&lt;p&gt;Elasticity is the ability to grow or shrink infrastructure resources dynamically. By using ASG and ALB, we ensure that if a server dies, a new one takes its place, and if traffic surges, we add more capacity instantly.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Launch Template:&lt;/strong&gt; A blueprint for your instances (AMI, Instance Type, User Data).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target Group:&lt;/strong&gt; A logical grouping of EC2 instances that receive traffic from the Load Balancer.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Health Checks:&lt;/strong&gt; The ALB periodically pings instances; if one fails, it stops sending traffic and the ASG replaces it.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target Tracking Policy:&lt;/strong&gt; Scales the group based on a specific metric (like maintaining an average 50% CPU utilization).&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: Infrastructure Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: Create the Launch Template
&lt;/h3&gt;

&lt;p&gt;The Launch Template defines &lt;em&gt;what&lt;/em&gt; we are launching.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Name:&lt;/strong&gt; &lt;code&gt;devops-launch-template&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AMI:&lt;/strong&gt; Amazon Linux 2.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Instance Type:&lt;/strong&gt; &lt;code&gt;t2.micro&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Group:&lt;/strong&gt; Allow HTTP (Port 80) from anywhere.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;User Data:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;  &lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
  amazon-linux-extras &lt;span class="nb"&gt;install &lt;/span&gt;nginx1 &lt;span class="nt"&gt;-y&lt;/span&gt;
  systemctl start nginx
  systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2Fia96667uvskuum6028th.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%2Fia96667uvskuum6028th.jpg" alt=" " width="800" height="617"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase B: Load Balancer &amp;amp; Target Group Setup
&lt;/h3&gt;

&lt;p&gt;The ALB acts as the "front door" for all incoming traffic.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Target Group:&lt;/strong&gt; Create &lt;code&gt;devops-tg&lt;/code&gt; (Target type: Instances, Port 80).&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%2Fn2aqojy2wznv5bmp5vv5.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%2Fn2aqojy2wznv5bmp5vv5.jpg" alt=" " width="732" height="710"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Load Balancer:&lt;/strong&gt; Create &lt;code&gt;devops-alb&lt;/code&gt; (Application Load Balancer).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Listeners:&lt;/strong&gt; HTTP on Port 80, forwarding to &lt;code&gt;devops-tg&lt;/code&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Subnets:&lt;/strong&gt; Select at least two Public Subnets in different AZs.&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%2Fdcxbsmymcc6b8za3tqda.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%2Fdcxbsmymcc6b8za3tqda.jpg" alt=" " width="708" height="743"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase C: Auto Scaling Group Configuration
&lt;/h3&gt;

&lt;p&gt;The ASG manages the &lt;em&gt;number&lt;/em&gt; of instances running.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Name:&lt;/strong&gt; &lt;code&gt;devops-asg&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Launch Template:&lt;/strong&gt; &lt;code&gt;devops-launch-template&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Group Size:&lt;/strong&gt; * Desired: 1&lt;/li&gt;
&lt;li&gt;Minimum: 1&lt;/li&gt;
&lt;li&gt;Maximum: 2&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scaling Policy:&lt;/strong&gt; Target Tracking (Metric: Average CPU Utilization, Target: 50%).&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Integration:&lt;/strong&gt; Attach to the existing Load Balancer Target Group &lt;code&gt;devops-tg&lt;/code&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%2F5oyew01sa9jgm1h4d5q6.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%2F5oyew01sa9jgm1h4d5q6.jpg" alt=" " width="800" height="661"&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%2Fw4pljf0op18gxcra9tms.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%2Fw4pljf0op18gxcra9tms.jpg" alt=" " width="715" height="748"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase D: Verification
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;ALB DNS:&lt;/strong&gt; Copy the DNS Name of &lt;code&gt;devops-alb&lt;/code&gt; from the console.&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Browser Test:&lt;/strong&gt; Paste the DNS into your browser. If you see the "Welcome to nginx!" page, the traffic is successfully passing through the ALB to your ASG-managed instance.&lt;/p&gt;
&lt;h2&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%2F1qttxa2cijet91ae5k4a.jpg" alt=" " width="760" height="437"&gt;
&lt;/h2&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Auto Scaling:&lt;/strong&gt; Ensure at least 1 instance is in "InService" state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Target Group Health:&lt;/strong&gt; Check the &lt;code&gt;devops-tg&lt;/code&gt; targets tab to see the instance marked as &lt;code&gt;Healthy&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;URL Accessibility:&lt;/strong&gt; The ALB DNS resolves correctly to the Nginx landing page.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;User Data Automation:&lt;/strong&gt; Bootstrapping Nginx via script ensures every new instance scaled by ASG is ready to serve traffic immediately.&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;Cross-AZ Availability:&lt;/strong&gt; Distributing the ALB across multiple AZs ensures the Load Balancer itself remains available even if one AZ goes down.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Metric Scaling:&lt;/strong&gt; Target tracking policies are much easier to manage than manual step scaling policies.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Missing User Data:&lt;/strong&gt; If you forget the script, the instances will launch, but the ALB health check will fail because Nginx isn't running.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Security Group Conflict:&lt;/strong&gt; Ensure the EC2 Security Group allows traffic &lt;em&gt;from&lt;/em&gt; the ALB Security Group.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Single Subnet ALB:&lt;/strong&gt; AWS requires at least two subnets in different availability zones for an ALB.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;By integrating ASG and ALB, you have built a system that is not only scalable but also highly resilient. This architecture is the foundation of modern production environments, ensuring a seamless experience for users regardless of traffic load or server health.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;Ready to build your own elastic architectures? Practice here:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>ec2</category>
      <category>loadbalancer</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>☸️ AWS 143: Enterprise Kubernetes - Provisioning a Private Amazon EKS Cluster</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Fri, 23 Jan 2026 04:00:33 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-143-enterprise-kubernetes-provisioning-a-private-amazon-eks-cluster-3nn7</link>
      <guid>https://dev.to/hritikraj8804/aws-143-enterprise-kubernetes-provisioning-a-private-amazon-eks-cluster-3nn7</guid>
      <description>&lt;h1&gt;
  
  
  🏗️ Production-Ready K8s: Building the xfusion-eks Cluster
&lt;/h1&gt;

&lt;p&gt;Hey Cloud Architects 👋&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%2F6ylq1osxc7hfgf60y4nk.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%2F6ylq1osxc7hfgf60y4nk.jpg" alt="AWS EKS" width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 43 of the #100DaysOfCloud Challenge&lt;/strong&gt;! &lt;br&gt;
Today, we are tackling one of the most powerful services in the AWS ecosystem: &lt;strong&gt;Amazon EKS&lt;/strong&gt;. The Nautilus DevOps team is preparing for a new microservices deployment, and they need a cluster that is both highly available and secure. Our mission is to provision a cluster using the latest stable version (1.30) while ensuring the control plane remains completely private.&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%2Frws5eajmrlxmkzoenyqh.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%2Frws5eajmrlxmkzoenyqh.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, which is my go-to for simulating complex infrastructure scenarios.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Create an IAM Role named &lt;code&gt;eksClusterRole&lt;/code&gt; with the necessary trust relationships.&lt;/li&gt;
&lt;li&gt;Provision an EKS cluster named &lt;code&gt;xfusion-eks&lt;/code&gt; using Kubernetes version &lt;strong&gt;1.30&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Configure Networking across three Availability Zones (a, b, and c) for High Availability.&lt;/li&gt;
&lt;li&gt;Restrict access by setting the Cluster Endpoint to &lt;strong&gt;Private&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why Private Endpoints Matter
&lt;/h2&gt;

&lt;p&gt;By default, EKS cluster endpoints are public. By switching to &lt;strong&gt;Private Access&lt;/strong&gt;, the Kubernetes API server is not accessible from the internet. All communication with the cluster must originate from within your VPC or via a connected network (like a VPN or Direct Connect).&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Control Plane:&lt;/strong&gt; The managed Kubernetes API server and etcd database that AWS handles for you.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IAM Cluster Role:&lt;/strong&gt; A specific role that allows the EKS service to manage resources (like ELBs or EC2 instances) on your behalf.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;High Availability (HA):&lt;/strong&gt; Deploying across multiple AZs ensures that even if one data center goes down, your cluster control plane remains operational.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: Infrastructure Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: Identity &amp;amp; Access Management (IAM)
&lt;/h3&gt;

&lt;p&gt;Before creating the cluster, we must define the permissions EKS needs to operate.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create Role:&lt;/strong&gt; Navigate to IAM and create a role named &lt;code&gt;eksClusterRole&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Trusted Entity:&lt;/strong&gt; Select "EKS - Cluster" as the service that will use this role.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Policy:&lt;/strong&gt; Attach the &lt;code&gt;AmazonEKSClusterPolicy&lt;/code&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%2Fnuld6d7muy6n6li307c1.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%2Fnuld6d7muy6n6li307c1.jpg" alt=" " width="697" height="202"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase B: Cluster Configuration
&lt;/h3&gt;

&lt;p&gt;Now, we move to the EKS console to define the cluster's "brain."&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Name:&lt;/strong&gt; &lt;code&gt;xfusion-eks&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Version:&lt;/strong&gt; Select &lt;strong&gt;1.30&lt;/strong&gt; (the latest stable version requested).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service Role:&lt;/strong&gt; Choose the &lt;code&gt;eksClusterRole&lt;/code&gt; we created in Phase A.&lt;/li&gt;
&lt;/ul&gt;




&lt;h3&gt;
  
  
  🔹 Phase C: Networking &amp;amp; Security
&lt;/h3&gt;

&lt;p&gt;This is the most critical phase for meeting the security requirements.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;VPC:&lt;/strong&gt; Select the Default VPC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Subnets:&lt;/strong&gt; Ensure subnets from AZs &lt;strong&gt;us-east-1a&lt;/strong&gt;, &lt;strong&gt;us-east-1b&lt;/strong&gt;, and &lt;strong&gt;us-east-1c&lt;/strong&gt; are selected.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  * &lt;strong&gt;Cluster Endpoint Access:&lt;/strong&gt; Change the radio button from "Public" to &lt;strong&gt;Private&lt;/strong&gt;.
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔹 Phase D: Verification
&lt;/h3&gt;

&lt;p&gt;EKS clusters take about 10–15 minutes to provision. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Status Check:&lt;/strong&gt; Wait until the cluster status changes from &lt;code&gt;Creating&lt;/code&gt; to &lt;code&gt;Active&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration Audit:&lt;/strong&gt; Click on the "Networking" tab to verify the endpoint access is indeed set to "Private" and that all three AZs are listed.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&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%2F1mgowhkrj0jiymc4abeu.jpg" alt=" " width="412" height="226"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cluster Identity:&lt;/strong&gt; The cluster is named &lt;code&gt;xfusion-eks&lt;/code&gt; and running K8s version 1.30.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Role Association:&lt;/strong&gt; The cluster successfully assumed the &lt;code&gt;eksClusterRole&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Zero Exposure:&lt;/strong&gt; The API server has no public URL, confirming the private configuration.&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%2Fpjfcf7f3bptd6he7htsp.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%2Fpjfcf7f3bptd6he7htsp.jpg" alt=" " width="470" height="93"&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%2Fuscndcgvbbz09kcs10pq.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%2Fuscndcgvbbz09kcs10pq.jpg" alt=" " width="800" height="440"&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%2F6iwt1z2zgky9trwivfep.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%2F6iwt1z2zgky9trwivfep.jpg" alt=" " width="800" height="303"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;Version Stability:&lt;/strong&gt; Always use the latest stable version supported by EKS for the best security patches.&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;Network Isolation:&lt;/strong&gt; Private endpoints are the standard for financial and healthcare sectors to meet compliance.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;IAM Dependencies:&lt;/strong&gt; EKS cannot start without its service role. Always verify the trust relationship if the cluster fails to create.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Public Access Enabled:&lt;/strong&gt; Forgetting to toggle the "Private" endpoint setting exposes your API server to the web.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Missing AZs:&lt;/strong&gt; Selecting only one AZ removes the High Availability benefit of a managed service.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Role Permissions:&lt;/strong&gt; Using a standard EC2 role instead of an EKS Service Role will cause the cluster creation to hang.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;You've just provisioned a production-grade Kubernetes control plane! While the setup today was done via the console, these same parameters form the basis of automated Infrastructure as Code (IaC) using Terraform or AWS CDK.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;Sharpen your Kubernetes skills in a real-world sandbox:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>eks</category>
      <category>kubernetes</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>🗄️ AWS 142: Serverless Databases - Managing Tasks with Amazon DynamoDB</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Thu, 22 Jan 2026 04:15:23 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-142-serverless-databases-managing-tasks-with-amazon-dynamodb-2gh0</link>
      <guid>https://dev.to/hritikraj8804/aws-142-serverless-databases-managing-tasks-with-amazon-dynamodb-2gh0</guid>
      <description>&lt;h1&gt;
  
  
  ⚡ Fast &amp;amp; Flexible: Building a To-Do Backend with DynamoDB
&lt;/h1&gt;

&lt;p&gt;Hey Cloud Architects 👋&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%2F6ylq1osxc7hfgf60y4nk.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%2F6ylq1osxc7hfgf60y4nk.jpg" alt="AWS DynamoDB" width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 42 of the #100DaysOfCloud Challenge&lt;/strong&gt;! &lt;br&gt;
Today, we are stepping away from traditional relational databases and exploring the world of &lt;strong&gt;NoSQL&lt;/strong&gt;. The Nautilus DevOps team is building a 'To-Do' application, and we need a storage solution that is both fast and schema-flexible. We'll be using &lt;strong&gt;Amazon DynamoDB&lt;/strong&gt; to store and manage our tasks.&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%2Frws5eajmrlxmkzoenyqh.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%2Frws5eajmrlxmkzoenyqh.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, which is perfect for mastering AWS managed services.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Provision a DynamoDB table named &lt;code&gt;xfusion-tasks&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Define a Primary Key (&lt;code&gt;taskId&lt;/code&gt;) as a String.&lt;/li&gt;
&lt;li&gt;Manually insert task items with descriptions and progress statuses.&lt;/li&gt;
&lt;li&gt;Verify the data integrity through the AWS Management Console.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why DynamoDB for Modern Apps?
&lt;/h2&gt;

&lt;p&gt;Amazon DynamoDB is a fully managed NoSQL database service that provides fast and predictable performance with seamless scalability. &lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Partition Key:&lt;/strong&gt; A simple primary key, used by DynamoDB's internal hash function to evenly distribute data across partitions.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Items &amp;amp; Attributes:&lt;/strong&gt; An "Item" is a group of attributes (similar to a row in SQL), and "Attributes" are the fundamental data elements (similar to columns).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Serverless:&lt;/strong&gt; No servers to provision, patch, or manage. You only pay for the storage and throughput you use.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: Database Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: Create the Table
&lt;/h3&gt;

&lt;p&gt;We start by defining our table structure in the DynamoDB console.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Table Name:&lt;/strong&gt; &lt;code&gt;xfusion-tasks&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Partition Key:&lt;/strong&gt; &lt;code&gt;taskId&lt;/code&gt; (Type: String).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Table Settings:&lt;/strong&gt; Keep "Default settings" for this task (Provisioned capacity with free tier limits).&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%2Fx299ekj8yoy5g7nef30m.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%2Fx299ekj8yoy5g7nef30m.jpg" alt=" " width="800" height="633"&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%2Fhvnbs9v8mjxpptjpjdib.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%2Fhvnbs9v8mjxpptjpjdib.jpg" alt=" " width="660" height="321"&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%2Ftpliaexi84ym0123vcqu.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%2Ftpliaexi84ym0123vcqu.jpg" alt=" " width="662" height="306"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase B: Populate the Data
&lt;/h3&gt;

&lt;p&gt;Once the table status is &lt;code&gt;Active&lt;/code&gt;, we navigate to "Explore items" to add our tasks.&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%2F6adyuecsbbknolyrt5ml.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%2F6adyuecsbbknolyrt5ml.jpg" alt=" " width="598" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create Item 1:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;taskId&lt;/code&gt;: &lt;code&gt;1&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;description&lt;/code&gt;: &lt;code&gt;Learn DynamoDB&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;status&lt;/code&gt;: &lt;code&gt;completed&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&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%2F6ad7t9ctoh5rq0v7j9ii.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%2F6ad7t9ctoh5rq0v7j9ii.jpg" alt=" " width="800" height="352"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Create Item 2:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;taskId&lt;/code&gt;: &lt;code&gt;2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;description&lt;/code&gt;: &lt;code&gt;Build To-Do App&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;status&lt;/code&gt;: &lt;code&gt;in-progress&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&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%2F52yss2qcm4az4bcwi2va.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%2F52yss2qcm4az4bcwi2va.jpg" alt=" " width="800" height="346"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase C: Verification
&lt;/h3&gt;

&lt;p&gt;After inserting the items, we must verify they are queryable.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scan/Query:&lt;/strong&gt; In the "Explore items" view, ensure both tasks appear in the results list.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Status Check:&lt;/strong&gt; Confirm that Task 1 is marked as &lt;code&gt;completed&lt;/code&gt; and Task 2 is &lt;code&gt;in-progress&lt;/code&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%2F53n5waorg17h7dlostay.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%2F53n5waorg17h7dlostay.jpg" alt=" " width="582" height="285"&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%2Fzisvyqhj7rmeoqi8swnq.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%2Fzisvyqhj7rmeoqi8swnq.jpg" alt=" " width="618" height="620"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Table Existence:&lt;/strong&gt; The table &lt;code&gt;xfusion-tasks&lt;/code&gt; is listed and active in the AWS region.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Primary Key:&lt;/strong&gt; The schema correctly identifies &lt;code&gt;taskId&lt;/code&gt; as the unique identifier.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Accuracy:&lt;/strong&gt; Both items are present with the exact attributes defined in the requirements.&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%2Fudvvde987fw0uon07bde.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%2Fudvvde987fw0uon07bde.jpg" alt=" " width="800" height="363"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;Schema Flexibility:&lt;/strong&gt; Notice how we didn't have to define "description" or "status" when creating the table only the Primary Key is required!&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;On-Demand vs Provisioned:&lt;/strong&gt; For development, Provisioned (Free Tier) is great, but for unpredictable traffic, On-Demand scaling is a lifesaver.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Data Types:&lt;/strong&gt; Ensure the &lt;code&gt;taskId&lt;/code&gt; type matches (String vs Number) otherwise, application-level queries might fail.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Key Mismatch:&lt;/strong&gt; Trying to insert a task without a &lt;code&gt;taskId&lt;/code&gt; or using the wrong data type (e.g., Number instead of String).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Case Sensitivity:&lt;/strong&gt; DynamoDB is case-sensitive. &lt;code&gt;taskId&lt;/code&gt; is not the same as &lt;code&gt;taskid&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Over-Provisioning:&lt;/strong&gt; Setting Read/Write capacity too high can lead to unnecessary costs in a real-world environment.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;DynamoDB is the go-to choice for serverless architectures. By mastering the console-based setup and item management, you've laid the groundwork for building highly responsive, globally distributed applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;Ready to build your own NoSQL backends? Practice here:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>dynamodb</category>
      <category>nosql</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>🔐 AWS 141: Data Protection at Rest - Mastering AWS KMS for File Encryption</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Wed, 21 Jan 2026 05:00:37 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-141-data-protection-at-rest-mastering-aws-kms-for-file-encryption-217n</link>
      <guid>https://dev.to/hritikraj8804/aws-141-data-protection-at-rest-mastering-aws-kms-for-file-encryption-217n</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%2F6ylq1osxc7hfgf60y4nk.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%2F6ylq1osxc7hfgf60y4nk.jpg" alt="AWS KMS" width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  🛡️ Securing the Vault: Encrypting Data with AWS KMS
&lt;/h1&gt;

&lt;p&gt;Hey Cloud Architects 👋&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 41 of the #100DaysOfCloud Challenge&lt;/strong&gt;! &lt;br&gt;
Today, we are focusing on &lt;strong&gt;Cloud Security&lt;/strong&gt;. The Nautilus DevOps team is prioritizing data integrity, and our mission is to implement a robust encryption workflow using &lt;strong&gt;AWS Key Management Service (KMS)&lt;/strong&gt;. We are ensuring that sensitive files remain unreadable to unauthorized users, even if they gain access to the storage layer.&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%2Frws5eajmrlxmkzoenyqh.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%2Frws5eajmrlxmkzoenyqh.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, which provides excellent real-world scenarios for mastering DevOps security.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Provision a symmetric KMS key named &lt;code&gt;nautilus-KMS-Key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Encrypt a sensitive file (&lt;code&gt;SensitiveData.txt&lt;/code&gt;) located in the &lt;code&gt;/root/&lt;/code&gt; directory.&lt;/li&gt;
&lt;li&gt;Base64 encode the resulting ciphertext and save it as &lt;code&gt;EncryptedData.bin&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Verify the setup by successfully decrypting the file back to its original state.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why KMS is a Game Changer
&lt;/h2&gt;

&lt;p&gt;AWS KMS (Key Management Service) allows you to create and manage cryptographic keys across AWS services and your applications. It uses FIPS 140-2 validated hardware security modules (HSMs) to protect your keys.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Symmetric Encryption:&lt;/strong&gt; Using a single 256-bit secret key for both encryption and decryption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Ciphertext vs. Plaintext:&lt;/strong&gt; Plaintext is your readable data; Ciphertext is the encrypted version that appears as gibberish to anyone without the key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Base64 Encoding:&lt;/strong&gt; This process converts binary data into an ASCII string format, ensuring the encrypted data doesn't get corrupted during transit or storage.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: Security Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: Create the KMS Key
&lt;/h3&gt;

&lt;p&gt;First, we generate the master key that will handle our cryptographic operations.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Key Type:&lt;/strong&gt; Symmetric.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Alias:&lt;/strong&gt; &lt;code&gt;nautilus-KMS-Key&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Configuration:&lt;/strong&gt; Ensure the IAM user has the necessary permissions to use this key for encryption and decryption.&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%2Fw87lw22a1eyb1g0tq6xi.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%2Fw87lw22a1eyb1g0tq6xi.jpg" alt=" " width="800" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&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%2Fv1eoz60vrkukko6fkvv6.jpg" alt=" " width="800" height="60"&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔹 Phase B: Encrypt and Encode
&lt;/h3&gt;

&lt;p&gt;We use the AWS CLI to perform the encryption. The &lt;code&gt;--plaintext&lt;/code&gt; flag requires the &lt;code&gt;fileb://&lt;/code&gt; prefix to handle the file as binary.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Perform Encryption:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;   aws kms encrypt &lt;span class="nt"&gt;--key-id&lt;/span&gt; &lt;span class="nb"&gt;alias&lt;/span&gt;/nautilus-KMS-Key &lt;span class="nt"&gt;--plaintext&lt;/span&gt; fileb:///root/SensitiveData.txt &lt;span class="nt"&gt;--output&lt;/span&gt; text &lt;span class="nt"&gt;--query&lt;/span&gt; CiphertextBlob &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; /root/EncryptedData.bin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F4uwcrznce75y0ut3hzu6.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%2F4uwcrznce75y0ut3hzu6.jpg" alt=" " width="783" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: The output is redirected to &lt;code&gt;EncryptedData.bin&lt;/code&gt; as requested.&lt;/em&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase C: Verify via Decryption
&lt;/h3&gt;

&lt;p&gt;To confirm the encryption worked correctly, we must be able to reverse it.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Decrypt the File:&lt;/strong&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;aws kms decrypt &lt;span class="nt"&gt;--ciphertext-blob&lt;/span&gt; fileb:///root/EncryptedData.bin &lt;span class="nt"&gt;--output&lt;/span&gt; text &lt;span class="nt"&gt;--query&lt;/span&gt; Plaintext | &lt;span class="nb"&gt;base64&lt;/span&gt; &lt;span class="nt"&gt;--decode&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&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%2F4vh3rxfd3j6u29u2xs5u.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%2F4vh3rxfd3j6u29u2xs5u.jpg" alt=" " width="681" height="117"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Comparison:&lt;/strong&gt; If the output matches the content of &lt;code&gt;SensitiveData.txt&lt;/code&gt;, the verification is successful.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&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%2F1wgivq4s9wrbbflffinr.jpg" alt=" " width="756" height="96"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;File Integrity:&lt;/strong&gt; Check that &lt;code&gt;/root/EncryptedData.bin&lt;/code&gt; exists.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Key Configuration:&lt;/strong&gt; Ensure the &lt;code&gt;nautilus-KMS-Key&lt;/code&gt; alias points to the correct Key ID.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Validation:&lt;/strong&gt; The validation script will successfully decrypt the binary file using your created key.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&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%2Fudvvde987fw0uon07bde.jpg" alt=" " width="800" height="363"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;Alias Usage:&lt;/strong&gt; Referencing keys by an Alias (e.g., &lt;code&gt;alias/nautilus-KMS-Key&lt;/code&gt;) is better practice than using hardcoded Key IDs.&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;Binary Input:&lt;/strong&gt; Always use the &lt;code&gt;fileb://&lt;/code&gt; prefix in AWS CLI when dealing with file inputs for encryption to prevent encoding errors.&lt;/li&gt;
&lt;li&gt;📦 &lt;strong&gt;Security Layers:&lt;/strong&gt; Encrypting data at the application or OS level provides an extra layer of defense beyond standard disk encryption.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Missing Alias Prefix:&lt;/strong&gt; Forgetting to add &lt;code&gt;alias/&lt;/code&gt; before the key name in the CLI command.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Permission Issues:&lt;/strong&gt; Not giving the proper Key Policy permissions to the user performing the encryption.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Encoding Errors:&lt;/strong&gt; Failing to base64 decode the plaintext result during manual verification, which results in a garbled string.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Encryption is a pillar of the "Shared Responsibility Model." By implementing AWS KMS for sensitive files, you ensure that Nautilus's data remains protected against unauthorized access. This is a fundamental skill for any security-conscious DevOps Engineer.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;If you want to practice these security tasks in a live environment, check out:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>kms</category>
      <category>encryption</category>
      <category>100daysofcloud</category>
    </item>
    <item>
      <title>🚨 AWS 140: VPC Troubleshooting - Restoring Internet Connectivity</title>
      <dc:creator>Hritik Raj</dc:creator>
      <pubDate>Tue, 20 Jan 2026 09:28:30 +0000</pubDate>
      <link>https://dev.to/hritikraj8804/aws-140-vpc-troubleshooting-restoring-internet-connectivity-n1a</link>
      <guid>https://dev.to/hritikraj8804/aws-140-vpc-troubleshooting-restoring-internet-connectivity-n1a</guid>
      <description>&lt;h1&gt;
  
  
  🛠️ The Missing Link: Resolving VPC Routing and IGW Issues
&lt;/h1&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%2Fma87hy4frldddqhsl2wi.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%2Fma87hy4frldddqhsl2wi.jpg" alt=" " width="617" height="323"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Hey Cloud Builders 👋&lt;/p&gt;

&lt;p&gt;Welcome to &lt;strong&gt;Day 40 of the #100DaysOfCloud Challenge&lt;/strong&gt;!&lt;br&gt;
Today, we are putting on our detective hats. The Nautilus team has an EC2 instance with Nginx installed and Security Groups properly configured, yet it's invisible to the internet. We are deep-diving into the &lt;strong&gt;VPC Networking Stack&lt;/strong&gt; to find and fix the break in the communication chain.&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%2Fqvn9r14nlzv5847p81yw.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%2Fqvn9r14nlzv5847p81yw.png" alt=" " width="800" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This task is part of my hands-on practice on the &lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer&lt;/a&gt; platform, which I highly recommend for anyone looking to master real-world DevOps scenarios.&lt;/p&gt;




&lt;h2&gt;
  
  
  🎯 Objective
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Diagnose why &lt;code&gt;datacenter-ec2&lt;/code&gt; is inaccessible despite correct Security Group settings.&lt;/li&gt;
&lt;li&gt;Verify and attach an &lt;strong&gt;Internet Gateway (IGW)&lt;/strong&gt; to the VPC if missing.&lt;/li&gt;
&lt;li&gt;Update the &lt;strong&gt;Route Table&lt;/strong&gt; to forward external traffic (&lt;code&gt;0.0.0.0/0&lt;/code&gt;) to the IGW.&lt;/li&gt;
&lt;li&gt;Ensure the instance has a valid &lt;strong&gt;Public IPv4 Address&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Restore public access to the Nginx web server on &lt;strong&gt;Port 80&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  💡 Why VPC Configuration is the Backbone
&lt;/h2&gt;

&lt;p&gt;You can have the best security rules in the world, but if the "roads" (routes) aren't built, no traffic will ever arrive at your front door.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔹 Key Concepts
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Internet Gateway (IGW):&lt;/strong&gt; Think of this as the border crossing between your private VPC and the public internet. Without it, your VPC is an island.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Default Route (0.0.0.0/0):&lt;/strong&gt; This route tells the subnet: "If you don't know where a packet is going, send it to the Internet Gateway."&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Public vs. Private Subnets:&lt;/strong&gt; A subnet only becomes "Public" once it has a route entry pointing to an IGW.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🛠️ Step-by-Step: The Troubleshooting Workflow
&lt;/h2&gt;




&lt;h3&gt;
  
  
  🔹 Phase A: Verify and Attach the Internet Gateway
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Check IGWs:&lt;/strong&gt; Navigate to &lt;strong&gt;VPC Dashboard &amp;gt; Internet Gateways&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Attachment:&lt;/strong&gt; Ensure &lt;code&gt;datacenter-igw&lt;/code&gt; is in the &lt;strong&gt;Attached&lt;/strong&gt; state.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The Fix:&lt;/strong&gt; If an IGW exists but is "Detached," select it, click &lt;strong&gt;Actions&lt;/strong&gt;, and choose &lt;strong&gt;Attach to VPC&lt;/strong&gt;, then select &lt;code&gt;datacenter-vpc&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&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%2Fyqwh747kl8efq4m1ep1v.jpg" alt=" " width="742" height="320"&gt;
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🔹 Phase B: Configure the Route Table
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Identify Table:&lt;/strong&gt; Go to &lt;strong&gt;Subnets&lt;/strong&gt;, select the subnet hosting your EC2, and look at the &lt;strong&gt;Route Table&lt;/strong&gt; tab.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Add the Default Route:&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;Click &lt;strong&gt;Edit routes&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Add a route with &lt;strong&gt;Destination:&lt;/strong&gt; &lt;code&gt;0.0.0.0/0&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Set &lt;strong&gt;Target:&lt;/strong&gt; &lt;code&gt;Internet Gateway&lt;/code&gt; and select your attached IGW.&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%2Fdek77x3kigu3jmxwgi78.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%2Fdek77x3kigu3jmxwgi78.jpg" alt=" " width="750" height="482"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  🔹 Phase C: Confirm Public IP and Service
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Instance Settings:&lt;/strong&gt; Verify that &lt;code&gt;datacenter-ec2&lt;/code&gt; actually has a &lt;strong&gt;Public IPv4 address&lt;/strong&gt; assigned in the EC2 Console.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Service Check:&lt;/strong&gt; SSH into the instance and ensure Nginx is active:
&lt;code&gt;sudo systemctl status nginx&lt;/code&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%2Fmhfukv3f1pwycxmv8rif.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%2Fmhfukv3f1pwycxmv8rif.jpg" alt=" " width="800" height="431"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  ✅ Verify Success
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;External Ping:&lt;/strong&gt; Open your browser and type the &lt;strong&gt;Public IP&lt;/strong&gt; of the instance.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Confirm:&lt;/strong&gt; 🎉 If the "Welcome to nginx!" page loads, &lt;strong&gt;mission accomplished&lt;/strong&gt;! You have successfully re-established the network path.&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%2F5dos0hpgv3obb0v7maa2.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%2F5dos0hpgv3obb0v7maa2.jpg" alt=" " width="758" height="410"&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%2Fej18wmmm0p34kfu288co.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%2Fej18wmmm0p34kfu288co.jpg" alt=" " width="800" height="316"&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%2Fw0afkjkulowauw6kh5lv.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%2Fw0afkjkulowauw6kh5lv.jpg" alt=" " width="800" height="252"&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%2Fh4vray6zt1l6fiidppuz.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%2Fh4vray6zt1l6fiidppuz.jpg" alt=" " width="800" height="285"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&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%2Fc9ctl8a67qpqamagy30p.jpg" alt=" " width="795" height="137"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  📝 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;🚀 &lt;strong&gt;Routing Hierarchy:&lt;/strong&gt; Security Groups (Instance level) can only work if the Route Table (Subnet level) allows the traffic through.&lt;/li&gt;
&lt;li&gt;🛡️ &lt;strong&gt;Gateway Dependency:&lt;/strong&gt; A VPC can have multiple subnets, but all public-facing ones must point to the same Internet Gateway.&lt;/li&gt;
&lt;li&gt;🕒 &lt;strong&gt;Instant Effect:&lt;/strong&gt; Once you save the route table change, the connectivity restoration is usually instantaneous.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🚫 Common Mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Missing IGW:&lt;/strong&gt; Creating the gateway but forgetting to "Attach" it to the specific VPC.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Wrong Subnet:&lt;/strong&gt; Updating a route table for a different subnet than the one the EC2 instance is actually using.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NACL Overlap:&lt;/strong&gt; Forgetting that Network ACLs could also be blocking traffic at the subnet boundary.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  🌟 Final Thoughts
&lt;/h2&gt;

&lt;p&gt;Troubleshooting VPC reachability is one of the most common real-world tasks for a DevOps Engineer. By mastering the relationship between IGWs and Route Tables, you ensure your infrastructure is not just built, but actually accessible to your users.&lt;/p&gt;




&lt;h2&gt;
  
  
  🌟 Practice Like a Pro
&lt;/h2&gt;

&lt;p&gt;If you want to try these tasks yourself in a real AWS environment, check out:&lt;br&gt;
👉 &lt;strong&gt;&lt;a href="https://engineer.kodekloud.com/practice" rel="noopener noreferrer"&gt;KodeKloud Engineer - Practice Labs&lt;/a&gt;&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;It’s where I’ve been sharpening my skills daily!&lt;/p&gt;




&lt;h3&gt;
  
  
  🔗 Let’s Connect
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;💬 &lt;strong&gt;LinkedIn:&lt;/strong&gt; &lt;a href="https://www.linkedin.com/in/hritik-raj-8804hr/" rel="noopener noreferrer"&gt;Hritik Raj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;⭐ &lt;strong&gt;Support my journey on GitHub:&lt;/strong&gt; &lt;a href="https://github.com/Hritikraj8804/KodeKloud_Engineer/tree/main/100daysofcloud" rel="noopener noreferrer"&gt;100 Days of Cloud&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>aws</category>
      <category>s3</category>
      <category>webhosting</category>
      <category>100daysofcloud</category>
    </item>
  </channel>
</rss>
