<?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: Deepak Soni</title>
    <description>The latest articles on DEV Community by Deepak Soni (@deepaksonii).</description>
    <link>https://dev.to/deepaksonii</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%2F1731149%2F6680fd6d-37f1-4c7b-8358-d3164f4869f4.jpeg</url>
      <title>DEV Community: Deepak Soni</title>
      <link>https://dev.to/deepaksonii</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/deepaksonii"/>
    <language>en</language>
    <item>
      <title>Building Scalable Web Apps on AWS: My Hands-On Journey with ALBs, ASGs, and Custom VPCs</title>
      <dc:creator>Deepak Soni</dc:creator>
      <pubDate>Thu, 24 Jul 2025 00:46:16 +0000</pubDate>
      <link>https://dev.to/deepaksonii/building-scalable-web-apps-on-aws-my-hands-on-journey-with-albs-asgs-and-custom-vpcs-58p7</link>
      <guid>https://dev.to/deepaksonii/building-scalable-web-apps-on-aws-my-hands-on-journey-with-albs-asgs-and-custom-vpcs-58p7</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Posted at 5 AM, after another late-night deep dive into the cloud.&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After learning from a painful mistake last night (read my previous post if you're curious), I promised myself to rebuild everything from scratch today, this time the &lt;strong&gt;right&lt;/strong&gt; way.&lt;/p&gt;

&lt;p&gt;And I did. I combined my learnings from the past two days: &lt;strong&gt;Application Load Balancers&lt;/strong&gt; and &lt;strong&gt;Auto Scaling Groups&lt;/strong&gt; into one working mini project.&lt;/p&gt;

&lt;h2&gt;
  
  
  🛠️ What I Built
&lt;/h2&gt;

&lt;p&gt;To keep it structured, here’s what the setup looked like:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;VPC Setup&lt;/strong&gt;: Created a custom VPC with &lt;strong&gt;3 public and 3 private subnets&lt;/strong&gt; (spread across multiple Availability Zones for high availability).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Internet &amp;amp; NAT Gateways&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Attached an &lt;strong&gt;Internet Gateway (IGW)&lt;/strong&gt; to allow public access to public subnets.&lt;/li&gt;
&lt;li&gt;Deployed &lt;strong&gt;one NAT Gateway per public subnet&lt;/strong&gt; to route internet traffic for the private subnets securely.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Routing &amp;amp; Security&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Created &lt;strong&gt;Route Tables&lt;/strong&gt; and associated them with respective subnets.&lt;/li&gt;
&lt;li&gt;Configured &lt;strong&gt;Security Groups&lt;/strong&gt; for public-facing and internal components.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Flask App &amp;amp; Launch Template&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up a simple &lt;strong&gt;Flask server running on port 8080&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Created a &lt;strong&gt;custom AMI&lt;/strong&gt; from this EC2 instance.&lt;/li&gt;
&lt;li&gt;Used it to define an &lt;strong&gt;EC2 Launch Template&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Target Group &amp;amp; Load Balancer&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Created a &lt;strong&gt;Target Group&lt;/strong&gt; pointing to instances in the private subnets on &lt;strong&gt;port 8080&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;Deployed an &lt;strong&gt;Application Load Balancer (ALB)&lt;/strong&gt; in the public subnets and connected it to the target group.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Auto Scaling Group (ASG)&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configured the &lt;strong&gt;ASG&lt;/strong&gt; using the launch template and attached it to the &lt;strong&gt;target group&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;This enabled instances to &lt;strong&gt;scale in and out automatically&lt;/strong&gt; based on demand.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;

&lt;p&gt;&lt;strong&gt;Bastion Host for Debugging&lt;/strong&gt;:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Deployed a &lt;strong&gt;Bastion EC2 instance in a public subnet&lt;/strong&gt; with a public IP.&lt;/li&gt;
&lt;li&gt;Used it to &lt;strong&gt;SSH into the private EC2 instances&lt;/strong&gt; for validation and debugging.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  ✅ Final Result
&lt;/h2&gt;

&lt;p&gt;The Application Load Balancer started successfully routing traffic to EC2 instances launched by the Auto Scaling Group. Each response was coming from a different instance depending on the load, a satisfying sight after a night of building.&lt;/p&gt;

&lt;h2&gt;
  
  
  🌙 Reflection
&lt;/h2&gt;

&lt;p&gt;Compared to yesterday, this build felt cleaner and more intentional. Every service was tested step-by-step before stitching them together. A reminder that in the cloud (and in life), skipping fundamentals can cost you time, but every mistake brings clarity.&lt;/p&gt;

&lt;h2&gt;
  
  
  📌 Tech Stack
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;AWS EC2, VPC, IGW, NAT Gateway&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Application Load Balancer (ALB)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Auto Scaling Groups (ASG)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Flask (Python)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Custom AMIs &amp;amp; Launch Templates&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  💬 Let’s Connect
&lt;/h2&gt;

&lt;p&gt;Have you tried setting up ASGs + ALBs from scratch before? Got tips for a smoother setup or common pitfalls? Let’s chat in the comments!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>AWS Auto Scaling Groups: A Fundamental Mistake (Beginner Edition)</title>
      <dc:creator>Deepak Soni</dc:creator>
      <pubDate>Tue, 22 Jul 2025 10:49:51 +0000</pubDate>
      <link>https://dev.to/deepaksonii/aws-auto-scaling-groups-a-fundamental-mistake-beginner-edition-13k9</link>
      <guid>https://dev.to/deepaksonii/aws-auto-scaling-groups-a-fundamental-mistake-beginner-edition-13k9</guid>
      <description>&lt;h2&gt;
  
  
  The Mistake
&lt;/h2&gt;

&lt;p&gt;It was 5 AM. I was tired, a bit overconfident, and really wanted to see my ASG + ALB setup in action. So I skipped a pretty important step - testing the EC2 Launch Template, and jumped straight into building the full infrastructure.&lt;/p&gt;

&lt;p&gt;Once everything was up, I opened the ALB’s DNS URL… and saw a blank page.&lt;/p&gt;

&lt;p&gt;After some digging, I realized: the EC2 Launch Template I used didn’t have my server. It was empty. That’s when I learned that launch templates don’t store your file system. If you want your server to work, you need to create a proper AMI or add user data to install everything during boot.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Story
&lt;/h2&gt;

&lt;p&gt;I was learning about AWS Auto Scaling Groups (ASGs). I already had a decent understanding of VPCs, subnets, route tables, IGWs, and NAT Gateways. I’d also played around with Application Load Balancers (ALBs) in a small project that used three EC2 instances.&lt;/p&gt;

&lt;p&gt;So I thought - why not combine it all? I decided to build a mini project using both ASGs and ALBs to create a scalable infrastructure setup.&lt;/p&gt;

&lt;h3&gt;
  
  
  Here’s what I did:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Created a new &lt;strong&gt;custom VPC&lt;/strong&gt; for the project&lt;/li&gt;
&lt;li&gt;Set up &lt;strong&gt;3 public subnets&lt;/strong&gt; and &lt;strong&gt;3 private subnets&lt;/strong&gt;, each in a different Availability Zone for high availability&lt;/li&gt;
&lt;li&gt;Attached an &lt;strong&gt;Internet Gateway (IGW)&lt;/strong&gt; to the VPC and linked it to the &lt;strong&gt;public subnets&lt;/strong&gt; via route tables&lt;/li&gt;
&lt;li&gt;Created &lt;strong&gt;3 separate NAT Gateways&lt;/strong&gt; (one in each public subnet) and connected them to the &lt;strong&gt;private subnets&lt;/strong&gt; in the same AZ — because my &lt;strong&gt;EC2 instances were in the private subnets&lt;/strong&gt;, and they also needed &lt;strong&gt;egress internet access for downloading packages, configuration files, etc.&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Created a &lt;strong&gt;Target Group&lt;/strong&gt; for EC2 instances, set it to listen on &lt;strong&gt;port 8080&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Deployed an &lt;strong&gt;Application Load Balancer (ALB)&lt;/strong&gt; in the &lt;strong&gt;public subnets&lt;/strong&gt; and attached it to the target group&lt;/li&gt;
&lt;li&gt;Made an &lt;strong&gt;EC2 Launch Template&lt;/strong&gt; from an existing instance where I had already set up my server (or so I thought)&lt;/li&gt;
&lt;li&gt;Created an &lt;strong&gt;Auto Scaling Group (ASG)&lt;/strong&gt; using that launch template and connected it to the target group&lt;/li&gt;
&lt;li&gt;Set up &lt;strong&gt;Security Groups&lt;/strong&gt; for the ALB, Bastion Host, and EC2 instances accordingly&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All done. Everything looked solid. I opened the ALB DNS in my browser… and it just didn’t work.&lt;/p&gt;

&lt;p&gt;I checked security groups, route tables, load balancer health checks - everything looked fine.&lt;/p&gt;

&lt;p&gt;Confused, I launched a bastion host and SSH'ed into one of the EC2 instances. And then… surprise: it was completely blank. No app. No server. Nothing.&lt;/p&gt;

&lt;p&gt;That’s when I realized: &lt;strong&gt;Launch Templates don’t include your app or server files&lt;/strong&gt;. They only store instance config. If you want a working server, you either need to create an AMI or provide user data.&lt;/p&gt;

&lt;h2&gt;
  
  
  What I Learned
&lt;/h2&gt;

&lt;p&gt;At that point, I was exhausted and just shut everything down. I’ll redo it properly with AMIs next time - and I’ll test things step by step.&lt;/p&gt;

&lt;p&gt;But honestly, I’m glad this happened. These small failures during the learning phase help you understand the “why” behind things. Now I’ll &lt;em&gt;never&lt;/em&gt; forget how EC2 bootstrapping really works.&lt;/p&gt;

&lt;p&gt;Thanks for reading!&lt;/p&gt;

&lt;p&gt;If you’re also figuring out AWS like me, feel free to connect on &lt;a href="https://linkedin.com/in/deepaksonii" rel="noopener noreferrer"&gt;LinkedIn&lt;/a&gt;. Let’s learn together! 😊&lt;/p&gt;

</description>
      <category>aws</category>
      <category>cloud</category>
      <category>cloudcomputing</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
