<?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 Vaishnavi Shelke on Medium]]></title>
        <description><![CDATA[Stories by Vaishnavi Shelke on Medium]]></description>
        <link>https://medium.com/@vaishnavi_shelke?source=rss-c33edb9ab13b------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*TFlch9w4TxBX1eimjPEvgQ.jpeg</url>
            <title>Stories by Vaishnavi Shelke on Medium</title>
            <link>https://medium.com/@vaishnavi_shelke?source=rss-c33edb9ab13b------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 27 Nov 2026 20:42:17 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@vaishnavi_shelke/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[Creating and Managing Docker Containers]]></title>
            <link>https://medium.com/@vaishnavi_shelke/docker-creating-and-managing-containers-4815f8779f5c?source=rss-c33edb9ab13b------2</link>
            <guid isPermaLink="false">https://medium.com/p/4815f8779f5c</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[devops-practice]]></category>
            <category><![CDATA[docker-basic]]></category>
            <category><![CDATA[docker-container]]></category>
            <dc:creator><![CDATA[Vaishnavi Shelke]]></dc:creator>
            <pubDate>Sun, 15 Jun 2025 16:52:00 GMT</pubDate>
            <atom:updated>2025-06-15T16:59:35.446Z</atom:updated>
            <content:encoded><![CDATA[<p>In this hands-on DevOps tutorial, we dive into Docker containerization, starting from setting up Docker on an EC2 Ubuntu instance to running and managing containers using both detached and interactive modes. You’ll learn how to host a custom website inside a container, understand port mapping, and clean up Docker resources effectively. Perfect for beginners building foundational DevOps skills.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5qe17ryJhb58_trm6TEi_Q.png" /></figure><h3>1. Launching an EC2 Instance</h3><p>We’ll begin by launching an Ubuntu EC2 instance in the <strong>Ohio (us-east-2)</strong> region.</p><ul><li>Instance Name: VM1</li><li>OS: Ubuntu (latest)</li><li>Keep all other settings default.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*53QBG9gt1b1v1Ftdb-sDJA.png" /></figure><p>Once the instance is running, connect via SSH:</p><pre>ssh -i your-key.pem ubuntu@[Public-IP]</pre><p>Set a custom hostname:</p><pre>sudo hostnamectl set-hostname vm1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DgNMnU1hG8DisHXNSWf6VQ.png" /></figure><h3>Installing Docker on Ubuntu</h3><p>Follow the official Docker documentation for the most up-to-date steps:</p><ul><li><a href="https://docs.docker.com/engine/install/ubuntu/">Set up Docker’s apt repository</a></li><li><a href="https://docs.docker.com/engine/install/ubuntu/">Install Docker Engine</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4nPqLPzI0-ed9PhuGCRylw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gOPRKvsimFncHQy4YruIGg.png" /></figure><p>Once done:</p><pre>docker --version</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kakKLxXiL68rFyksAkaryg.png" /></figure><p>You’ll see Docker’s version if installed correctly.</p><blockquote><strong><em>Note</em></strong><em>: On </em><strong><em>Ubuntu</em></strong><em>, Docker starts automatically after installation. On </em><strong><em>Amazon Linux</em></strong><em>, you might have to manually start the service.</em></blockquote><p>Check Docker’s status:</p><pre>sudo systemctl status docker</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eqAv5qWEZJgqwGD022uO3g.png" /></figure><h3>3. Docker Permission Fix</h3><p>If you see a “permission denied” error while using docker as the ubuntu user:</p><pre>sudo usermod -aG docker ubuntu<br>exit<br># Reconnect via SSH<br>ssh -i your-key.pem ubuntu@[Public-IP]</pre><p>Verify access:</p><pre>docker images</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C9qUtzbgaeJ0J9Kv45Y5PQ.png" /></figure><h3>4. Pulling an Image from Docker Hub</h3><p>Visit <a href="https://hub.docker.com/">Docker Hub</a> and search for httpd (Apache HTTP Server).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Py544A46ea0kPvZZ2JBXkg.png" /></figure><p>Then run:</p><pre>docker pull httpd</pre><p>Check available images:</p><pre>docker images</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FdjWI6HkyeL44zVCy-WbdQ.png" /></figure><h3>Creating a Container</h3><p>There are two modes:</p><ul><li><strong>Detached mode</strong>: Background execution</li><li><strong>Interactive mode</strong>: Shell access</li></ul><p>Create a container in detached mode:</p><pre>docker run -d httpd</pre><p>Check running containers:</p><pre>docker ps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YN8KjijiU2k0Wsqv9YY6xg.png" /></figure><p>To list all images:</p><pre>docker images ls</pre><p>To list all containers:</p><pre>docker container ls</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ozzcj0JxsqlTgUcRqZy6fw.png" /></figure><h3>6. Publishing a Port</h3><p>To make the container’s web server accessible:</p><pre>docker run -d --name con1 -p 9001:80 httpd</pre><pre>docker ps</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y6RHhmLIR5o5fWDn8pKcqA.png" /></figure><blockquote><em>✅ </em><strong><em>Explanation</em></strong><em>:</em></blockquote><blockquote>-p 9001:80 maps <strong>host port 9001</strong> to <strong>container port 80</strong>. Port is like an application-level address. Your server listens on port 80 inside the container, and 9001 is the door on your EC2 machine through which users can access it.</blockquote><p>Update security group in AWS:</p><ul><li>Add an inbound rule to allow TCP traffic on ports 9001–9020 from 0.0.0.0/0.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7VlL6PZzeiMRwLaxen1lvQ.png" /></figure><p>Access the site:</p><pre>http://[Public-IP]:9001</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TQ92G7vGONmW4f6DzDz-sA.png" /></figure><h3>7. Hosting a Custom Website</h3><p>Start shell access in interactive mode:</p><pre>docker exec -it con1 /bin/bash</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aghEEEWaWQxNKymv5RzTiA.png" /></figure><p>Navigate to Apache’s HTML directory:</p><pre>cd /usr/local/apache2/htdocs<br>ls</pre><p>To exit while keeping the container running:</p><ul><li>Press (read escape sequence)Ctrl + P followed by Ctrl + Q</li></ul><p>Create a custom HTML page on the host:</p><pre>mkdir data<br>cd data<br>nano index.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qnKO0jS4yjxM2Z2qqZpUJQ.png" /></figure><p>Copy the html code in nano editor &amp; <em>ctrl + s </em>to save then <em>ctrl + x </em>to exit:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*U1IshczyDK_bGbCnyT-j1A.png" /></figure><p>Copy it into the container:</p><pre>docker cp index.html con1:/usr/local/apache2/htdocs/index.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WuqFWJsJ5f6QDwrwlxLDWA.png" /></figure><p>Now visit the site again , it should show your custom page!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qcga6sCKZVDRi3fhvBAFwQ.png" /></figure><h3>8. Managing Containers</h3><ul><li>View container status:</li></ul><pre>docker ps          # Running<br>docker ps -a       # All</pre><ul><li>Stop and start:</li></ul><pre>docker container stop con1<br>docker container start con1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*os63c2oZu4xFjgNd_LxxaQ.png" /></figure><ul><li>Inspect or check logs:</li></ul><pre>docker inspect con1<br>docker logs con1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Jwg5v8E-fO1RwK_Fg4PHg.png" /></figure><h3>9. Trying Another Container (Alpine)</h3><p>Run Alpine in interactive mode:</p><pre>docker run -it --name a1 alpine /bin/sh</pre><p>Inside the container, check:</p><pre>id  # You&#39;ll see root</pre><p>To keep it running and exit:</p><pre>Ctrl + P then Ctrl + Q</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lCb6J8P2J6Xpg_7k8hmleQ.png" /></figure><ul><li>Reattach:</li></ul><pre>docker container attach a1</pre><ul><li>Stop/start:</li></ul><pre>docker container stop a1<br>docker container start a1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q6p9VzcGaEPliw9XJHkeEw.png" /></figure><ul><li>Remove container (This will only remove stopped container &amp; not running one):</li></ul><pre>docker container rm a1  </pre><ul><li>Remove a running container forcefully:</li></ul><pre>docker container rm -f a1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mgXDRZQ15pLRRGpBU9BjOA.png" /></figure><ul><li>Get Id’s of all containers</li></ul><pre>docker ps -aq</pre><ul><li>Remove all containers:</li></ul><pre>docker container rm -f $(docker ps -aq)</pre><ul><li>Remove all images:</li></ul><pre>docker rmi $(docker images -q)</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lsUygLvygpoVnYFcxhOZOg.png" /></figure><h3><strong>Summary Table: Docker Container Commands</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ti-QyOk0snu58bMEO-7mAg.png" /></figure><p><em>This walkthrough provides a hands-on experience in creating and managing Docker containers using real-world cloud infrastructure (EC2).</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4815f8779f5c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Beginner’s Guide to Instant Hosting: AWS Elastic Beanstalk + No‑IP]]></title>
            <link>https://medium.com/@vaishnavi_shelke/instant-free-hosting-elastic-beanstalk-no-ip-6c8973a534fe?source=rss-c33edb9ab13b------2</link>
            <guid isPermaLink="false">https://medium.com/p/6c8973a534fe</guid>
            <category><![CDATA[elastic-beanstalk]]></category>
            <category><![CDATA[hosting-service]]></category>
            <category><![CDATA[free-hosting]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <dc:creator><![CDATA[Vaishnavi Shelke]]></dc:creator>
            <pubDate>Fri, 18 Apr 2025 17:09:51 GMT</pubDate>
            <atom:updated>2025-04-18T17:14:13.949Z</atom:updated>
            <content:encoded><![CDATA[<p>In this guide, you’ll learn how to deploy a simple PHP (or static HTML/CSS) site on AWS Elastic Beanstalk and map it to an easy‑to‑remember free hostname from No‑IP. We begin with an overview of Elastic Beanstalk’s PaaS capabilities, clarify key concepts like environments, application versions, and saved configurations, then walk you through creating your Beanstalk application and environment, deploying your code, setting up dynamic DNS via No‑IP, and finally cleaning up resources when you’re done. By following these steps, you can have a fully hosted web application online in minutes at minimal cost.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*py6Yre38_WjYnWf7IY2_Xg.png" /></figure><h4>What Is AWS Elastic Beanstalk?</h4><p>AWS Elastic Beanstalk is a Platform as a Service (PaaS) that simplifies deployment, management, and scaling of web applications. You simply upload your code, Elastic Beanstalk automatically provisions servers, sets up load balancers, configures auto‑scaling groups, and monitors application health so you can focus solely on development. It abstracts away infrastructure management tasks like capacity provisioning, load balancing, auto‑scaling, and application health monitoring.</p><h4>Key Concepts</h4><ul><li><strong><em>Environments</em></strong> are the live deployments of a specific application version, each running its own set of AWS resources.</li><li><strong><em>Application Versions</em></strong> are immutable source bundles you upload (stored in S3), enabling rollbacks and version management.</li><li><strong><em>Saved Configurations</em></strong> are reusable templates of environment settings (platform, instance types, scaling rules, etc.) you can apply to new or existing environments.</li></ul><h4>Prerequisites</h4><ul><li>An AWS account with permissions to create Elastic Beanstalk applications, IAM roles, and EC2 instances.</li><li>A No‑IP account for free dynamic DNS (DDNS).</li></ul><h3>1] Creating Your Elastic Beanstalk Application</h3><h3>1.1 Create the Application &amp; Environment</h3><ol><li><strong>Search for Elastic Beanstalk</strong> in the AWS Management Console and choose <strong>Create Application</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*L2vMYSa62zESsjPs6RwZag.png" /></figure><p><strong>2. Configure Environment (Step 1):</strong></p><ul><li><strong>Environment tier:</strong> Web server environment</li><li><em>Web server environments</em> run web servers (Apache/Nginx) and route HTTP(S) requests directly <a href="https://stackoverflow.com/questions/43302799/what-are-the-difference-between-worker-tier-and-web-tier-in-aws-beanstalk?utm_source=chatgpt.com">Stack Overflow</a>.</li><li><em>Worker environments</em> run background‑processing daemons that pull tasks from an SQS queue <a href="https://www.hava.io/blog/what-is-aws-elastic-beanstalk?utm_source=chatgpt.com">Hava</a>.</li><li><strong>Application name:</strong> abckart</li><li><strong>Domain:</strong> abc1</li><li><strong>Platform:</strong> PHP (or your language of choice)</li><li><strong>Application code:</strong> Sample application</li><li><strong>Presets:</strong> Single instance (Free Tier eligible)</li><li>Click <strong>Next</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZV_8Pn02bPqNekXjTKe75g.png" /></figure><h3>1.2 Configure Service Access</h3><ol><li><strong>Service role (Step 2):</strong></li></ol><ul><li>If you already have an IAM service role, select it; otherwise choose <strong>Create and use new service role</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f2CJTndl3MAXYE8-7FlPkg.png" /></figure><ul><li>To create a new service role:</li></ul><ol><li>Open the <strong>IAM</strong> console → <strong>Roles</strong> → <strong>Create role</strong>.</li><li>For <em>Trusted entity type</em>, choose <strong>AWS service</strong>; for <em>Use case</em>, select <strong>EC2</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Em5t1Qhwkg_b4jiIe47zvQ.png" /></figure><p>3. (Optional) <strong>Skip</strong> adding permissions for now, then click <strong>Next</strong>.</p><p>4. Name the role r1 and finish the wizard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wbZYRh_Cls8vla7Owxi5Cg.png" /></figure><ul><li>Back in the Elastic Beanstalk wizard, select role r1 and click <strong>Next</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cX85I-NVSybgnAZiWJASAA.png" /></figure><h3>1.3 Set Up Networking, Database &amp; Tags</h3><ul><li>(Step 3) Leave all defaults (VPC, subnets, database settings, tags) and click <strong>Next</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vdDy633zG8mVApaC1TpyBA.png" /></figure><h3>1.4 Configure Instance Traffic &amp; Scaling</h3><ul><li>(Step 4)</li><li><strong>Root volume type:</strong> Container default</li><li><strong>Amazon CloudWatch monitoring:</strong> 5‑minute intervals (Standard; 1‑minute is detailed monitoring and may incur costs).</li><li><strong>Capacity:</strong> Single instance (min = max = 1)</li><li><strong>Instance Types:</strong> Keep only <strong>t3.micro</strong> (free tier)</li><li>Click <strong>Next</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z2bUXzXCmloKgz9vRd5BqQ.png" /></figure><h3>1.5 Monitoring &amp; Logging</h3><ul><li>(Step 5) Keep defaults for log rotation, notifications, and click <strong>Next</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1sKnLkGnffj2SPbcDbcwHA.png" /></figure><h3>1.6 Review &amp; Launch</h3><ul><li>(Step 6) Review all settings, then click <strong>Submit</strong>.</li><li>Wait a few minutes for Elastic Beanstalk to provision resources and launch your environment.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qgc8Xv1kDB3DQUiPX_UqPQ.png" /></figure><h3>2] Deploying Your Application</h3><ol><li>In the meantime, create a simple HTML/CSS site and package it as v1.zip.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DbW3aqQAxUgO-OcAZNmuIg.png" /></figure><p>2. Back in the EB console, navigate to <strong>Environments → abckart-new</strong> → <strong>Upload &amp; Deploy</strong>.</p><p>3. Select v1.zip and click <strong>Deploy</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XlGxOSECKJmJeFir7MFiog.png" /></figure><p>4. After deployment, your site is live at the Elastic Beanstalk URL, e.g.: <em>http://abc1.eu-west-2.elasticbeanstalk.com/</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2dohU77sUPuCQhnqqyLb2w.png" /></figure><h3>3] Mapping a Free Hostname with No‑IP</h3><ol><li>Go to <strong>Dynamic DNS</strong> in your No‑IP dashboard, click <strong>Create Hostname</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mkfu5R4iOCu2Z2zwJgdyOA.png" /></figure><p><strong>2. Hostname:</strong> vss</p><p><strong>3. Domain:</strong> choose any free (e.g. sytes.net)</p><p><strong>4. Record Type:</strong> DNS Alias (CNAME)</p><p><strong>5. Target:</strong> abc1.eu-west-2.elasticbeanstalk.com</p><p>6. Click <strong>Create Hostname</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qv94KBmVVbkxFtQcmeCOJQ.png" /></figure><p>Your site is now accessible at: <a href="http://vss.sytes.net/"><em>http://vss.sytes.net</em></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YCTwdb9bEUrsmvbPq9p2Yw.png" /></figure><h3>4] Cleaning Up</h3><p>To avoid ongoing charges:</p><ol><li>In the Elastic Beanstalk console, go to <strong>Applications</strong>. <br>2. Select your application (`abckart`), click <strong>Actions</strong> → <strong>Delete Application</strong>. <br>3. Confirm deletion (this removes environments, versions, and saved configurations).</li></ol><p><em>By following these steps, you’ve deployed a web application on AWS Elastic Beanstalk and given it a memorable, free hostname via No‑IP , without touching complex DNS configurations or incurring extra costs.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6c8973a534fe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Create a NAT Gateway in AWS]]></title>
            <link>https://medium.com/@vaishnavi_shelke/create-a-nat-gateway-in-aws-3d6ab64cea13?source=rss-c33edb9ab13b------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d6ab64cea13</guid>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[nat-gateway]]></category>
            <dc:creator><![CDATA[Vaishnavi Shelke]]></dc:creator>
            <pubDate>Wed, 16 Apr 2025 17:31:21 GMT</pubDate>
            <atom:updated>2025-04-18T17:11:32.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wOAMK4Dow99AYzBbDxc-Kw.png" /></figure><p>In this guide, we will walk through setting up a NAT Gateway in AWS using a pre-configured VPC and subnets. Here we already have a VPC named <strong>ProjectionDigital_Prod</strong> in the London region with two subnets:</p><ul><li><strong>sub1</strong>: Public subnet (has public IP assignments)</li><li><strong>sub2</strong>: Private subnet (no direct public IP connectivity)</li></ul><p>Before you proceed, if you need guidance on creating a VPC, check out <a href="https://medium.com/@vaishnavi_shelke/step-by-step-guide-to-creating-a-vpc-in-aws-df7736f1493b">this detailed article on creating a VPC in AWS</a>.</p><h3>1. Creating a Custom Route Table</h3><p><strong>Route Table:</strong> A route table is a set of rules (called routes) that direct network traffic within your VPC. These routes determine where network packets are forwarded.</p><ol><li>Navigate to <strong>VPC → Route Tables</strong> in the AWS Management Console.</li></ol><p>2. Click on <strong>Create route table</strong> and configure the following:</p><ul><li><strong>Name:</strong> CustRT1-Projection</li><li><strong>VPC:</strong> vpc-ProjectionDigital_Prod</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RIW6BSjJrM1dqYtq30TQJQ.png" /></figure><p>3. Once created, select <strong>CustRT1-Projection</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UB05hgkgZppa0iDZFUTX7A.png" /></figure><p>4. Go to the <strong>Subnet Associations</strong> tab, click <strong>Edit subnet associations</strong> (ensure you choose explicit association), and check <strong>sub2</strong> (your private subnet). Click <strong>Save associations</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OljK6NInWodSy6-eJmhVXA.png" /></figure><p>Your private subnet (sub2) is now explicitly associated with the custom route table.</p><h3>2. Launching EC2 Instances</h3><p>To simulate a practical scenario, we will launch two EC2 instances:</p><ol><li><strong>ins1</strong> in the public subnet (sub1):</li></ol><ul><li><strong>Name:</strong> ins1</li><li><strong>Instance Type:</strong> Amazon Linux</li><li><strong>VPC:</strong> vpc-ProjectionDigital_Prod</li><li><strong>Subnet:</strong> sub1</li></ul><p><strong>2. ins2</strong> in the private subnet (sub2):</p><ul><li><strong>Name:</strong> ins2</li><li><strong>Instance Type:</strong> Amazon Linux</li><li><strong>VPC:</strong> vpc-ProjectionDigital_Prod</li><li><strong>Subnet:</strong> sub2</li></ul><p>If you are unsure how to launch an EC2 instance, please refer to <a href="https://medium.com/@vaishnavi_shelke/launch-an-ec2-instance-and-host-a-basic-website-amazon-linux-39d6f1575208">this guide on launching an EC2 instance</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*opy36qIHRWysB6bxZs_tKg.png" /></figure><h3>3. Configuring SSH Between Instances</h3><h4>Step 1: SSH into the Public Instance</h4><p>SSH to <strong>ins1</strong> using your key pair. For example:</p><pre>ssh -i /path/to/key-open.pem ec2-user@[public_IP_of_ins1]</pre><p>After connecting, set the hostname on <strong>ins1</strong>:</p><pre>sudo hostnamectl sethostname ins1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hdjoYPikj1H6kfStjL-9Jg.png" /></figure><h4>Step 2: Prepare for SSH to Private Instance</h4><p>To SSH from <strong>ins1</strong> to <strong>ins2</strong>, you need to ensure <strong>ins1</strong> has the required SSH private key file that your local machine used. Follow these instructions:</p><ol><li><strong>Transfer the Private Key to ins1:</strong></li></ol><p>Use a tool like <strong>WinSCP</strong> (a free SFTP client) to transfer the private key file (e.g., key-open.pem) from your PC to <strong>ins1</strong>.</p><ul><li><strong>File Protocol:</strong> SCP</li><li><strong>Hostname:</strong> [public IP of ins1]</li><li><strong>Username:</strong> ec2-user</li><li>Use your private key (e.g., key-putty.ppk) for authentication while connecting with WinSCP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8xhuM9a9tU86lhPaVkdSmg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-qigT1DmuB-i1G_KRzNK-w.png" /></figure><p><strong>2. Change File Permissions on ins1:</strong></p><ul><li>Once the private key is uploaded, list the file details using:</li></ul><pre>ls -l key-open.pem</pre><p>Since the file may have broad read permissions, secure it by changing the permission:</p><pre>sudo chmod 400 key-open.pem</pre><p>Re-check permissions with:</p><pre>ls -l key-open.pem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l9n2GqDEyS7xtXvLhsmORg.png" /></figure><h4>Step 3: SSH from ins1 to ins2</h4><p>With the correct permissions set on the key, SSH to <strong>ins2</strong> using its private IP:</p><pre>ssh -i key-open.pem ec2-user@[private_IP_of_ins2]</pre><p>You are now connected to the private instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O8McDQ9WR2-w61NLGfpcvg.png" /></figure><h3>4. Implementing the NAT Gateway</h3><p>After setting up inter-instance SSH, let’s address the network connectivity issue. Although <strong>ins2</strong> is in a private subnet, it needs outbound internet access (for example, to install Docker). However, by default, the private subnet does not have internet connectivity.</p><p><strong>Key Definitions:</strong></p><ul><li><strong>NAT Gateway:</strong> A NAT (Network Address Translation) Gateway is an AWS managed service that allows instances in a private subnet to access the internet or other AWS services while preventing the internet from initiating inbound connections.</li><li><strong>Elastic IP:</strong> An Elastic IP is a static public IPv4 address designed for dynamic cloud computing. It ensures that even if an instance stops and starts again, the public IP remains constant.</li></ul><h3>Steps to Set Up the NAT Gateway:</h3><ol><li><strong>Create the NAT Gateway:</strong></li></ol><ul><li>Navigate to <strong>VPC → NAT Gateways</strong>.</li><li>Click <strong>Create NAT Gateway</strong>.</li><li><strong>Name:</strong> ngw1</li><li><strong>Subnet:</strong> Select <strong>sub1</strong> (the public subnet).</li><li><strong>Connectivity Type:</strong> Public.</li><li><strong>Elastic IP:</strong> Allocate a new Elastic IP by clicking on <strong>Allocate Elastic IP</strong> and assign it.</li><li>Click <strong>Create NAT Gateway</strong> and wait until it’s available.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GaacRUxqGO4VdFGPV2lwTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qN1vSftY3UG66Rn_hfE2BQ.png" /></figure><p><strong>2. Update the Custom Route Table:</strong></p><ul><li>Navigate back to <strong>VPC → Route Tables</strong> and select CustRT1-Projection.</li><li>Click <strong>Edit routes</strong> and add a new route:</li><li><strong>Destination:</strong> 0.0.0.0/0</li><li><strong>Target:</strong> Select the NAT Gateway (ngw1) that you just created.</li><li>Save the changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pvSZUT82ImLnolGqnVBrNQ.png" /></figure><p><strong>3. Test Internet Connectivity on ins2:</strong></p><p>With the above configuration, <strong>ins2</strong> in the private subnet should now have internet connectivity. You can test it by running:</p><pre>sudo yum install docker -y</pre><p>If installation proceeds, your NAT Gateway is correctly routing traffic from <strong>ins2</strong> to the internet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bDpn9oZrl1JeUgiqos-M5g.png" /></figure><h3>5. Cleanup Reminder</h3><p><strong>Important Note:</strong></p><ul><li><strong>NAT Gateway charges apply.</strong> If you are merely practicing or testing, ensure that you delete the NAT Gateway after completion to avoid unwanted costs.</li><li>Also, remember to <strong>release the Elastic IP</strong>, and <strong>delete the launched instances and custom route table</strong> once you’re done.</li></ul><p><em>By following these steps, you can enable outbound internet connectivity for instances residing in private subnets while keeping them shielded from inbound public traffic. This is essential for many production and test environments, ensuring a robust and secure network architecture on AWS.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d6ab64cea13" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inter-VPC Peering Connection in AWS Across Regions]]></title>
            <link>https://medium.com/@vaishnavi_shelke/inter-vpc-peering-connection-in-aws-across-regions-458937df28bb?source=rss-c33edb9ab13b------2</link>
            <guid isPermaLink="false">https://medium.com/p/458937df28bb</guid>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[vpc-peering]]></category>
            <dc:creator><![CDATA[Vaishnavi Shelke]]></dc:creator>
            <pubDate>Tue, 01 Apr 2025 14:31:43 GMT</pubDate>
            <atom:updated>2025-04-01T14:35:30.633Z</atom:updated>
            <content:encoded><![CDATA[<p>In AWS, VPC peering enables secure, private communication between Virtual Private Clouds (VPCs) even if they reside in different regions or accounts. In this guide, we’ll walk through a practical example of how to set up a peering connection between two VPCs in different regions London and Tokyo. We’ll cover everything from launching instances and creating the peering connection to updating route tables and security groups to allow proper communication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z0NhbpRIOZyVWD-tx_2zOA.png" /></figure><p>For this practical guide, you already have two VPCs and two EC2 instances set up in different regions.</p><p><strong>London Region:</strong></p><ul><li><strong>VPC Name:</strong> Projection_Digital_Prod</li><li><strong>Instance Name:</strong> ins1 (has a public IP address)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lFP6DrjFYXbcDZkbB6lr2Q.png" /></figure><p><strong>Tokyo Region:</strong></p><ul><li><strong>VPC Name:</strong> Lighttale_Prod</li><li><strong>Instance Name:</strong> API-Srv (has a private IP address)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ATzAtnGvi9U_QvXMBUOCzw.png" /></figure><blockquote>For more background on setting up your VPC and launching EC2 instances, check out these resources:</blockquote><blockquote><a href="https://medium.com/@vaishnavi_shelke/step-by-step-guide-to-creating-a-vpc-in-aws-df7736f1493b">How to Create a VPC in AWS</a></blockquote><blockquote><a href="https://medium.com/@vaishnavi_shelke/launch-an-ec2-instance-and-host-a-basic-website-amazon-linux-39d6f1575208">Launching an EC2 Instance and Hosting a Website</a></blockquote><h3><strong>Step 1: Accessing the Public Instance</strong></h3><p>Since the instance in London (ins1) has a public IP, you can connect to it from your laptop. Use SSH to connect:</p><pre>ssh -i /path/to/key.pem ec2-user@&lt;ins1_public_ip&gt;</pre><p>Once connected, you might want to update its hostname for clarity:</p><pre>sudo hostnamectl set-hostname ins1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SA3A3rBZXz4A3K4CfMxAnQ.png" /></figure><p>Try pinging the Tokyo instance (API-Srv) using its private IP. It will fail at this stage because no peering connection exists yet.</p><pre>ping &lt;API-Srv_private_ip&gt;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lntkVdYHAA4zVqGxKj6VWQ.png" /></figure><h3>Step 2: Creating the VPC Peering Connection</h3><ol><li><strong>Collect VPC IDs:</strong></li></ol><ul><li>In the London region, note the VPC ID of Projection_Digital_Prod.</li><li>In the Tokyo region, note the VPC ID of Lighttale_Prod.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*caxwZyeexp3we6E1HZoiiw.png" /></figure><p><strong>2. Initiate the Peering Connection:</strong></p><ul><li>In the Tokyo region, navigate to <strong>VPC &gt; Peering Connections &gt; Create Peering Connection</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3VNLC6D2JsZRS8WGdYfoZA.png" /></figure><ul><li>Set the <strong>Name</strong> to something descriptive like tok-lon.</li><li>For the requester VPC, enter the ID of Lighttale_Prod (Tokyo).</li><li>Choose the appropriate <strong>Account</strong> (use “My Account” if both VPCs are under the same AWS account; otherwise, select the correct account).</li><li>Under <strong>Region</strong>, select “Another Region” and choose London.</li><li>Enter the VPC ID for the London VPC (Projection_Digital_Prod).</li><li>Click <strong>Create Peering Connection</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z8-BwA6IIXVZBDGXjCSwqA.png" /></figure><p><strong>3. Accept the Request:</strong></p><ul><li>In the London region, locate the peering connection (it will show as “pending acceptance”).</li><li>Select the connection (e.g., Lon-Tok) and choose <strong>Actions &gt; Accept Request</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oldAyppxpvzuUAARtzWG9Q.png" /></figure><h3><strong>Step 3: Updating Route Tables for Traffic Flow</strong></h3><p>Now that the peering connection is established, update the route tables in both VPCs so that traffic can traverse between them.</p><p><strong>London Region:</strong></p><ul><li>Go to <strong>VPC &gt; Route Tables</strong> and select the route table associated with your Projection_Digital_Prod VPC.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mq1FWV7ZPwmdzLAQOhJGBw.png" /></figure><ul><li>Edit routes to add a new route with the destination set to the Tokyo VPC’s CIDR block (for example, 192.168.0.0/16), and the target set to the peering connection (e.g., pcx-xxxxxx).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q25zV2yFdQWx0GER44iUdQ.png" /></figure><p><strong>Tokyo Region:</strong></p><ul><li>Similarly, go to <strong>VPC &gt; Route Tables</strong> and select the route table for your Lighttale_Prod VPC.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0trODgVaPVDuPWygyVY0Ag.png" /></figure><ul><li>Add a route with the destination set to the London VPC’s CIDR block (for example, 10.33.0.0/24), and the target set to the corresponding peering connection.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uTGzMDO2da2G94xg-2s7Iw.png" /></figure><h3><strong>Step 4: Adjusting Security Groups for ICMP Traffic</strong></h3><p>Even with the peering connection and correct routes, you might not be able to ping between instances if ICMP traffic is blocked.</p><ul><li>In the Tokyo region, select the security group attached to the API-Srv instance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yROn8KRLfFUoMU2sUgP72w.png" /></figure><ul><li>Edit the inbound rules to add a new rule allowing <strong>All ICMP — IPv4</strong> traffic from the appropriate source (e.g., 0.0.0.0/0 or a more restricted range, based on your security requirements).</li><li>Save the changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xc3h6WouTq94jSSpgutMMA.png" /></figure><h3><strong>Step 5: Verifying the Peering Connection</strong></h3><p>After configuring the peering connection, route tables, and security groups, try pinging the private IP of the API-Srv instance from ins1. If everything is set up correctly, you should now receive replies, confirming that the peering connection is working and that the two VPCs can communicate securely.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wz1RzOc6PpgK7-ABJTg0qQ.png" /></figure><blockquote><strong>Conclusion</strong><br> This practical guide demonstrates how to establish a VPC peering connection between two VPCs in different regions, allowing secure communication between public and private instances. By carefully setting up peering, updating route tables, and adjusting security settings, you can integrate separate AWS environments seamlessly. Happy networking!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=458937df28bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Step-by-Step Guide to Creating a Fully Functional VPC in AWS]]></title>
            <link>https://medium.com/@vaishnavi_shelke/step-by-step-guide-to-creating-a-vpc-in-aws-df7736f1493b?source=rss-c33edb9ab13b------2</link>
            <guid isPermaLink="false">https://medium.com/p/df7736f1493b</guid>
            <category><![CDATA[network]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[vpc]]></category>
            <dc:creator><![CDATA[Vaishnavi Shelke]]></dc:creator>
            <pubDate>Sun, 23 Mar 2025 14:50:54 GMT</pubDate>
            <atom:updated>2025-03-23T14:57:17.852Z</atom:updated>
            <content:encoded><![CDATA[<p>This guide walks you through setting up a basic VPC in the London region with subnets, an Internet Gateway, and proper routing all essential for launching your EC2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QPhfNdOc8Em1vaEmJJXjmQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/874/1*vVLQJebVmyHBdLixIIaawg.png" /></figure><h3>1. Create the VPC</h3><ul><li><strong>Access the AWS Console:</strong><br> In the AWS console, search for “VPC” and select your VPC dashboard.</li><li><strong>Start VPC Creation:</strong><br> Click on the <strong>Create VPC</strong> button.<br> Since we’re creating a VPC in the London region, ensure that the correct region is selected.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5tjtI9iUMnv3zkKNZBQ0PA.png" /></figure><p><strong>Configure VPC Settings:</strong></p><ul><li><strong>VPC Only:</strong> Select the radio button for “VPC only.”</li><li><strong>Name:</strong> Enter a name, e.g., <em>ProjecctionDigital_Prod</em>.</li><li><strong>IPv4 CIDR Block:</strong> Set it to <em>10.33.0.0/16</em>.</li><li><strong>IPv6 CIDR Block:</strong> Choose <em>No IPv6 CIDR Block</em>.</li><li><strong>Tenancy:</strong> Select <em>Default</em>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BydcJLkqG85_dgnrm2ZMqQ.png" /></figure><p><strong>Finalize:</strong><br> Click <strong>Create VPC</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nn3R9XGFmaPH5a1XL_CaLg.png" /></figure><h3>2. Create Subnets</h3><p><strong>Navigate to Subnets:</strong><br> Within your VPC dashboard, go to the <strong>Subnets</strong> section and click <strong>Create Subnet</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qj-BhMvmTMy4ikhBaEI9vw.png" /></figure><p><strong>Subnet 1:</strong></p><ul><li><strong>Select VPC:</strong> Choose the VPC you just created.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QhHZueCqtOhznPbWGQBK1A.png" /></figure><ul><li><strong>Name:</strong> Enter a name (e.g., <strong>sub1</strong>).</li><li><strong>Availability Zone:</strong> Select <strong>eu-west-2a</strong>.</li><li><strong>IPv4 CIDR Block:</strong> Set it to <strong>10.33.1.0/24</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZJjgrQlwkiUiroZLmUIoww.png" /></figure><p><strong>Subnet 2:</strong></p><ul><li>Click on <strong>Add New Subnet</strong> and configure:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hCvl2qeHVOkv4buqNVtPmQ.png" /></figure><ul><li><strong>Name:</strong> Enter <strong>sub2</strong>.</li><li><strong>Availability Zone:</strong> Select <strong>eu-west-2b</strong>.</li><li><strong>IPv4 CIDR Block:</strong> Set it to <strong>10.33.2.0/24</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hnDC-g71UcL0du8tTeDkPA.png" /></figure><p><strong>Finalize:</strong><br> Click <strong>Create Subnet</strong> to provision both subnets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P7ZM6Iy4viJkVNBEgGebmA.png" /></figure><h3>3. Attach an Internet Gateway</h3><p><strong>Create the Internet Gateway:</strong><br> In the VPC dashboard, go to <strong>Internet Gateways</strong> and click <strong>Create Internet Gateway</strong>.</p><ul><li><strong>Name:</strong> Enter a name (e.g., <strong>GW1</strong>).</li><li>Click <strong>Create Internet Gateway</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*afi--wdNuTV-mKEiAITV8g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Cq8ikiufkofKH4Uf4qPIFQ.png" /></figure><p><strong>Attach to Your VPC:</strong></p><ul><li>Select <strong>GW1</strong>.</li><li>Go to <strong>Actions</strong> and choose <strong>Attach to VPC</strong>.</li><li>Select your VPC and click <strong>Attach Internet Gateway</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RsjzIogT2JFBwsiYnifbiA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*imOmJb1qLnOA6OtkQbJT-g.png" /></figure><p>This step establishes the necessary connection to the internet.</p><h3>4. Configure the Route Table</h3><ul><li><strong>Locate the Main Route Table:</strong><br> When you create a VPC, AWS automatically provisions a main route table, a default security group, and a default access control list.<br> Rename the default route table to <strong>MainRT</strong> for clarity.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jimH-aOPWhj6H_f6grwhaQ.png" /></figure><p><strong>Edit Routes:</strong></p><ul><li>Select <strong>MainRT</strong> and navigate to the <strong>Routes</strong> tab.</li><li>Click <strong>Edit Routes</strong>, then <strong>Add Route</strong>.</li><li>Set <strong>Destination:</strong> 0.0.0.0/0</li><li>Set <strong>Target:</strong> Choose the Internet Gateway (i.e., <strong>GW1</strong>).</li><li>Click <strong>Save Changes</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rhsz_Zh9Ow_i_Ddxqhl04g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wgExmYMJVU7D8buyq89WrA.png" /></figure><p><strong>Enable Public IP for Subnet 1:</strong></p><ul><li>Go to <strong>Subnets</strong>, select <strong>sub1</strong>, and click on <strong>Actions</strong> → <strong>Edit Subnet Settings</strong>.</li><li>Under <strong>Auto-Assign IP Settings</strong>, check the box for <strong>Enable auto-assign public IPv4 address</strong>.</li><li>Save the changes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1NkG9EsXU61ExPEqO6ZOYg.png" /></figure><h3>5. Launch an EC2 Instance</h3><p>Now that your VPC and its components are set up, you can launch an EC2 instance within your VPC. For guidance on launching an instance, refer to <a href="https://medium.com/@vaishnavi_shelke/launch-an-ec2-instance-and-host-a-basic-website-amazon-linux-39d6f1575208"><em>this article</em></a>.</p><ul><li><strong>Instance Launch Considerations:</strong><br> During the launch process:</li><li>Click <strong>Edit</strong> in the network settings.</li><li>Select your VPC.</li><li>Add a security group with the following settings:<br> <strong>Port Range:</strong> 80<br> <strong>Source:</strong> 0.0.0.0/0</li></ul><p>Proceed with the instance launch once the configuration is complete.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2ijzG6r2Pic7x_fJ0LYVnA.png" /></figure><p><strong><em>This is how you can create a fully functional VPC to launch your instances, opening the door to a scalable, secure, and robust AWS environment.</em></strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df7736f1493b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Launch an EC2 Instance and Host a Basic Website (Amazon Linux)]]></title>
            <link>https://medium.com/@vaishnavi_shelke/launch-an-ec2-instance-and-host-a-basic-website-amazon-linux-39d6f1575208?source=rss-c33edb9ab13b------2</link>
            <guid isPermaLink="false">https://medium.com/p/39d6f1575208</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon-linux]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Vaishnavi Shelke]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 18:18:40 GMT</pubDate>
            <atom:updated>2025-03-07T03:51:30.630Z</atom:updated>
            <content:encoded><![CDATA[<p>In this article, we’ll go step by step to launch an EC2 instance using Amazon Linux and host a basic HTML &amp; CSS website. This guide is designed for beginners, making it easy to understand and follow.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w_NLlr5AuNr-5VXHs7rJfw.png" /></figure><h4>1. Launch an EC2 Instance</h4><ol><li>Go to the <strong>AWS EC2 Dashboard</strong>.</li><li>Click on <strong>Instances</strong> → <strong>Launch Instance</strong>.</li><li>Provide a name for your instance.</li><li>Select <strong>Amazon Linux</strong> as the operating system.</li><li>Choose <strong>Instance Type</strong> → Select <strong>t2.micro</strong> (Free Tier eligible).</li><li>Select or create a <strong>Key Pair</strong> (used for secure SSH access).</li><li>Under <strong>Network Settings</strong>, check <strong>Allow HTTP traffic from the internet</strong>.</li><li>Click on <strong>Launch Instance</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lPtASMkomdygrywv9xxHQQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M_62M5K-Cq0nx0_-IdMI7g.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_cX3_qRb8hWLrm2-B9CYnw.png" /></figure><h4>2. Connect to the EC2 Instance</h4><ol><li>Go to the <strong>Instances</strong> section in the EC2 Dashboard.</li><li>Select your instance and click <strong>Connect</strong>.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m5Pp65CIFWEJOmTBbCr0Xg.png" /></figure><p>3. Open <strong>Windows PowerShell</strong> (or any terminal).</p><p>4. Navigate to the directory where your downloaded <strong>.pem</strong> key file is located.</p><p>5. Connect to the instance using the following SSH command:</p><pre>ssh -i key1.pem ec2-user@your-public-ip</pre><p>6. If prompted, type <strong>yes</strong> and press Enter. Your instance is now connected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*roKMJbiB6x_38O-rN55r_A.png" /></figure><h4>3. Change Hostname (Optional)</h4><ol><li>To change the hostname, run :</li></ol><pre>sudo hostnamectl set-hostname vm1</pre><p>2. Restart the SSH connection:</p><pre>ssh -i key1.pem ec2-user@your-public-ip</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jVBpTBMqypwBmykoXThvtg.png" /></figure><h4>4. Install Apache Web Server</h4><ol><li>Install Apache (httpd package) using:</li></ol><pre>sudo yum install httpd</pre><p>2. Press <strong>Y</strong> when prompted to confirm installation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kv0ejrPRVFtw292xRffHNA.png" /></figure><h4><strong>5. Start and Enable Apache</strong></h4><ol><li>Check Apache service status:</li></ol><p>(By default, it will be inactive/disabled.)</p><pre>sudo systemctl status httpd</pre><p>2. Start Apache:</p><pre>sudo systemctl start httpd</pre><p>3. Verify the service is running:</p><pre>sudo systemctl status httpd</pre><p>4. Enable Apache to start automatically on reboot:</p><pre>sudo systemctl enable httpd</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hX1RoanwIKV1vqxxp2cMUA.png" /></figure><h4>6. Host a Custom HTML &amp; CSS Website</h4><ol><li>Navigate to Apache’s default web directory:</li></ol><pre>cd /var/www/html</pre><p>2. Create an <strong>index.html</strong> file using Nano editor:</p><pre>sudo nano index.html</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l8OvafoxRMGUJrJWA__IeQ.png" /></figure><p>3. Paste your HTML code, then save and exit:</p><ul><li>Press <strong>Ctrl + S</strong> to save.</li><li>Press <strong>Ctrl + X</strong> to exit.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oVnkwN8s8G9z_JYULBnk5A.png" /></figure><p>4. Create a <strong>style.css</strong> file (if needed):</p><pre>sudo nano style.css</pre><p>5. Paste your CSS code, save, and exit (Ctrl + S → Ctrl + X).</p><p>6. List files to verify:</p><pre>ls</pre><p>(You should see index.html and style.css.)</p><p>7. Open your website in a browser using your <strong>Public IP Address</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v-VJR_JAjvWv0Glu1gR3ww.png" /></figure><h4>7. Stop or Delete the EC2 Instance</h4><ul><li><strong>To stop the instance</strong> (stops the server but storage charges still apply):</li><li>→ Go to <strong>Instances</strong> → Select your instance → Click <strong>Stop Instance</strong>.</li><li><strong>To delete the instance permanently</strong>:</li><li>→ Go to <strong>Instances</strong> → Select your instance → Click <strong>Terminate Instance</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nOg0z4XYgY83qk1kEDrHfQ.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39d6f1575208" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding AWS Key Pairs]]></title>
            <link>https://medium.com/@vaishnavi_shelke/understanding-aws-key-pairs-b3b4d13b254f?source=rss-c33edb9ab13b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3b4d13b254f</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ssh-keys]]></category>
            <category><![CDATA[puttygen]]></category>
            <category><![CDATA[aws-key-pair]]></category>
            <dc:creator><![CDATA[Vaishnavi Shelke]]></dc:creator>
            <pubDate>Wed, 05 Mar 2025 18:04:22 GMT</pubDate>
            <atom:updated>2025-03-06T03:36:52.272Z</atom:updated>
            <content:encoded><![CDATA[<p>AWS key pairs are a fundamental security mechanism used to access Amazon EC2 instances. In this article, we’ll cover what key pairs are, why they’re important, how to create them both through the AWS Management Console (EC2) and using PuTTY, and the different file types involved in the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ATivMR7Acb_Kyhw0nakthA.png" /></figure><h3>What Are AWS Key Pairs?</h3><p>An AWS key pair consists of a public key and a private key that work together as cryptographic credentials. When you launch an EC2 instance, you assign it a key pair. The public key is stored on the instance, while the private key remains with you. When you connect to the instance (for example, via SSH), you use your private key to verify your identity. This method eliminates the need for traditional password-based logins, making it both secure and convenient.</p><h3>Why Do We Use AWS Key Pairs?</h3><ol><li><strong>Enhanced Security:</strong> Key pairs are more secure than passwords since the private key is required for access.</li><li><strong>Automation Friendly:</strong> They enable seamless automated access for scripts, configuration management, and DevOps.</li><li><strong>No Extra Cost:</strong> AWS generates key pairs for free as metadata during instance launch.</li><li><strong>Ease of Use:</strong> Quickly set up secure access across multiple instances, though using different keys for separate projects is recommended.</li></ol><h3>Understanding Key Pair Files</h3><ol><li><strong>.pem </strong>(Privacy Enhanced Mail)<strong>: </strong>A text file with your private key, used mainly on Linux and macOS or via AWS CLI.</li><li><strong>.ppk </strong>(PuTTY Private Key)<strong>: </strong>The same private key as in the .pem file, but formatted for PuTTY on Windows.</li><li><strong>.pub </strong>(Public Key)<strong>: </strong>A file containing your public key, which you can share or import into AWS.</li></ol><h3><strong>How to Create a Key Pair in EC2</strong></h3><ol><li><strong>Access EC2:</strong> Log in to the AWS Management Console and select the EC2 service.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3XBayTYMW1kCsEKIw3JhZg.png" /></figure><p>2. <strong>Navigate to Key Pairs:</strong> In the left-hand menu under <strong>Network &amp; Security</strong>, click on <strong>Key Pairs</strong>. Click the <strong>Create key pair</strong> button.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*orDAY8OCftATCodYdSmiEQ.png" /></figure><p>3. <strong>Configure Details:</strong> Enter a descriptive name for your key pair, select your preferred file format (e.g., <strong>.pem</strong> for Linux/Mac or <strong>.ppk</strong> for Windows/PuTTY), and confirm the settings. Click <strong>Create key pair</strong> to generate the key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hqUbtGgaaVpFkmuk_NwJqw.png" /></figure><p>4. Your private key file will be automatically downloaded</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EvoZ9SOe9NKi7fz6xUN_YA.png" /></figure><h3>How to Create/Use Key Pairs with PuTTY</h3><p>PuTTY is a popular SSH client for Windows, but it requires the private key to be in PuTTY’s proprietary .ppk format. Here’s how to work with PuTTY and AWS key pairs:</p><ol><li><strong>Download PuTTY: </strong>Visit the official PuTTY website and download the appropriate version (e.g., 64-bit x86).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kDL_vWbTOFcEaIKTnp3piQ.png" /></figure><p>2. <strong>Launch PuTTYgen:</strong></p><ul><li>Open PuTTY Key Generator (PuTTYgen).</li><li>Click the <strong>Generate</strong> button and move your mouse within the window to generate the key.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M0KpoKG_65LCdTFH-bHQng.png" /></figure><p>3. <strong>Save the Public Key:</strong></p><ul><li>Click <strong>Save public key</strong>.</li><li>Save the file with a <strong>.pub</strong> extension.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mlGtaht2PtnrqVg5yqFTgA.png" /></figure><p>4. <strong>Save the Private Key (PuTTY Format):</strong></p><ul><li>Click <strong>Save private key</strong>.</li><li>If you’re prompted with a warning about saving the key without a passphrase, click <strong>Yes</strong> (only if you prefer not to secure the key with a passphrase).</li><li>Save the file with a <strong>.ppk</strong> extension.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GR0EIn_LBrFbrm2rp5sWyg.png" /></figure><p>5. <strong>Export the OpenSSH Key (.pem file):</strong></p><ul><li>In PuTTYgen, go to the <strong>Conversions</strong> menu and select <strong>Export OpenSSH key</strong>.</li><li>If you’re prompted with a warning about saving the key without a passphrase, click <strong>Yes</strong> (only if you prefer not to secure the key with a passphrase).</li><li>Save the file with a <strong>.pem</strong> extension.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-TWJJahP4bXf0sYVgqrImQ.png" /></figure><p>These steps will help you generate and convert your keys for use with both PuTTY and other SSH clients seamlessly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3b4d13b254f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Networking Works: From Click to Web Page]]></title>
            <link>https://medium.com/@vaishnavi_shelke/how-networking-works-from-click-to-web-page-b9fa1663d134?source=rss-c33edb9ab13b------2</link>
            <guid isPermaLink="false">https://medium.com/p/b9fa1663d134</guid>
            <category><![CDATA[protocol]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[http-request]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[request-response-cycle]]></category>
            <dc:creator><![CDATA[Vaishnavi Shelke]]></dc:creator>
            <pubDate>Sun, 21 Jul 2024 05:03:45 GMT</pubDate>
            <atom:updated>2024-07-21T05:03:45.589Z</atom:updated>
            <content:encoded><![CDATA[<p>Have you ever wondered what happens when you click a link in your web browser? It seems instantaneous, but there’s actually a complex series of steps happening behind the scenes. Let’s break down this process in a way that’s easy to understand.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Luu2y5196Aq_kVSJGZIGxA.jpeg" /></figure><h4>1. The Click</h4><p>It all starts when you click a link, like <a href="https://www.google.com/">https://www.google.com</a>. This address is called a URL (Uniform Resource Locator), and it’s like a street address for websites.</p><h4>2. Understanding the Address (URL Parsing)</h4><p>Your browser first needs to understand the different parts of the URL:</p><ul><li><strong>Protocol:</strong> The communication method (e.g., HTTP for web pages, HTTPS for secure connections)</li><li><strong>Domain Name:</strong> The human-readable name of the website (e.g., “google.com”)</li><li><strong>Path:</strong> The specific resource within the website (e.g., “/index.html”)</li></ul><h4>3. Finding the Right Computer (DNS Lookup)</h4><p>Your browser doesn’t actually know where “<a href="http://www.google.com/">www.google.com</a>&quot; is located. It needs to translate this name into an IP address, which is like a phone number for computers.</p><ul><li>The browser contacts a DNS (Domain Name System) server, which acts like a giant internet phonebook.</li><li>The DNS server looks up the IP address for the domain name.</li><li>The DNS server sends the IP address back to your browser.</li></ul><h4>4. Making the Connection (TCP Handshake)</h4><p>Once your browser has the IP address, it needs to establish a connection with the server. This happens through a process called a TCP handshake:</p><ul><li><strong>SYN:</strong> Your browser sends a “synchronize” message to the server.</li><li><strong>SYN-ACK:</strong> The server acknowledges and responds with its own synchronize message.</li><li><strong>ACK:</strong> Your browser acknowledges the server’s response, completing the handshake</li></ul><h4>5. Asking for What You Want (HTTP Request)</h4><p>Now that the connection is established, your browser sends an HTTP request to the server. This request includes:</p><ul><li><strong>Method:</strong> The type of request (e.g., GET to retrieve a page, POST to submit data)</li><li><strong>URL Path:</strong> The specific resource being requested</li><li><strong>Headers:</strong> Additional information like cookies or user agent details</li></ul><h4>6. The Server’s Response</h4><p>The server receives this request, finds or generates the information you’ve asked for, and sends it back in an HTTP response. This response includes:</p><ul><li><strong>Status Code:</strong> A number indicating success (e.g., 200 OK) or failure (e.g., 404 Not Found)</li><li><strong>Headers:</strong> Information about the response, like content type</li><li><strong>Body:</strong> The actual content you requested (e.g., HTML for a web page)</li></ul><h4>7. Displaying the Result</h4><p>Finally, your browser receives this response and displays the web page on your screen. This may involve:</p><ul><li>Parsing the HTML</li><li>Requesting additional resources (images, stylesheets, scripts)</li><li>Rendering the page according to the received instructions</li></ul><h4>8. Saying Goodbye (Connection Termination)</h4><p>Once everything is transferred, the connection between your browser and the server is closed.</p><blockquote><em>This entire process happens in a fraction of a second, allowing you to browse the web seamlessly. While there’s a lot more technical detail behind each of these steps, this overview gives you a basic understanding of how networking allows you to access information from around the world with just a click.</em></blockquote><p><strong><em>Thank you </em></strong><em>for going through this article. If you found it useful, kindly </em><strong><em>share</em></strong><em> it with your friends. Your </em><strong><em>feedback</em></strong><em> and suggestions are most welcome to help improve the content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b9fa1663d134" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Server Using Express.js]]></title>
            <link>https://medium.com/@vaishnavi_shelke/building-a-server-using-express-js-2eff4ac6f14f?source=rss-c33edb9ab13b------2</link>
            <guid isPermaLink="false">https://medium.com/p/2eff4ac6f14f</guid>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[mern-stack]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[backend]]></category>
            <dc:creator><![CDATA[Vaishnavi Shelke]]></dc:creator>
            <pubDate>Wed, 26 Jun 2024 17:31:31 GMT</pubDate>
            <atom:updated>2024-06-26T17:31:31.150Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4PBnkSh6KPn72kKuLjJ88w.jpeg" /></figure><p>This guide provides a roadmap to set up your very own server application with the powerful Express.js framework. Follow these steps to get your server:</p><h4>1. Project Setup:</h4><ul><li><strong>Create a Project Directory:</strong> Dive into your terminal or command prompt and craft a new directory to house your project.</li><li><strong>Navigate to the Directory:</strong> Use the cd command to shift your terminal&#39;s focus to the freshly created project directory.</li><li><strong>Initialize </strong><strong>package.json:</strong> This file manages your project&#39;s dependencies. To generate it, run the following command:</li></ul><pre>npm init -y</pre><h4>2. Install Express.js:</h4><p>Install the Express.js framework using npm (Node Package Manager):</p><pre>npm install express</pre><p>This command downloads the Express package and adds it to your project’s dependencies list in package.json.</p><h4>3. Create the Server File (server.js):</h4><p>Create a new file named server.js in your project directory. This file will contain the code for your Express application.</p><h4>4. Basic Server Structure :</h4><p>Here’s a template for the server.js file that demonstrates a basic server setup:</p><pre>const express = require(&#39;express&#39;);<br><br>const app = express();<br><br>// Port to listen on (default: 3000)<br>const port = process.env.PORT || 3000;<br><br>// Basic route handler (example)<br>app.get(&#39;/&#39;, (req, res) =&gt; {<br>  res.send(&#39;Hello from your Express server!&#39;);<br>});<br><br>// Start the server<br>app.listen(port, () =&gt; {<br>  console.log(`Server listening on port ${port}`);<br>});</pre><blockquote><strong><em>Let’s break it down:</em></strong></blockquote><ul><li>const express = require(&#39;express&#39;);: Imports the Express framework, granting us access to its functionalities.</li><li>const app = express();: Creates an instance of an Express application, essentially the foundation upon which we build our server.</li><li>const port = process.env.PORT || 3000;: Defines the port on which the server will listen for incoming requests. It checks for an environment variable named PORT first. If that&#39;s not set, it defaults to port 3000.</li><li>app.get(&#39;/&#39;, (req, res) =&gt; {...});: Defines a route handler for the root path (/). Whenever a GET request is made to the root path, the function within the parentheses executes. In this example, it sends the response &quot;Hello from your Express server!&quot; to the client (web browser).</li><li>app.listen(port, () =&gt; {...});: Starts the server, instructing it to listen for incoming requests on the specified port. The callback function logs a message to the console, confirming that the server is up and running.</li></ul><h4>5. Running the Server:</h4><p>In your terminal, execute the following command</p><pre>node server.js</pre><h4>6. Accessing Your Server:</h4><ul><li>Open a web browser and navigate to http://localhost:&lt;port&gt;, where &lt;port&gt; is the port your server is listening on (e.g., <a href="http://localhost:3000/">http://localhost:3000</a> if you’re using the default port).</li><li>You should see the response “Hello from your Express server!” displayed in your browser, confirming that your server is up and running!</li></ul><h4><em>Additional Tip: Automatic Server Restarts with Nodemon</em></h4><p>While manually restarting the server with node server.js after every code change can become tedious, there&#39;s a handy tool called nodemon that can automate this process. Here&#39;s how to leverage it:</p><h4>1. Install Nodemon:</h4><p>Open your terminal within your project directory and execute the following command to install nodemon as a development dependency:</p><pre>npm install nodemon </pre><h4>2. Run Server with Nodemon:</h4><p>Instead of using node server.js, you can now utilize nodemon to start your server:</p><pre>nodemon server.js</pre><p>This command instructs nodemon to monitor your server.js file for changes. Whenever you modify and save the file, nodemon will automatically restart your server, saving you time and effort.</p><p><em>By following these steps, you’ll have a robust foundation for building Express.js applications. Remember to leverage </em><em>nodemon for automatic server restarts to enhance your development efficiency.</em></p><p><strong><em>Thank you </em></strong><em>for going through this article. If you found it useful, kindly </em><strong><em>share</em></strong><em> it with your friends. Your </em><strong><em>feedback</em></strong><em> and suggestions are most welcome to help improve the content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2eff4ac6f14f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Guide to React Router Hooks]]></title>
            <link>https://medium.com/@vaishnavi_shelke/a-guide-to-react-router-hooks-94770b9948ac?source=rss-c33edb9ab13b------2</link>
            <guid isPermaLink="false">https://medium.com/p/94770b9948ac</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[react-router]]></category>
            <category><![CDATA[mern-stack]]></category>
            <category><![CDATA[react-router-v6]]></category>
            <category><![CDATA[reactjs]]></category>
            <dc:creator><![CDATA[Vaishnavi Shelke]]></dc:creator>
            <pubDate>Tue, 25 Jun 2024 09:00:15 GMT</pubDate>
            <atom:updated>2024-07-21T05:02:02.382Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MOzvLUDGTKBDgVKxYiD1Xw.jpeg" /></figure><p>React Router is an essential library for building single-page applications (SPAs) in React. This article delves into the world of React Router hooks, specifically focusing on useLocation, useNavigate (formerly useHistory in React Router v5), and other frequently used hooks.</p><h4>1] useLocation Hook :</h4><p>The useLocation hook provides the crucial details about your current whereabouts on the website. It returns an object containing valuable information about the current URL:</p><ul><li><strong>pathname:</strong> The path portion of the URL (e.g., /about).</li><li><strong>search:</strong> Any query parameters appended to the URL (e.g., ?name=Alice).</li><li><strong>hash:</strong> The hash fragment following the # symbol (e.g., #contact).</li></ul><p>By utilizing useLocation, you can dynamically render content or modify component behavior based on the current route. For instance, you could highlight the active navigation link corresponding to the current page or display location-specific information.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eT-c6RYKVff9EkrkfEX65w.png" /></figure><h4>2] useNavigate Hook (formerly useHistory) :</h4><p>The useNavigate hook (previously known as useHistory in React Router v5) grants you programmatic control over navigation, allowing you to navigate users to specific sections of your application.</p><p>useNavigate offers methods like navigate(&quot;/contact&quot;) to seamlessly change the URL and route the user to the desired page.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*I7IYQvXi1FvWJ7lb3uuURA.png" /></figure><h4>3] useParams Hook :</h4><p>Sometimes, URLs contain dynamic segments that identify specific resources. For example, a blog post with a unique ID might have a URL like /posts/:id. The :id portion is a dynamic segment that can hold different values for different posts.</p><p>The useParams hook comes in handy when you need to extract these dynamic values from the URL within your component.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*mRzExhbewqVp2IxEnk1J1w.png" /></figure><ul><li>In this example, the route path is defined as /posts/:id. The colon (:) followed by id indicates that this portion of the URL is a dynamic segment.</li><li>This route will match any URL that starts with “/posts/” followed by any value (the ID).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1TBqeRnTPoVVNF_REOh0xA.png" /></figure><ul><li>This custom hook uses useState to manage the fetched post data and any potential error.</li><li>The useEffect hook triggers the data fetching logic whenever the id changes.</li><li>The fetchData function handles the API call, error handling, and updates the state based on the response.</li><li>The hook returns an object containing the post data and error for the component to utilize.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*xR0lHRefKJ_cTRlgMd6Ifg.png" /></figure><ul><li>The const { id } = useParams(); line extracts the dynamic segment named id from the URL.</li><li>If the URL matches the pattern /posts/:id, the id variable will hold the actual ID value extracted from the URL segment.</li><li>If the URL doesn’t match the pattern, or there’s no id segment, useParams will return an empty object.</li></ul><h4>4] useRouteMatch Hook :</h4><p>This hook proves useful when you want to determine if the current URL matches a specific route pattern defined in your React Router configuration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iWPRBB8HlwAhEEXbFtMhpw.png" /></figure><p>This hook is particularly useful when you want to render different layouts or components based on the routing structure.</p><p><strong><em>Thanks</em></strong><em> for going through this article. If you found it useful, kindly </em><strong><em>share</em></strong><em> it with your friends. Your </em><strong><em>feedback</em></strong><em> and suggestions are most welcome to help improve the content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94770b9948ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>