<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Manas Amancharla on Medium]]></title>
        <description><![CDATA[Stories by Manas Amancharla on Medium]]></description>
        <link>https://medium.com/@manasamancharla11?source=rss-e38bd34264fd------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*_A8VSSKgvDC2UBfjg2nFug.jpeg</url>
            <title>Stories by Manas Amancharla on Medium</title>
            <link>https://medium.com/@manasamancharla11?source=rss-e38bd34264fd------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 01:06:21 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@manasamancharla11/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Overkill Todo: I Gave a 4-Endpoint App a Zero Trust AWS Architecture, On Purpose]]></title>
            <link>https://medium.com/@manasamancharla11/overkill-todo-i-gave-a-4-endpoint-app-a-zero-trust-aws-architecture-on-purpose-bd4eb9acd869?source=rss-e38bd34264fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd4eb9acd869</guid>
            <category><![CDATA[cloud-architecture]]></category>
            <category><![CDATA[aws-solutions-architect]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[zero-trust]]></category>
            <dc:creator><![CDATA[Manas Amancharla]]></dc:creator>
            <pubDate>Sat, 24 Oct 2026 18:08:47 GMT</pubDate>
            <atom:updated>2026-10-24T18:08:47.356Z</atom:updated>
            <content:encoded><![CDATA[<p>Here’s the setup: a todo app built with a FastAPI backend and a MongoDB database.</p><p>The app is, on purpose, the least interesting part of this project but the infrastructure is not.</p><p>This is Iteration 01 of a series where I’m building real AWS infrastructure from scratch, console-first, no IaC, nothing copy-pasted without being understood.</p><p>Here’s what I built and what it taught me.</p><h3>What I built</h3><p>A production grade 3-tier web architecture in AWS with Zero Trust network segmentation, deployed across two Availability Zones in ap-south-1 region (Mumbai).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/883/1*cq_qWXOjQv1yOuAuXxek2Q.png" /><figcaption>Iteration 1 Architecture</figcaption></figure><p>Three tiers, two AZs, one controlled traffic pipeline:</p><ul><li><strong>Public Tier</strong> — Application Load Balancer spanning both AZs, NAT Gateway in AZ-a</li><li><strong>Private App Tier</strong> — Two FastAPI EC2 instances, one per AZ, no public IPs</li><li><strong>Private Data Tier</strong> — Single MongoDB EC2 in AZ-a, completely invisible to the internet</li></ul><p>FastAPI and MongoDB running as Docker containers on EC2 instances, image stored in AWS ECR, accessed via SSM Session Manager with zero open SSH ports anywhere in the VPC.</p><h3>The architecture decision I made on purpose</h3><p>Before getting into the build, one design decision worth explaining is the single MongoDB instance.</p><pre>If AZ-a goes down:<br>  App Server AZ-a  →  gone<br>  MongoDB          →  gone<br>  App Server AZ-b  →  running but DB unreachable<br>  Result           →  full outage<br><br>If AZ-b goes down:<br>  App Server AZ-b  →  gone<br>  App Server AZ-a  →  still running, DB connected<br>  Result           →  degraded but functional</pre><p>I know this limitation. I chose it consciously to keep Iteration 01 focused on the network and security fundamentals. The architecture diagram shows a faded MongoDB instance in AZ-b. I already planned for the next iteration.</p><p>I think this is the difference between following a tutorial and making decisions.</p><h3>The build: phase by phase</h3><h4>Phase 1 — Network Foundation</h4><p>Everything in AWS lives inside a VPC. Before a single server, a single security rule, or a single line of application code can run in production, the network has to exist.</p><p>I created overkill-todo-vpc with CIDR 10.0.0.0/16. That&#39;s 65,536 private IP addresses!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v4-otG6ITMHFKefFuaetrg.png" /><figcaption>VPC created</figcaption></figure><p>Then followed the creation of six subnets across two Availability Zones:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qwS5K7jgKkjW3sprcg0Qxg.png" /><figcaption>Subnets created</figcaption></figure><p>I then enabled Auto-assign Public IPv4 for both overkill-todo-public-a and overkill-todo-public-bsubnets. This enables Internet-facing resources such as the Application Load Balancer and NAT Gateway launched in these subnets to automatically receive public IPv4 addresses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/1*IsN5Y7s1rG27MDszEIVkYA.png" /></figure><p>Then the gateways. The Internet Gateway is the front door of the entire VPC. Without it, nothing enters or leaves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lgo1KVRe5xX_uYBXXgK7Sw.png" /><figcaption>Internet Gateway</figcaption></figure><p>The NAT Gateway lives in the public subnet and gives private EC2 instances a one-way window to the internet. The private instances can make outbound requests to pull Docker images and run updates.</p><p>I have used one NAT Gateway, deliberately. In AZ-a only. Production would have one per AZ or regional NAT Gateway would be used. I documented that trade-off and moved on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0vz5Gw22vDIxaXRVgOIvhg.png" /><figcaption>Zonal NAT Gateway created</figcaption></figure><p>I then created two separate route tables to control how traffic flows through the VPC and to establish a clear boundary between public-facing resources and private workloads.</p><p>The public route table routes all outbound traffic destined for 0.0.0.0/0 through the Internet Gateway (IGW). I associated this route table with both public subnets, overkill-todo-public-a and overkill-todo-public-b, to support internet-facing resources.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t9Kkq2DvarMlpQltNQ4VXQ.png" /></figure><p>The private route table directs outbound traffic destined for 0.0.0.0/0 through the NAT Gateway, allowing resources in the private subnets to initiate outbound internet connections without being directly accessible from the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uwXld_dYevkGaXCDzucVMg.png" /></figure><p>I then associated this route table with both public subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*etpFcfv4qCja4Zm5_Z9rXA.png" /></figure><p>This establishes the foundation for controlling traffic flow across the three-tier architecture.</p><h4>Phase 2— IAM Roles</h4><p>I created two roles, built on the principle of least privilege.</p><p><strong>overkill-todo-app-role: </strong>attached to both App EC2 instances:</p><ul><li>AmazonSSMManagedInstanceCorefor terminal access via SSM, no SSH</li><li>AmazonEC2ContainerRegistryReadOnlyto pull Docker images from ECR</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8xymADdfKMU3WZdBtOT_TA.png" /><figcaption>overkill-todo-app-role</figcaption></figure><p><strong>overkill-todo-db-role: </strong>attached to the DB EC2:</p><ul><li>AmazonSSMManagedInstanceCorefor SSM access only</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Znve6kzCYHE4IMYpGV3zrA.png" /><figcaption>overkill-todo-db-role</figcaption></figure><h4>Phase 3 — The Security Group Daisy-Chain</h4><p>This is the section I explored in depth, focusing on the security decisions and the reasoning behind them.</p><p>AWS Security Groups are stateful firewalls, meaning that if a request is allowed in one direction, the response traffic is automatically allowed back. If my FastAPI application sends a request to MongoDB and the connection is permitted, MongoDB’s response traffic is automatically allowed without needing a separate inbound rule for the response.</p><p>I first created all three Security Groups without any rules, then configure their rules afterward. This was necessary because each Security Group needed to reference another group’s ID, which is only available after that group has been created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_Xj1-c42lKlTjetcRacUAw.png" /><figcaption>Security Groups</figcaption></figure><p>This setup is called Security Group daisy chaining, where each layer allows traffic only from the Security Group directly in front of it. The Application Load Balancer can communicate with the FastAPI application, and FastAPI can communicate with MongoDB.</p><blockquote>Note: AWS does not allow Security Group names to start with the reserved sg- prefix, as it is reserved for Security Group IDs</blockquote><h4><strong>overkill-todo-alb-sg</strong></h4><p>The only group that touches the public internet.</p><p><strong>Inbound rules:</strong></p><p>Port 80 (HTTP): Allows traffic from 0.0.0.0/0.</p><p>Port 443 (HTTPS): Allows traffic from 0.0.0.0/0.</p><p><strong>Outbound rules:</strong></p><p>Port 8000: Allows traffic only to sg-overkill-todo-app.</p><h4>overkill-todo-app-sg</h4><p>This Security Group accepts incoming traffic only from the Application Load Balancer.</p><p><strong>Inbound rules:</strong></p><p>Port 8000: Allows traffic only from sg-overkill-todo-alb.</p><p><strong>Outbound rules:</strong></p><p>Port 27017: Allows traffic only to sg-overkill-todo-db for MongoDB communication.</p><p>Ports 80 and 443:<strong> </strong>Allows outbound internet traffic through the NAT Gateway for tasks such as pulling images from Amazon ECR.</p><h4>overkill-todo-db-sg</h4><p>This Security Group restricts database access to the FastAPI application layer.</p><p><strong>Inbound rules:</strong></p><p>Port 27017: Allows traffic only from sg-overkill-todo-app.</p><p><strong>Outbound rules:</strong></p><p>Ports 80 and 443: Allows outbound traffic through the NAT Gateway for updates.</p><p>MongoDB is not directly accessible from the public internet or the Load Balancer. Only the application layer is permitted to connect to the database.</p><p>By linking the Security Groups this way, I created a controlled path for traffic without allowing broad IP ranges access to the different layers.</p><h4>Phase 4 — ECR: The Private Image Registry</h4><p>The Todo app’s docker image is built locally, pushed to AWS ECR, and pulled onto the EC2 at boot via the IAM role.</p><pre># Authenticate<br>aws ecr get-login-password --region ap-south-1 | \<br>  docker login --username AWS \<br>  --password-stdin AWS_ACCOUNT_ID.dkr.ecr.ap-south-1.amazonaws.com<br><br># Build, tag, push<br>docker build -t overkill-todo .<br><br>docker tag overkill-todo:latest \<br>  AWS_ACCOUNT_ID.dkr.ecr.ap-south-1.amazonaws.com/overkill-todo:latest<br><br>docker push \<br>  AWS_ACCOUNT_ID.dkr.ecr.ap-south-1.amazonaws.com/overkill-todo:latest</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ir3vgSt_wwiMxSU7s_npjw.png" /><figcaption>Docker image</figcaption></figure><p>The App EC2’s IAM role (AmazonEC2ContainerRegistryReadOnly) is what authorises the pull. No credentials stored on the server.</p><h4>Phase 5 — Compute</h4><p>I created three EC2 instances without any key pairs. I launched the DB EC2 before the app servers, because its private IP was required to launch the app servers.</p><p>The MongoDB instance, overkill-todo-dbwas launched in the overkill-todo-data-a subnet. Its User Data script installs Docker and runs MongoDB in a container on port 27017, using a named volume to preserve database data across container restarts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NPXV6Ag0f8G_mTpd9nOvvg.png" /><figcaption>MongoDB Server setup</figcaption></figure><p>Next, I launched two FastAPI application instances: overkill-todo-app-a in AZ-a and overkill-todo-app-b in AZ-b. Both use the same configuration, with only their subnet and Availability Zone differing. Their User Data scripts authenticate with Amazon ECR, pull the application image, and start the containers with the database&#39;s private IP injected as an environment variable. This allows both application instances to connect to MongoDB over the private network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7vo7QDabjgOXESj4JJF0CA.png" /><figcaption>App Server setup</figcaption></figure><p><strong>The Issue I Encountered</strong></p><p>My User Data script failed to execute on the first attempt because of a simple formatting mistake: an empty line before #!/bin/bash.</p><p>The shebang needs to be at the very beginning of the script so the system knows which interpreter to use. With the blank line in place, the script wasn’t processed as intended, and the Docker container never started.</p><h4>Phase 6 — Load Balancer</h4><p>I first created a Target Group named overkill-todo-tg, configured to use HTTP on port 8000, with /health as the health check path. I then registered both FastAPI application instances with the target group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4Ja0OmMAgt-FAOk0FITuEw.png" /><figcaption>Target group</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*amxYBw-azRoCKdreDtqoUA.png" /><figcaption>Registered Targets</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8x8tDjEhN_e6j6woCGaTSw.png" /><figcaption>Target group details</figcaption></figure><p>Next, I created an internet-facing Application Load Balancer named overkill-todo-alb and mapped it to both public subnets across the two Availability Zones. I attached sg-overkill-todo-alb and configured an HTTP listener on port 80 to forward incoming requests to overkill-todo-tg.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uMY-yEwQbfZqNueX_QFd-g.png" /><figcaption>ALB setup</figcaption></figure><p>After the setup, I waited for few minutes for the ALB to become active.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J80A6G0AL_PLMXmT-nvmAQ.png" /><figcaption>ALB</figcaption></figure><h4>The moment it worked</h4><p>I opened my browser, pasted the ALB DNS name, added /health to the end, and hit enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N-tSmjZ60knslSiAqURgxw.png" /><figcaption>Connection successful</figcaption></figure><p>That response confirmed that the entire request flow was working: my laptop → public internet → Internet Gateway → ALB → FastAPI instance in a private subnet → MongoDB instance in the database subnet, with the response returning through the same chain.</p><p>Since the /health endpoint performs a live ping to MongoDB, receiving an HTTP 200 OK meant more than just confirming that the application server was running. It verified that the FastAPI application could successfully communicate with the database and that the complete request pipeline was functioning as expected.</p><h4>Limitations</h4><p>This setup works, but it still has a few limitations before it can be considered production-ready.</p><p><strong>1. Single MongoDB Instance</strong></p><p>Both application servers depend on one MongoDB instance in AZ-a. If it fails, the application loses database access.</p><p><strong>2. Single NAT Gateway</strong></p><p>The NAT Gateway in AZ-a handles outbound traffic for both AZs. If AZ-a fails, private instances in AZ-b lose internet access. A production setup should use one NAT Gateway per AZ or a regional NAT Gateway.</p><p><strong>3. No HTTPS</strong></p><p>The ALB currently accepts HTTP traffic on port 80. Adding an ACM certificate, an HTTPS listener on port 443, and an HTTP-to-HTTPS redirect will secure client connections.</p><p>Overkill Todo is an ongoing series where the app stays simple while the infrastructure evolves. I’ll document the design decisions, improvements, and limitations along the way.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd4eb9acd869" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding DHCP: How Your Devices Get an IP Address]]></title>
            <link>https://medium.com/@manasamancharla11/understanding-dhcp-how-your-devices-get-an-ip-address-77caa0853145?source=rss-e38bd34264fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/77caa0853145</guid>
            <category><![CDATA[ip-address]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[dhcp]]></category>
            <dc:creator><![CDATA[Manas Amancharla]]></dc:creator>
            <pubDate>Sat, 26 Sep 2026 15:54:55 GMT</pubDate>
            <atom:updated>2026-09-26T15:54:55.045Z</atom:updated>
            <content:encoded><![CDATA[<p>Every time your laptop joins a Wi-Fi network, or a new server boots up in a data center, something interesting happens behind the scenes before you ever send a single packet to the internet: the device asks the network, <em>“Who am I, and how do I talk to the rest of the world?”</em></p><p>The protocol that answers this question is Dynamic Host Configuration Protocol. It’s one of those not so glamorous pieces of infrastructure that just works, until it doesn’t, and then you’re staring at a device with no IP address wondering what went wrong.</p><p>This post walks through what DHCP actually does, how the handshake works, and the key concepts worth understanding.</p><h3>What Problem Does DHCP Solve?</h3><p>Every device on a network needs at least four things to communicate properly:</p><ol><li><strong>An IP address: </strong>unique identity on the network</li><li><strong>A subnet mask: </strong>tells which part of this IP address identifies the network, and which part identifies the specific device</li><li><strong>A default gateway</strong>: where to send traffic that isn’t local</li><li><strong>DNS server addresses: </strong>so it can resolve names like google.com into IP addresses</li></ol><p>Before DHCP, network administrators had to manually configure this on every single device. That’s fine for three devices but it falls apart completely once you have hundreds or thousands of devices.</p><p>DHCP automates this. A device joins the network, asks for configuration, and gets it automatically within milliseconds.</p><h3>The DHCP Handshake: DORA</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/940/1*sDxm8aVac6778iEQo4Eypw.png" /><figcaption>DHCP Handshake</figcaption></figure><p>The core DHCP exchange is often remembered by the acronym <strong>DORA</strong>:</p><ul><li><strong>Discover: </strong>The client broadcasts a message onto the network: “Is there a DHCP server out there? I need an IP address.” Since the client doesn’t have an IP yet, this goes out as a broadcast (destination 255.255.255.255).</li><li><strong>Offer: </strong>Any DHCP server listening responds with an offer: “Here’s an IP address you can use, along with your subnet mask, gateway, and DNS servers.”</li><li><strong>Request: </strong>The client picks one offer (usually the first one it receives) and broadcasts a request confirming it wants to use that specific offer.</li><li><strong>Acknowledge: </strong>The server finalizes the lease and sends an acknowledgment (ACK), confirming the IP address is now assigned to the client for a set lease duration.</li></ul><p>Once this exchange completes, the device has a working network configuration. Near the end of the lease period, the client will try to renew it directly with the server, and the whole DORA process repeats if the lease can’t be renewed or the device moves to a new network.</p><h3>Key DHCP Concepts</h3><p><strong>Lease time</strong>: IP addresses aren’t assigned forever. They’re leased for a duration (minutes to days) so that addresses can be reclaimed and reused when devices disconnect.</p><p><strong>DHCP relay</strong>: In larger networks, the DHCP server often isn’t on the same physical subnet as the client. Since DHCP Discover is a broadcast and broadcasts don’t cross routers, a <strong>DHCP relay agent</strong> sits on the client’s subnet, listens for these broadcasts, and forwards them as unicast messages to the actual DHCP server elsewhere.</p><p><strong>Reservations</strong>: You can configure a DHCP server to always assign the same IP address to a specific device (identified by its MAC address).</p><p><strong>DHCP options</strong>: Beyond the basics (IP, subnet, gateway, DNS), DHCP supports dozens of optional parameters like NTP servers, domain names and more.</p><p><strong>DHCP scopes</strong>: A scope defines the range of IP addresses a DHCP server is allowed to hand out on a given network segment, along with any exclusions (addresses reserved for servers, printers, or other statically configured devices).</p><h3>Static vs. Dynamic Addressing</h3><p>DHCP doesn’t mean every device has to get a random address. Most networks use a mix:</p><ul><li><strong>Dynamic allocation: </strong>The common case. The server hands out an address from its pool, and it may or may not be the same address next time.</li><li><strong>Static (reserved) allocation: </strong>The server always gives a specific device the same address, based on its MAC address.</li><li><strong>Manual configuration: </strong>Some devices (core routers, printers, servers) are configured outside of DHCP entirely, with a permanent static IP set by hand.</li></ul><h3>Wrapping Up</h3><p>DHCP is a small protocol with a big impact. Understanding the DORA handshake gives you a mental model for diagnosing connectivity issues. It’s one of those foundational pieces of networking that’s worth truly understanding.</p><p>DHCP hands out the very things that make DNS resolution, subnetting, and routing work, so understanding one makes the others easier to reason about too. If you want to go deeper, check the article I wrote on <a href="https://medium.com/@manasamancharla11/dns-explained-how-the-internet-finds-what-youre-looking-for-a05301a1b213?sharedUserId=manasamancharla11">DNS</a> that pairs well with this one.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=77caa0853145" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DNS Explained: How the Internet Finds What You’re Looking For]]></title>
            <link>https://medium.com/@manasamancharla11/dns-explained-how-the-internet-finds-what-youre-looking-for-a05301a1b213?source=rss-e38bd34264fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/a05301a1b213</guid>
            <category><![CDATA[internet]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[website]]></category>
            <dc:creator><![CDATA[Manas Amancharla]]></dc:creator>
            <pubDate>Sat, 15 Aug 2026 17:36:28 GMT</pubDate>
            <atom:updated>2026-09-26T15:51:50.185Z</atom:updated>
            <content:encoded><![CDATA[<p>Every time you type a website address into your browser, something remarkable happens in the background. A global, distributed system translates that human-readable name into a numerical address computers can actually use. That system is called <strong>DNS</strong>, the Domain Name System.</p><p>This post breaks down what DNS is, how it works step by step, the different types of DNS records, and some core concepts that often get overlooked.</p><h3>What Is DNS?</h3><p>DNS stands for <strong>Domain Name System</strong>. Think of it as the internet’s phone book, it maps human-friendly domain names like example.com to machine-friendly IP addresses like 93.184.216.34.</p><p>DNS handles that translation of the domain names to IP addresses for you, invisibly, in milliseconds.</p><h3>How DNS Resolution Works</h3><p>When you type a domain into your browser, a chain of lookups happens called <strong>DNS resolution</strong>. Here’s the journey, step by step:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/942/1*GJzHGuBtJYYb4NxTaC60YQ.png" /></figure><h4>1. Browser and OS Cache</h4><p>Your device first checks if it already knows the answer from a recent visit. If so, resolution ends here instantly.</p><h4>2. Recursive Resolver</h4><p>If there’s no cached answer, the request goes to a <strong>recursive resolver</strong> which is usually run by your ISP or a public DNS provider (like Google’s 8.8.8.8 or Cloudflare&#39;s 1.1.1.1). This resolver does the legwork of tracking down the answer on your behalf.</p><h4>3. Root Name Servers</h4><p>The resolver first asks one of the internet’s <strong>root name servers</strong>, “Who knows about .com domains?&quot; The root server doesn&#39;t know the final answer, but it points the resolver toward the right <strong>TLD server</strong>.</p><h4>4. TLD Name Servers</h4><p>TLD (Top-Level Domain) servers manage domains under a specific extension — .com, .org, .net, .io, etc. The TLD server responds with the <strong>authoritative name server</strong> responsible for the specific domain being queried.</p><h4>5. Authoritative Name Server</h4><p>This is the final stop. The authoritative name server actually holds the DNS records for the domain and returns the IP address.</p><h4>6. Back to You</h4><p>The resolver caches this answer (based on the record’s TTL) and returns it to your browser, which can now connect directly to the website’s server.</p><p>All of this typically happens in under a second, often much faster thanks to caching at every layer.</p><h3>Common DNS Record Types</h3><p>DNS stores several types of records, each serving a different purpose:</p><ul><li><strong>A</strong> — Maps a domain name to an IPv4 address</li><li><strong>AAAA</strong> — Maps a domain name to an IPv6 address</li><li><strong>CNAME</strong> — Maps a domain name to another domain name (an alias)</li><li><strong>MX</strong> — Specifies mail servers responsible for receiving email for the domain</li><li><strong>TXT</strong> — Stores arbitrary text, often used for domain ownership verification or email security (SPF, DKIM, DMARC)</li><li><strong>NS</strong> — Specifies the authoritative name servers for a domain</li><li><strong>SOA</strong> — Contains administrative information about the DNS zone, like the primary name server and refresh timers</li><li><strong>PTR</strong> — Maps an IP address back to a domain name (Reverse DNS lookups)</li></ul><p><strong>A note on CNAME:</strong> it points one domain name to another, for example, www.example.com might be a CNAME pointing to example.com. The one place you can’t use it is the root domain itself (example.com with nothing in front), that has to be an A or AAAA record pointing straight to an IP.</p><h3>Key DNS Concepts</h3><h4>TTL (Time to Live)</h4><p>Every DNS record has a TTL which is a value (in seconds) that tells resolvers how long to cache the record before checking for updates again.</p><ul><li><strong>Short TTL</strong> → changes propagate faster, but more frequent lookups (slightly higher load/latency).</li><li><strong>Long TTL</strong> → fewer lookups needed, but changes take longer to reach everyone.</li></ul><p>This is why, when people migrate servers or change hosting providers, they’re often advised to lower the TTL beforehand as it minimizes downtime by making the switch propagate faster.</p><h4>Authoritative vs. Recursive Servers</h4><p>It’s easy to mix these up:</p><ul><li><strong>Recursive resolvers</strong> do the searching on your behalf, hopping from server to server.</li><li><strong>Authoritative servers</strong> hold the actual, definitive records for a domain and are the final source of truth.</li></ul><h4>DNS Zones</h4><p>Think of a zone as one “folder” of DNS records that a specific organization or administrator controls. example.com and its subdomains usually live in one zone, and the zone file is just the actual list of records (A, MX, TXT, etc.) inside it.</p><h4>DNS Propagation</h4><p>When you update a DNS record, it doesn’t take effect everywhere instantly. Because of caching at multiple levels (your device, your ISP, various resolvers around the world), it can take anywhere from a few minutes to 48 hours for changes to fully propagate globally, though it’s usually much faster in practice, especially with low TTLs.</p><h3>Wrapping Up</h3><p>DNS is one of those foundational internet technologies that just works, quietly, billions of times a day.</p><p>Next time a website goes down right after a DNS change, you’ll know exactly why and how long you might need to wait it out.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a05301a1b213" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Host a React App on Azure Static Web Apps: Step-by-Step Guide]]></title>
            <link>https://medium.com/@manasamancharla11/host-a-react-app-on-azure-static-web-apps-step-by-step-guide-9ec9a4512be1?source=rss-e38bd34264fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ec9a4512be1</guid>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[azure]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Manas Amancharla]]></dc:creator>
            <pubDate>Fri, 06 Mar 2026 16:15:32 GMT</pubDate>
            <atom:updated>2026-03-06T16:15:32.438Z</atom:updated>
            <content:encoded><![CDATA[<p>A step-by-step visual guide to deploying React apps with automated CI/CD pipelines.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*0Mu7fRFKduv2tMEt6V6BLg.png" /><figcaption>Azure SWA</figcaption></figure><p>Azure Static Web Apps (SWA) is one of the best options for hosting Single Page Applications (SPAs) like React, offering global CDN distribution, built-in SSL certificates, and automated build pipelines.</p><p>In this guide, you’ll learn how to deploy a React app, manage secrets, and solve the most common routing issue developers run into.</p><h4><strong>Step 1: Create the Resource</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDBcWKjyBjkagP09FtZpiA.png" /></figure><p>First, search for <strong>Static Web Apps</strong> in the Azure Portal. You’ll see your dashboard. If you haven’t created one yet, it will be empty. Click <strong>Create</strong>.</p><h4>Step 2: Configure the Basics</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EYa6VuJ2DzXT5S6SH3q6Ow.png" /></figure><p>For this guide, we’ll use <strong>GitHub</strong> as our deployment source. This is where the magic of SWA happens!! It doesn’t just host your files, it actively watches your repository and deploys changes automatically.</p><p>Choose your <strong>Subscription</strong> and <strong>Resource Group</strong> based on your setup.</p><p>For the <strong>Plan type</strong>, select <strong>Free</strong> for personal projects or <strong>Standard</strong> if you need enterprise features.</p><p>Now we need to let Azure know how to build your app.</p><ul><li><strong>Build Presets:</strong> Choose <strong>React.</strong></li><li><strong>App Location:</strong> Set this to / (root of your repository).</li><li><strong>Output Location:</strong> Use dist if you’re using Vite, or build if you’re using Create React App.</li></ul><h4>Step 3: Review and Create</h4><p>Before moving on, double-check your settings. Take a moment to look at the <strong>Deployment details</strong> as Azure is about to create and commit a workflow file to your repository automatically.</p><p>This file handles all future deployments, so every push to your repo will trigger an update to your app.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uYQcBO_LeO0rhg0Wgsw9-Q.png" /></figure><h4>Step 4: Handling Environment Variables</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GWPMHaNHnMMV4kuKIsP3OQ.png" /></figure><p>Front-end apps often need <strong>run-time variables</strong>, like API base URLs. You can pass these secrets (for example, VITE_BASE_URL) through your GitHub repository settings: go to <strong>Settings &gt; Secrets and variables &gt; Actions</strong>.</p><p>Once your secrets are set, you can map them in your <strong>GitHub workflow file</strong> (.github/workflows/azure-static-web-apps-...yml) so they’re available during the build and runtime.</p><h4>Step 5: Understanding the Workflow</h4><p>When you set up SWA, Azure automatically generates a <strong>YAML file</strong> for GitHub Actions. This file powers your CI/CD pipeline.</p><p>Every time you push changes to your branch, the workflow kicks in and builds your React app and updates your site on Azure automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RGyCSghqHb4Qkd7j2t4P6g.png" /></figure><p>After creating the Static Web App, you’ll see this default Azure page. This means your app is provisioning and the initial deployment is still in progress.</p><p>Azure needs a few minutes to finish setting things up and run the first build from your repository. Once the workflow completes, this page will automatically be replaced with your React app.</p><h4>One More Thing:</h4><p>Your app will seem to work just fine… until you hit refresh on a sub-route like /about. When that happens, you’ll be greeted with a <strong>404 error</strong>.</p><p>So what’s going on?</p><p>Static servers try to load a physical file called about.html. But React is a <strong>Single Page Application</strong> and it relies on client-side routing and expects every request to be handled by index.html.</p><p>To solve this, you need to tell Azure Static Web Apps to redirect all routes back to your app’s entry point.</p><p>Create a file named <strong>staticwebapp.config.json</strong> in the root of your project and paste in the following configuration:</p><pre>{<br>  &quot;navigationFallback&quot;: {<br>    &quot;rewrite&quot;: &quot;/index.html&quot;,<br>    &quot;exclude&quot;: [&quot;/images/*.{png,jpg,gif}&quot;, &quot;/css/*&quot;]<br>  }<br>}</pre><h4>Conclusion:</h4><p>By configuring build settings correctly, managing environment variables securely, and fixing the common client-side routing issue, you’ve covered the most frequent pitfalls developers run into when deploying SPAs.</p><p>At this point, every push to your repository triggers an automatic build and deployment. From here, you can focus on what really matters: building features, not managing infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ec9a4512be1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Create and Assign an Elastic IP to Your EC2 Instance]]></title>
            <link>https://medium.com/@manasamancharla11/how-to-create-an-elastic-ip-address-in-aws-and-assign-to-your-ec2-instance-dfeed3c309eb?source=rss-e38bd34264fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfeed3c309eb</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2]]></category>
            <dc:creator><![CDATA[Manas Amancharla]]></dc:creator>
            <pubDate>Fri, 17 Jan 2025 12:29:22 GMT</pubDate>
            <atom:updated>2025-06-15T08:44:29.735Z</atom:updated>
            <content:encoded><![CDATA[<p>By default, the public IP address of your EC2 instance changes every time you stop and restart the instance. To maintain a fixed public IP address for your instance, you can use an Elastic IP.</p><h4>1. Login into your AWS Account and open EC2 Dashboard</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*igVWpC84nx0bdroUnk2G8w.png" /></figure><p>Select <strong>Elastic IPs </strong>under Resources section or On the left-hand menu, under the Network &amp; Security section, click <strong>Elastic IPs</strong>.</p><p>Click the <strong>Allocate Elastic IP Address</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*izKLGYV7LNVbjTa2gVKwSA.png" /></figure><p>Click <strong>Allocate</strong> button to create an Elastic IP.</p><h4>2. Associate the Elastic IP with Your EC2 Instance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vAfMl-heg58rxRmLUfBq2g.png" /></figure><p>Select the IP address and from actions dropdown select <strong>Associate Elastic IP address.</strong></p><p>Select Instance under the Resource Type section and choose the instance that you want to associate.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1rPKWnTHtVUT6Qe_wntk-g.png" /></figure><p>Click on <strong>Associate.</strong></p><h4>3. Verify the <strong>Public IPv4 address</strong> field of the EC2 instance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0uK5gSS075zOuhNXUKVoQ.png" /></figure><p>And with that, you have assigned a static address to your EC2 instance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfeed3c309eb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Event Loop in JavaScript]]></title>
            <link>https://medium.com/@manasamancharla11/event-loop-in-javascript-2e7997c71bd7?source=rss-e38bd34264fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/2e7997c71bd7</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[javascript-tips]]></category>
            <dc:creator><![CDATA[Manas Amancharla]]></dc:creator>
            <pubDate>Wed, 01 Jan 2025 11:36:18 GMT</pubDate>
            <atom:updated>2025-07-24T14:49:24.680Z</atom:updated>
            <content:encoded><![CDATA[<p>Long story short, JavaScript is single-threaded. So, it can’t handle all tasks one by one without potentially slowing down. To address this, we need additional resources to take care of tasks that might slow down the code. That’s where JavaScript’s Event Loop comes into the picture.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kuOEgRkU28ogM6mW9Ujt9g.jpeg" /></figure><p>Event Loop manages multiple tasks like executing code, waiting for API responses, and handling user interactions. It operates like an airport’s control tower, regulating the flow of tasks with precision and efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/1*Y9DNlLQaZ79O9gVvuLwVSQ.gif" /><figcaption>GIF courtesy of Lydia Hallie.</figcaption></figure><p>Before we learn how event loop works, we need to understand few concepts.</p><h4>Call Stack</h4><p>JavaScript uses a call stack to keep track of the functions that are currently being executed and the order in which they need to be executed.</p><h4>Macrotask vs Microtask</h4><p>Within the Event Loop, there are two types of queues: the task queue (often referred to as the macrotask queue) and the microtask queue. The task queue handles macrotasks, while the microtask queue is dedicated to microtasks.</p><p>Macrotasks are functions which are executed after JavaScript call stack and microtask queue<strong> </strong>are empty. These functions are basically callback-based Web APIs and event handlers waiting to be executed at some point in the future.</p><blockquote>Web APIs connect JavaScript to browser features, letting us use tools and information beyond what JavaScript alone can do.</blockquote><p>setTimeout, setInterval, setImmediateare some of the Web APIs.</p><p>Microtasks are functions which are executed after the function or program which created them exits and the JavaScript call stack is empty.</p><p>Microtasks come solely from our code. They are usually created by promises: an execution of .then/catch/finally handler becomes a microtask. Microtasks are used “under the cover” of await as well, as it’s another form of promise handling.</p><p>There’s also a special function queueMicrotask(func) that queues func for execution in the microtask queue.</p><h4>Event Loop</h4><p>The Event Loop works by continuously monitoring a queue of pending events and processing them one at a time. This allows JavaScript to manage multiple events efficiently, without waiting for one to finish before starting the next.</p><p>When the Call Stack is empty, the Event Loop first processes all tasks in the Microtask Queue until it’s empty. Then, it moves to the Task Queue and pushes the first available task onto the Call Stack. Once that task is handled, the Event Loop starts over by checking the Microtask Queue again.</p><p>Understanding the JavaScript Event Loop is essential for mastering asynchronous programming. If you want to visualize how the Event Loop operates, check out websites like <a href="http://latentflip.com/loupe/?code=JC5vbignYnV0dG9uJywgJ2NsaWNrJywgZnVuY3Rpb24gb25DbGljaygpIHsKICAgIHNldFRpbWVvdXQoZnVuY3Rpb24gdGltZXIoKSB7CiAgICAgICAgY29uc29sZS5sb2coJ1lvdSBjbGlja2VkIHRoZSBidXR0b24hJyk7ICAgIAogICAgfSwgMjAwMCk7Cn0pOwoKY29uc29sZS5sb2coIkhpISIpOwoKc2V0VGltZW91dChmdW5jdGlvbiB0aW1lb3V0KCkgewogICAgY29uc29sZS5sb2coIkNsaWNrIHRoZSBidXR0b24hIik7Cn0sIDUwMDApOwoKY29uc29sZS5sb2coIldlbGNvbWUgdG8gbG91cGUuIik7!!!PGJ1dHRvbj5DbGljayBtZSE8L2J1dHRvbj4%3D">Loupe</a> and <a href="https://www.jsv9000.app/">JS Visualizer</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2e7997c71bd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Promises in JavaScript]]></title>
            <link>https://medium.com/@manasamancharla11/promises-in-javascript-d4d692a3d74f?source=rss-e38bd34264fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4d692a3d74f</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[asynchronous-programming]]></category>
            <category><![CDATA[asyncawait]]></category>
            <category><![CDATA[promises]]></category>
            <dc:creator><![CDATA[Manas Amancharla]]></dc:creator>
            <pubDate>Fri, 27 Dec 2024 12:53:52 GMT</pubDate>
            <atom:updated>2025-07-24T15:28:31.950Z</atom:updated>
            <content:encoded><![CDATA[<p>A promise is an object that represents the eventual completion (or failure) of an asynchronous operation and its resulting value. This may sound a bit confusing if you are a beginner. The best way to understand promises is to understand why they were introduced in the first place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g0WdP4YQ8isC2UcYNuyBmQ.jpeg" /></figure><h4><strong>Table of Contents</strong></h4><ul><li><em>What does asynchronous mean?</em></li><li><em>What is a Callback function?</em></li><li><em>What is Callback hell?</em></li><li><em>What are Promises?</em></li><li><em>Why Async/Await?</em></li></ul><h4><strong>Asynchronous in JavaScript</strong></h4><p>Sometimes you may need to fetch data from a server or execute a function with a delay or run tasks that happen independently of the main program flow.</p><p>These operations are referred to as asynchronous in nature. They allow a process to continue without waiting for another operation to finish.</p><p>Javascript manages mutiple tasks with the help of <a href="https://medium.com/@manasamancharla11/event-loop-in-javascript-2e7997c71bd7">Event Loop</a>.</p><h4><strong>Callback Function</strong></h4><p>A function that is passed as an argument to another function and is executed after the completion of some operations.</p><p>Consider an example,</p><pre>function greetUser(name, callback) {<br>  console.log(`Hello, ${name}!`);<br>  callback();<br>}<br><br>function simpleCallback() {<br>  console.log(&quot;I am a callback!&quot;);<br>}<br><br>greetUser(&quot;User&quot;, simpleCallback);</pre><p>Callback functions help manage asynchronous operations also, ensuring that the code continues to run smoothly without waiting for tasks to complete.</p><pre>function asyncTask(taskName, delay, callback) {<br>    console.log(`${taskName} started...`);<br>    setTimeout(() =&gt; {<br>        console.log(`${taskName} completed after ${delay}ms`);<br>        callback();<br>    }, delay);<br>}<br><br>// Using a callback<br>asyncTask(&#39;Task 1&#39;, 1000, () =&gt; {<br>    console.log(&#39;Callback executed for Task 1&#39;);<br>});</pre><h4><strong>Callback hell</strong></h4><p>Callback hell occurs when multiple nested callbacks are used to handle asynchronous operations, making the code difficult to read, debug, and maintain.</p><p>Consider an example,</p><pre>function asyncTask(taskName, delay, callback) {<br>    console.log(`${taskName} started...`);<br>    setTimeout(() =&gt; {<br>        console.log(`${taskName} completed after ${delay}ms`);<br>        callback();<br>    }, delay);<br>}<br><br>asyncTask(&#39;Task 1&#39;, 1000, () =&gt; {<br>    asyncTask(&#39;Task 2&#39;, 2000, () =&gt; {<br>        asyncTask(&#39;Task 3&#39;, 1500, () =&gt; {<br>            console.log(&#39;All tasks completed&#39;);<br>        });<br>    });<br>})</pre><p>The code is cluttered, we can modify it a bit by using named functions.</p><pre>function task1Callback() {<br>    asyncTask(&#39;Task 2&#39;, 2000, task2Callback);<br>}<br><br>function task2Callback() {<br>    asyncTask(&#39;Task 3&#39;, 1500, task3Callback);<br>}<br><br>function task3Callback() {<br>    console.log(&#39;All tasks completed&#39;);<br>}<br><br>// Start the chain<br>asyncTask(&#39;Task 1&#39;, 1000, task1Callback);</pre><p>This is a simple code snippet but as applications grow, using multiple nested callbacks or multiple named functions can become complex and hard to manage.</p><p>To overcome these issues, Promises are used in JavaScript.</p><h4><strong>Promises</strong></h4><p>A <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise">promise</a> object is used to find out if the asynchronous operation is successfully completed or not.</p><p>A promise can have 3 states</p><ul><li>Pending</li><li>Fulfilled</li><li>Rejected</li></ul><p>To handle promises, you can use the .then() method to execute code after a promise is resolved, or the .catch() method to handle errors if the promise is rejected.</p><p>You can create a promise by using the Promise constructor. It takes an executor function as its argument. The executor function has two parameters: resolve and reject. You can call resolve() to indicate success or reject() to indicate failure.</p><pre>// Example<br>let p = new Promise((resolve, reject) =&gt; {<br>    let a = 1+1; // usually an async operation runs in this place<br>    if(a==2){<br>     resolve(&quot;Success&quot;); <br>       <br>    }<br>    else{<br>        reject(&quot;Failed&quot;);<br>    }<br>})<br><br>p.then((message) =&gt; {<br>    console.log(&quot;Promise resolved &quot; + message)<br>}).catch((message) =&gt; {<br>    console.log(&quot;Promise rejected &quot; + message)<br>})</pre><p>This concept can be a little confusing at first, but taking things slowly and understanding each step can make it easier. After all, a promise is just an object instantiated from a <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes#field_declarations">class</a>.</p><p>Let’s go off track for a bit and try creating our own custom Promise class to understand what’s happening under the hood.</p><pre>class customPromise {<br>    constructor(fn){<br>       this.resolve = () =&gt; {}<br>       const onComplete= () =&gt; {<br>        this.resolve(); <br>    }<br>        fn(onComplete);<br>    }<br>    <br>    then(cb){<br>        this.resolve = cb;<br>    }<br>}<br><br>const promise = new customPromise((resolve) =&gt; {<br>     console.log(&quot;Sending API request...&quot;);<br>     // After 2 seconds <br>    setTimeout(() =&gt; {<br>       console.log(&quot;Processing response from server...&quot;);<br>        resolve();<br>        console.log(&quot;Data fetched successfully!&quot;);<br>    }, 2000); <br>});<br><br>promise.then(() =&gt; {<br>    console.log(&quot;Rendering data in the UI...&quot;);<br>}); </pre><p>The above class is a simplified implementation of a promise, showcasing the mechanics of asynchronous operations in JavaScript. It includes a then method to register a callback and uses a custom resolve function to trigger the callback once the asynchronous task is complete.</p><p>Now coming back, let’s see how promises make our lives easier by considering the running example of this article.</p><pre>function asyncTaskPromise(taskName, delay) {<br>    return new Promise((resolve) =&gt; {<br>        console.log(`${taskName} started...`);<br>        setTimeout(() =&gt; {<br>            console.log(`${taskName} completed after ${delay}ms`);<br>            resolve();<br>        }, delay);<br>    });<br>}<br><br>// Promises allow us to queue operations sequentially using .then()<br>// Promise Chaining<br>asyncTaskPromise(&#39;Task 1&#39;, 1000)<br>    .then(() =&gt; asyncTaskPromise(&#39;Task 2&#39;, 2000))<br>    .then(() =&gt; asyncTaskPromise(&#39;Task 3&#39;, 1500))<br>    .then(() =&gt; {<br>        console.log(&#39;All tasks completed&#39;);<br>    });</pre><p>To improve readability and avoid promise chaining, we can use async/await syntax.</p><h4>Async/Await</h4><p>async/await is syntactic sugar for handling asynchronous operations. It simplifies the way we write and handle asynchronous code, making it look more like synchronous code.</p><ul><li>async<strong> functions</strong>: A function declared with the async keyword always returns a promise.</li><li>await<strong> expressions</strong>: The await keyword can only be used inside an async function. It makes a function wait for a Promise and handle it accordingly.</li></ul><p>Let’s see it in action!</p><pre>function asyncTaskPromise(taskName, delay) {<br>    return new Promise((resolve) =&gt; {<br>        console.log(`${taskName} started...`);<br>        setTimeout(() =&gt; {<br>            console.log(`${taskName} completed after ${delay}ms`);<br>            resolve();<br>        }, delay);<br>    });<br>}<br><br>async function executeTasks() {<br>    await asyncTaskPromise(&#39;Task 1&#39;, 1000);<br>    await asyncTaskPromise(&#39;Task 2&#39;, 2000);<br>    await asyncTaskPromise(&#39;Task 3&#39;, 1500);<br>    console.log(&#39;All tasks completed&#39;);<br>}<br><br>// Start the tasks<br>executeTasks();</pre><p>Promises provide a powerful way to handle asynchronous operations. They help prevent callback hell and make asynchronous code easier to manage, read, and maintain.</p><p>With async/await syntax, working with Promises has become even more intuitive, making asynchronous code look and behave like synchronous code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4d692a3d74f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Launch an EC2 Instance and Connect Using SSH]]></title>
            <link>https://medium.com/@manasamancharla11/launch-ec2-instance-and-access-with-ssh-8d5bdf4b44da?source=rss-e38bd34264fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d5bdf4b44da</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[fullstack-development]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[deployment]]></category>
            <category><![CDATA[ec2]]></category>
            <dc:creator><![CDATA[Manas Amancharla]]></dc:creator>
            <pubDate>Fri, 21 Jun 2024 11:17:46 GMT</pubDate>
            <atom:updated>2025-01-17T12:38:45.991Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we will launch an EC2 instance and access it with SSH. You need to have an <a href="https://aws.amazon.com/">AWS</a> account to create an EC2 instance.</p><h4><strong>1. Login into your AWS Account and open EC2 Dashboard</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pGRylUy7yoCAVYiFfeN0JQ.png" /></figure><p>Firstly, select the AWS Region that you want to launch the instance in from the top right corner of the console.</p><p>Choose EC2 from the list of services. You will directed to EC2 dashboard. Click on <strong>“Launch Instance”.</strong></p><h4><strong>2. Choose </strong>Amazon Machine Image (AMI)</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/878/1*K37_B-eTIvUTXmen8wbYQg.png" /></figure><p>Name your instance and choose an AMI. An Amazon Machine Image (AMI) is a template that contains all the information you need to launch a new EC2 instance. There are few free tier options that you can choose.</p><h4>3. Select instance type and create a key pair</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*7ITBGv1YwQ6r4beCrv-Rhg.png" /></figure><p>Choose an instance type based on your needs.</p><p>Instance types comprise varying combinations of CPU, memory, storage, and networking capacity and give you the flexibility to choose the appropriate mix of resources for your applications.</p><p>After choosing the instance type, it’s time to create a key pair.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/1*UcnNdrTQp1tJ06PHZMs3ZA.png" /></figure><p>Create the key pair with <strong>“.pem”</strong> file format.</p><p>This key pair will allow you to access using SSH into the machine you just created. Create the key pair and download it, make sure to keep it safe as you will not be able to download it again.</p><h4>4. Configure network settings and storage</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/803/1*w4AvjbPSDPZ4HeXwI1qkjQ.png" /></figure><p>You can change vpc, subnet and security group and other configurations.</p><p>Select Allow SSH traffic to connect to the instance using ssh.</p><p>Select Allow HTTPS traffic to access the instance from the browser over https (secure).</p><p>Select Allow HTTP traffic to access the instance from the browser over http (unsecure).</p><p>After that you can configure storage and there is also Advanced details section.</p><p>I will leave this to default.</p><h4>5. Launch the EC2 instance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/387/1*PsSIRgH1tGAzreRir7I1hw.png" /></figure><p>Launch the instance.</p><p>After that go the Instances section to check the status of your instance. It may take some time to fire up your instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LQudJnum1IpKQjGO94Q4vg.png" /></figure><p>Click on <strong>“Connect”</strong> from the top of the dashboard.</p><h4>6. Connect to your instance</h4><p>Select SSH client</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/1*90eKTUeeacSKVau8QcMJVw.png" /></figure><p>Change the permissions of your pem key so that it is not publicly viewable.</p><pre>chmod 400 &lt;pem key&gt;</pre><p>To connect using your instance’s public DNS name, enter the following command.</p><pre>ssh -i /path/key-pair-name.pem instance-user-name@instance-public-dns-name</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*UTIjy9q_-eKoMsFlVyv35g.png" /></figure><p>You will be connected to your instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*vxaAzSFJAYuFwGEXnpcaHw.png" /></figure><p>Tada! You are now connected to your EC2 instance.</p><p>Now, the thing with an EC2 instance is that its IP address changes each time it’s rebooted. To resolve this, you can allocate and associate an <a href="https://medium.com/@manasamancharla11/how-to-create-an-elastic-ip-address-in-aws-and-assign-to-your-ec2-instance-dfeed3c309eb">Elastic IP</a> to your instance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d5bdf4b44da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Configuring Git and GitHub on a Linux based OS]]></title>
            <link>https://medium.com/@manasamancharla11/configuring-git-and-github-on-a-linux-based-os-32caa1d3e94f?source=rss-e38bd34264fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/32caa1d3e94f</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[repositories]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[Manas Amancharla]]></dc:creator>
            <pubDate>Sun, 13 Aug 2023 09:45:27 GMT</pubDate>
            <atom:updated>2023-08-13T09:45:27.518Z</atom:updated>
            <content:encoded><![CDATA[<h3>Installing Git :</h3><p>Install git by using a preferred package manager.</p><pre>$ sudo apt-get install -y git</pre><p>Once the installation is completed, you can check the version of git by running the following command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/643/1*TA-bRdMfAA4eVv-A6pargQ.png" /></figure><h4>Configuring your Git identity globally on the system :</h4><pre>$ git config --global user.name &quot;your_github_username&quot;<br>$ git config --global user.email &quot;your_github_email&quot;</pre><p>These commands associate your commits with your GitHub account.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*9OystQEs3uHi72-plFdBuA.png" /></figure><p>To list out all the configurations, run the following command.</p><pre>$ git config -l</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/456/1*Cy6He5Nrm1A5eqD1ege5Cg.png" /></figure><h3>Creating Personal Access Token on GitHub :</h3><p>From your GitHub account, go to <strong>Settings</strong> → <strong>Developer Settings</strong> → <strong>Personal Access Token</strong> → <strong>Generate New Token</strong> (Give your password) → <strong>Fill up the form</strong> → click <strong>Generate token</strong> → <strong>Copy the generated Token</strong>, it will be something like ghp_yedFsSHhTzMDmyTRLjmks4Tzuzgthdvfsrta .</p><p>This token can be used to perform actions on your behalf, such as pushing code, pulling repositories, and performing other operations that require authentication.</p><p>When using Git to interact with a remote GitHub repository via HTTPS URLs, Git will request your GitHub username and password. However, instead of entering your regular GitHub password, provide your Personal Access Token (PAT) when prompted.</p><h4>Cloning a Repository :</h4><pre># For the repositories that are public<br>$ git clone https://github.com/&lt;username&gt;/&lt;repo&gt;.git</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/914/1*wXqSK23FmF2-nSlQ6ZvZWQ.png" /><figcaption>Cloning a public repository</figcaption></figure><pre># For the repositories that are private<br>$ git clone https://&lt;PAT&gt;@github.com/&lt;user&gt;/&lt;repo&gt;.git</pre><h4>Pushing into a Repository :</h4><p>After making changes to the repository, run the following command to update the remote URL if needed.</p><pre>$ git remote set-url origin https://&lt;PAT&gt;@github.com/&lt;username&gt;/&lt;repo&gt;</pre><p>Then push the changes to GitHub repository by running the following command.</p><pre>$ git push origin main</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/627/1*a45H8b0j8DyQvlwv48lB9Q.png" /><figcaption>Pushing into GitHub repository</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=32caa1d3e94f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Fix Missing Grub Menu During Boot | Linux]]></title>
            <link>https://medium.com/@manasamancharla11/how-to-fix-missing-grub-menu-during-boot-linux-7ad568067ef?source=rss-e38bd34264fd------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ad568067ef</guid>
            <category><![CDATA[grub]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[os]]></category>
            <category><![CDATA[ubuntu-20-04]]></category>
            <dc:creator><![CDATA[Manas Amancharla]]></dc:creator>
            <pubDate>Fri, 11 Aug 2023 11:57:25 GMT</pubDate>
            <atom:updated>2023-08-11T11:57:25.291Z</atom:updated>
            <content:encoded><![CDATA[<p>When a Linux based OS like Ubuntu is the only OS installed on the system, the system typically boots directly into it without showing the GRUB menu. This issue can be resolved by following the steps provided below.</p><h4>Open the GRUB file with Nano editor:</h4><pre>$ sudo nano /etc/default/grub</pre><p>Access the GRUB file by entering the password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*A3XQtUJu11oq8eMC_zaJzQ.png" /></figure><p>Make the following changes,</p><pre>GRUB_TIMEOUT_STYLE=menu<br>GRUB_TIMEOUT=10</pre><p>You can set the GRUB_TIMEOUT to your preferred number of seconds.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/734/1*qL4VtOrkk1PrXl5cyZvu-A.png" /></figure><p>Save and exit the Nano editor.</p><h4>Update the changes:</h4><p>Run the following command,</p><pre>$ sudo update-grub</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*7RvhNWOygLNWf6yL48nSJg.png" /></figure><p>Upon restarting the system, the GRUB menu will be visible.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ad568067ef" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>