<?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 Sahil Gupta on Medium]]></title>
        <description><![CDATA[Stories by Sahil Gupta on Medium]]></description>
        <link>https://medium.com/@sahilg98?source=rss-7233efc9dfdf------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*bTTQGJ2RhJT5K0x4kFB-EQ.png</url>
            <title>Stories by Sahil Gupta on Medium</title>
            <link>https://medium.com/@sahilg98?source=rss-7233efc9dfdf------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 02 Dec 2026 09:15:23 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sahilg98/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[ How a Small Oversight Reset My K3s Cluster (and What I Learned from It)]]></title>
            <link>https://sahilg98.medium.com/how-a-small-oversight-reset-my-k3s-cluster-and-what-i-learned-from-it-45347d821c8d?source=rss-7233efc9dfdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/45347d821c8d</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Sahil Gupta]]></dc:creator>
            <pubDate>Thu, 10 Jul 2025 04:43:48 GMT</pubDate>
            <atom:updated>2025-07-10T04:43:48.956Z</atom:updated>
            <content:encoded><![CDATA[<p>As a DevOps engineer at an IoT startup, I’m continually reminded how crucial attention to detail is, especially when configuring infrastructure. Recently, I experienced a tricky issue in my Kubernetes (K3s) staging environment, providing me with an invaluable lesson I want to share.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KAO5QWpw24gh2SsA3Y3png.jpeg" /></figure><h3>🚩 What Happened?</h3><p>I configured a new staging environment on Ubuntu 22.04 using K3s with a custom data directory using the — data-dir option:</p><pre>k3s server --data-dir=/mnt/staging</pre><p>Initially, everything ran perfectly until the staging server unexpectedly rebooted about 8 hours later. To my surprise, upon restarting, the entire K3s cluster appeared reset my workloads, configurations, and data seemed to vanish completely.</p><h3>🔍 Discovering the Root Cause</h3><p>After careful analysis, I identified the issue:</p><ul><li>My K3s setup was configured to use a custom directory (/mnt/staging) stored on a separate LVM storage volume.</li><li>However, I neglected to ensure this storage volume mounted automatically during system startup.</li><li>After rebooting, Ubuntu booted without mounting the storage, leaving /mnt/staging as just an empty directory on the root filesystem.</li><li>K3s started early, found an empty /mnt/staging directory, and mistakenly initialized a fresh Kubernetes cluster state, unintentionally overwriting the existing cluster configuration.</li></ul><p>Thankfully, the original data wasn’t lost it was safe on the separate unmounted volume, temporarily hidden behind the empty mount directory.</p><h3>📖 Understanding /etc/fstab (Simply Explained)</h3><p>If you’re unfamiliar with it, here’s a simple definition:</p><ul><li>/etc/fstab is a configuration file in Linux that tells the system which storage devices or volumes should mount automatically whenever the system boots.</li><li>Think of it as a checklist the Linux server uses during startup to ensure each storage drive and volume is correctly attached and ready to use.</li></ul><p>In my case, since the custom mount point was missing from this file, Ubuntu didn’t mount it during boot.</p><h3>🛠️ How I Resolved the Issue</h3><p>Here’s the step-by-step resolution process I followed:</p><h3>1. Manually Mounting and Confirming Data Integrity</h3><p>I manually mounted the volume temporarily to verify my data:</p><pre>sudo mount /dev/mapper/&lt;volume-group-name&gt;/&lt;logical-volume-name&gt; /mnt/staging_temp</pre><p>I confirmed the data was intact:</p><pre>ls -l /mnt/staging_temp</pre><h3>2. Restoring the Correct Mount</h3><p>I stopped K3s:</p><pre>sudo systemctl stop k3s</pre><p>Then unmounted the temporary directory and re-mounted correctly:</p><pre>sudo umount /mnt/staging_temp<br>sudo mount /dev/mapper/&lt;volume-group-name&gt;/&lt;logical-volume-name&gt; /mnt/staging</pre><h3>3. Persistently Configuring the Mount with /etc/fstab</h3><p>I then made sure this issue would never repeat by adding a persistent entry in /etc/fstab:</p><pre>UUID=&lt;volume-uuid&gt; /mnt/staging ext4 defaults 0 2</pre><h3>4. Configuring Systemd to Ensure Correct Service Startup Order</h3><p>I set K3s to start only after the mount is available by adding the following systemd dependency:</p><pre>sudo systemctl edit k3s</pre><p>Then, I added:</p><pre>[Unit]<br>RequiresMountsFor=/mnt/staging</pre><p>And finally reloaded systemd:</p><pre>sudo systemctl daemon-reexec<br>sudo systemctl daemon-reload</pre><h3>5. Updating Kubeconfig to Point to the Correct Cluster</h3><p>Lastly, I corrected my kubeconfig:</p><pre>sudo cp /etc/rancher/k3s/k3s.yaml ~/.kube/config</pre><h3>✅ Preventive Measures &amp; Lessons Learned</h3><p>From this incident, I learned to always:</p><ul><li>Add critical custom data mounts explicitly into /etc/fstab.</li><li>Clearly define systemd dependencies (RequiresMountsFor) for services depending on external mounts.</li><li>Schedule regular backups for critical infrastructure components, like Kubernetes state databases, using cron or systemd timers.</li></ul><p>Have you encountered similar experiences or have other best practices to share? I’d love to hear your thoughts in the comments below!</p><p>#DevOps #Kubernetes #K3s #SystemAdministration #Infrastructure #ReliabilityEngineering #StartupLife #Linux #LessonsLearned</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=45347d821c8d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Docker Networking: An Analogy of Phone Numbers and Country Codes]]></title>
            <link>https://sahilg98.medium.com/demystifying-docker-networking-an-analogy-of-phone-numbers-and-country-codes-05ced646355d?source=rss-7233efc9dfdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/05ced646355d</guid>
            <category><![CDATA[containerization]]></category>
            <category><![CDATA[docker-networking]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Sahil Gupta]]></dc:creator>
            <pubDate>Wed, 18 Oct 2023 15:30:52 GMT</pubDate>
            <atom:updated>2023-10-18T15:30:52.103Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-G0E0dkn9Ry91Xqe" /></figure><p>In the world of technology, Docker containers have transformed the process of building and deploying applications. But understanding how these containers interact can be challenging. In this blog post, we’ll simplify Docker networking using an analogy involving phone numbers and countries. Let’s begin!</p><h3>The Digital Universe of Docker Containers🌐</h3><p>Imagine a digital realm where each individual possesses a unique phone number. Similarly, within the Docker ecosystem, every container is assigned a distinct and special address known as an IP address. These IP addresses are the digital phone numbers that facilitate communication between containers.</p><h3>The Analogy: Phone Numbers and Docker Networks 🤔</h3><p>To grasp Docker networking, let’s draw parallels with an everyday scenario we’re all familiar with — phone numbers and area codes.</p><h3>Containers in the Same Network 🏡</h3><p>Think of a situation where you and your friends live in the same country, sharing a common area code for your phone numbers. Dialing the last few digits of your phone numbers allows you to effortlessly call each other. This mirrors the functionality of containers within the same Docker network — they can communicate seamlessly using their respective IP addresses. It’s akin to being in the same “phone area,” making communication a breeze.</p><h3>Containers in Different Networks 🪐🌎</h3><p>Now, envision a distant country with a completely different area code. In this scenario, individuals from your country cannot directly call those in the distant country using just their phone numbers due to the contrasting area codes. Similarly, containers in separate Docker networks face a challenge in direct communication. They resemble inhabitants of different “phone areas.” While it’s not an insurmountable challenge to make them converse, it certainly entails a bit more complexity.</p><h3>The Default Network: Bridge Network 🌉</h3><p>When Docker is initiated, it automatically establishes a default network known as the “bridge” network. Consider this the default area code for containers. Containers that reside within this network can interact seamlessly since they belong to the same “phone area.” This default network simplifies communication among containers, just as a shared area code simplifies local calls.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/535/1*oJoNbN9pvAwkFHabLn3dZA.png" /></figure><h3>Diverse Drivers, Varied Technologies</h3><p>Much like the diverse array of country codes available, Docker offers different network “drivers.” These drivers serve as distinct isolated networking. Containers employing one specific driver may encounter limitations when attempting to communicate directly with containers utilizing a different driver. This is similar to how various phone calls may not always seamlessly connect with one another residing in different country.</p><h3>Driver Types</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/854/1*34_6KrbsKBRRyr12ST-RJg.png" /></figure><h3>Why Docker Networking Matters</h3><p>Understanding Docker networking is essential for anyone working with containerized applications. It enables the creation of complex and interconnected systems while maintaining security and isolation between containers. Whether you’re deploying microservices, orchestrating containers with Kubernetes, or simply running applications in containers, comprehending Docker networking is a valuable skill.</p><h3>Conclusion</h3><p><em>In conclusion, Docker networking can initially appear complex, but by drawing parallels with everyday concepts like phone numbers and area codes, it becomes more approachable. Containers within the same network communicate effortlessly, much like people within the same area code can call each other easily. Conversely, containers in different networks, akin to different area codes, require a bit more configuration for direct communication.</em></p><blockquote><strong>Happy containerizing! 🐳🌐</strong></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=05ced646355d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Resume Challenge — Week 4]]></title>
            <link>https://sahilg98.medium.com/cloud-resume-challenge-week-4-6ed468701823?source=rss-7233efc9dfdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ed468701823</guid>
            <category><![CDATA[aws-cdk]]></category>
            <category><![CDATA[iac]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cicd]]></category>
            <dc:creator><![CDATA[Sahil Gupta]]></dc:creator>
            <pubDate>Fri, 23 Jun 2023 18:20:13 GMT</pubDate>
            <atom:updated>2023-06-23T18:20:13.204Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vWb0I13gz88Hh9gwiNPhog.png" /><figcaption>Cloud Resume Challenge — Week 4</figcaption></figure><h3><strong>Cloud Resume Challenge — Week 4</strong></h3><p><strong>Week 4: Represent your cloud resources as configuration, so they can be deployed identically in any environment — and automate those deployments using a CI (continuous integration) pipeline.</strong></p><blockquote>Forrest Brazeal’s “Cloud Resume Challenge” is an exciting way to enhance both your cloud and development skills. This challenge requires you to design, develop, and deploy a resume website on AWS using various cloud services.</blockquote><p><strong>Helpful resources</strong>:</p><ul><li><a href="https://docs.github.com/en/actions/learn-github-actions"><strong>The Learn resources for GitHub Actions</strong></a></li><li><a href="https://docs.aws.amazon.com/cdk/v2/guide/getting_started.html"><strong>Getting started with the AWS CDK — AWS Cloud Development Kit (AWS CDK) v2 (amazon.com)</strong></a></li><li><a href="https://www.linkedin.com/embed/feed/update/urn:li:ugcPost:6946843752195854336"><strong>My Blog on Cloud Development Kit</strong></a></li></ul><p><strong>Architecture:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CKvZk-64c6fFl3YW_-P-uA.png" /><figcaption>GitHub Action for CDK Stack</figcaption></figure><p><strong>TASK — 1</strong> <strong>: Create a Stack using IAC</strong></p><ul><li>For creating Infrastructure I used Cloud Development Kit (CDK), since I am familiar with it. You can opt for different infeastructure as code tools like terraform, cloudformation , pulumi , etc</li></ul><p><strong>TASK — 2 : Create a CI Pipeline using GitHub Action</strong></p><ol><li><strong>Prerequisites:</strong> Ensure that you have the necessary permissions to create and manage GitHub Actions workflows in your repository. You should also have access to the infrastructure deployment tools and configurations required for your project.</li><li><strong>Create Workflow File:</strong> In your GitHub repository, navigate to the <strong>.github/workflows/</strong> directory (create it if it doesn&#39;t exist) and create a new YAML file, e.g., <strong>ci.yml</strong>. This file will define your CI workflow.</li><li><strong>Define Workflow Trigger:</strong> Begin the workflow file by specifying the event(s) that will trigger the workflow. For example, you might want to trigger the workflow on every push to the <strong>main</strong> branch or when a pull request is opened or updated.</li><li><strong>Specify Workflow Jobs:</strong> Within the workflow file, define one or more jobs that represent the steps of your CI pipeline. Each job can contain one or more steps that will be executed sequentially.</li><li><strong>Checkout Source Code:</strong> Start each job by checking out the source code from your repository. This ensures that subsequent steps have access to the latest code changes.</li><li><strong>Install Dependencies:</strong> If your infrastructure deployment process requires any dependencies or tools, such as specific CLI tools or libraries, include steps to install them.</li><li><strong>Run Tests and Linting:</strong> If you have automated tests or linting processes for your infrastructure code, include the necessary steps to run them. This helps ensure that the code changes are valid and conform to your project’s standards.</li><li><strong>Deploy Infrastructure:</strong> Add the steps to deploy your infrastructure to the desired environment. This can involve executing scripts, running deployment commands, or interacting with infrastructure-as-code tools like Terraform, CloudFormation, or Ansible.</li><li><strong>Environment-specific Configurations:</strong> If your infrastructure deployment process requires environment-specific configurations (e.g., credentials, endpoints, or secrets), ensure that these are properly managed and securely stored. You can use GitHub Secrets to store sensitive information and access them within your workflow.</li><li><strong>Notifications and Reporting:</strong> Consider adding steps to send notifications or reports about the deployment status or any potential issues. This could involve sending emails, posting messages to Slack, or integrating with other communication channels.</li><li><strong>Error Handling and Cleanup:</strong> Implement error handling mechanisms in case any step fails during the CI process. You might want to roll back changes, clean up temporary resources, or notify relevant team members.</li><li><strong>Branch and Environment Mapping:</strong> If you intend to deploy to multiple environments based on different branches, ensure that your workflow handles the mapping between branches and environments appropriately. For example, you might deploy to a staging environment for pull requests and a production environment for the main branch.</li><li><strong>Workflow Testing:</strong> Before committing and pushing the workflow file, consider testing it locally using the GitHub Actions Local Runner or the provided simulation feature in the GitHub Actions editor. This allows you to catch any syntax or logical errors before triggering the workflow on actual events.</li><li><strong>Commit and Push Workflow:</strong> Finally, commit and push the workflow file to your repository. GitHub Actions will automatically detect the new workflow and start executing it based on the specified trigger events.</li></ol><p><strong>Errors :</strong></p><ul><li><strong>Error in GitHub Action</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*JDpmy4ivQ5vgZf7z-ywtbA.png" /><figcaption>GitHub Action Error</figcaption></figure><ul><li>It wasn’t able to find the lambda path , since .js was present in .gitignore. I removed .js from .gitignore and tried pushing again with temporary changes. It Worked !!!</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ed468701823" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Resume Challenge — Week 3]]></title>
            <link>https://sahilg98.medium.com/cloud-resume-challenge-week-3-dadefbf07e02?source=rss-7233efc9dfdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/dadefbf07e02</guid>
            <category><![CDATA[aws-api-gateway]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws-dynamodb]]></category>
            <dc:creator><![CDATA[Sahil Gupta]]></dc:creator>
            <pubDate>Thu, 22 Jun 2023 11:03:10 GMT</pubDate>
            <atom:updated>2023-06-22T11:03:10.494Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3fHK7N6JXAteQQpuP5wO4A.png" /><figcaption>Cloud Resume Challenge — Week 3</figcaption></figure><h3>Cloud Resume Challenge — Week 3</h3><p><strong>Week 3 : Connect your API to the static site using Javascript and create automated tests to confirm the functionality of your visitor counter.</strong></p><blockquote>Forrest Brazeal’s “Cloud Resume Challenge” is an exciting way to enhance both your cloud and development skills. This challenge requires you to design, develop, and deploy a resume website on AWS using various cloud services.</blockquote><p><strong>Helpful resources</strong>:</p><ul><li><a href="https://www.youtube.com/watch?v=cuEtnrL9-H0"><strong>How to use fetch() api in JS</strong></a></li></ul><p><strong>My Work:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FZrgSGDyntbs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DZrgSGDyntbs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FZrgSGDyntbs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b6fe3911c2396286f06020412289b92d/href">https://medium.com/media/b6fe3911c2396286f06020412289b92d/href</a></iframe><p><strong>Architecture:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_myid3QeB3UJqvW31C2Tg.png" /></figure><p><strong>TASK — 1: Create a JavaScript File to Fetch API Gateway URL</strong></p><ul><li>Provide an ID in HTML File*(div/header tag) * where you want to display the data.</li><li>The same ID should be fetched in JavaScript file to map the data coming from API Gateway</li></ul><p><strong>Errors :</strong></p><p><em>CORS Error</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6DlIyCh6TDF4jiOMUUOpPA.png" /></figure><ul><li>You need to ensure that if you allow particular configuration in API Gateway in CORS Configuration, return the same in LAMBDA response.</li><li>Reference : <a href="https://cors.serverlessland.com/">**https://cors.serverlessland.com/</a>**</li></ul><p><em>Visitors changed to [object Object]</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E7wA3k7wreRysbaTbB7QWA.png" /></figure><ul><li>I removed JSON.stringify method in Lambda response.</li></ul><p>Full Article:</p><p><a href="https://sguptacloud.notion.site/Cloud_Resume_Challenge_Using_CDK-d9dc5752f2eb4013a12e99129d2320ca?pvs=4">Cloud_Resume_Challenge_Using_CDK</a></p><p>Connect with me on</p><p><a href="https://www.linkedin.com/in/sahilgupta2810/">Sahil Gupta | LinkedIn</a></p><p><a href="https://github.com/SahilGupta2810">SahilGupta2810 (Sahil Gupta) (github.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dadefbf07e02" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Resume Challenge — Week 2]]></title>
            <link>https://sahilg98.medium.com/cloud-resume-challenge-week-2-e8cda50e4640?source=rss-7233efc9dfdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/e8cda50e4640</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[aws-dynamodb]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[Sahil Gupta]]></dc:creator>
            <pubDate>Thu, 15 Jun 2023 14:11:07 GMT</pubDate>
            <atom:updated>2023-07-08T07:10:29.113Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N9k_sDYdUppFWCXqZ5uQQg.png" /></figure><h3><strong>Cloud Resume Challenge — Week 2</strong></h3><h3>Week 2 : Build the “back end” of your resume website — a serverless API to keep track of a visitor counter.</h3><blockquote>Forrest Brazeal’s “Cloud Resume Challenge” is an exciting way to enhance both your cloud and development skills. This challenge requires you to design, develop, and deploy a resume website on AWS using various cloud services.</blockquote><p><strong>Helpful resources</strong>:</p><ul><li><a href="https://docs.aws.amazon.com/apigateway/latest/developerguide/welcome.html"><strong>API Gateway</strong></a></li><li><a href="https://docs.aws.amazon.com/lambda/?icmpid=docs_homepage_featuredsvcs"><strong>Lambda</strong></a></li><li><a href="https://docs.aws.amazon.com/dynamodb/?icmpid=docs_homepage_featuredsvcs"><strong>DynamoDB</strong></a></li><li><a href="https://www.youtube.com/watch?v=Xsw2rXIHlUw"><strong>CRUD API USING API Gateway, Lambda and DynamoDB</strong></a></li></ul><p><strong>My work:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FIZlVDSQ9scs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DIZlVDSQ9scs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FIZlVDSQ9scs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/077e1cf1378f576de37a9d2185911b53/href">https://medium.com/media/077e1cf1378f576de37a9d2185911b53/href</a></iframe><p><strong>Architecture:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5jdxA4zyB3BUajYEsoEVgQ.png" /></figure><p><strong>TASK — 1:</strong> <strong>Creating DynamoDB Table</strong></p><ul><li>DynamoDB Table Specification</li><li>Create a Table — Cloud-Resume-Challenge-Visitor</li><li>Create a Partition/Primary Key — ID</li><li>Note: Partition Key name cannot be changed.</li></ul><p><strong>TASK — 2:</strong> <strong>Creating Lambda Function</strong></p><ul><li>Lambda Function Specification</li><li>Create a Lambda Function with methods supported by your API Gateway</li></ul><p><strong>TASK — 3: Creating API Gateway</strong></p><ul><li>API Gateway Specification</li><li>Create an API Gateway with <strong>GET</strong> method.</li></ul><p>Full Article:</p><p><a href="https://sguptacloud.notion.site/Cloud_Resume_Challenge_Using_CDK-d9dc5752f2eb4013a12e99129d2320ca">Cloud_Resume_Challenge_Using_CDK</a></p><p>Connect with me on</p><p><a href="https://www.linkedin.com/in/sahilgupta2810/">Sahil Gupta | LinkedIn</a></p><p><a href="https://github.com/SahilGupta2810">SahilGupta2810 (Sahil Gupta) (github.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e8cda50e4640" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Define a Log Retention in Lambda Using CDK Without Creating a Custom Resource — It can help…]]></title>
            <link>https://sahilg98.medium.com/how-to-define-a-log-retention-in-lambda-using-cdk-without-creating-a-custom-resource-it-can-help-3d83e7b7cf0a?source=rss-7233efc9dfdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/3d83e7b7cf0a</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloudwatch-logs]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[cloud-cost-optimization]]></category>
            <dc:creator><![CDATA[Sahil Gupta]]></dc:creator>
            <pubDate>Mon, 29 May 2023 03:16:09 GMT</pubDate>
            <atom:updated>2023-05-29T03:16:09.462Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Define a Log Retention in Lambda Using CDK Without Creating a Custom Resource — It can help you save 💲Money💲</h3><p>Why Log Retention is necessary?</p><ul><li>Log retention is the process of keeping logs for a certain period of time. Whenever a service is utilized / consumed / invoked (Lambda function), it generates logs that provide valuable insights into the execution flow and any potential errors. By default, these logs are stored indefinitely, which can quickly consume storage space and increase costs.</li></ul><h3>Defining a Log Retention in Lambda construct Vs Defining a Log Retention as a method</h3><p>Defining a Log Retention in Lambda Function construct</p><ul><li>When you create a Lambda function using the AWS CDK, you can define a log retention policy by setting the logRetention property on the Function construct. The logRetention property takes a value in days/weeks/months/years. For example, to set the log retention period to 1 day, you would use the following code:</li></ul><pre>const myFunction = new lambda.Function(this, &#39;My-Function&#39;, {<br>      functionName: &quot;Hello-World&quot;,<br>      runtime: lambda.Runtime.NODEJS_16_X,<br>      handler: &#39;index.main&#39;,<br>      code: lambda.Code.fromAsset(path.join(__dirname, &#39;/../src&#39;)),<br>      // 👇 set Log Retention in Days<br>      logRetention: logs.RetentionDays.ONE_DAY<br>    })</pre><p>If we try deploying the above code, it will result in creating two lambda functions, one for our main function and another for managing log retention.</p><p>Here’s an overview of it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S6Jqy5PzWlTggHXF" /></figure><p>With Log Retention Policy in Lambda Function Construct</p><blockquote><em>This default behavior of creating a custom resource for log retention introduces additional costs.</em></blockquote><p>Defining a Log Retention as a method</p><ul><li>The AWS CDK now provides a way to define a log retention policy without creating a custom resource. To do this, you can use the logRetention property on the LogGroup construct. For example, to set the log retention period to 1 day, you would use the following steps:</li></ul><ol><li>Setting Up CDK: Install and configure CDK in your development environment.</li><li>Defining the Log Group: Create a separate method to define the log group with the desired retention period, using the AWS CloudWatch Logs library available in CDK.</li><li>Associating the Log Group: Associate the log group with your Lambda function, ensuring that the logs generated by the function are stored in the specified log group.</li><li>Deploying the Stack: Use CDK commands to deploy the stack and apply the log retention configuration to your Lambda function.</li></ol><pre>export class LogRetentionStack extends cdk.Stack <br>  constructor(scope: Construct, id: string, props?: cdk.StackProps) {<br>    super(scope, id, props);<br>    <br>    const myFunctiontwo = new lambda.Function(this, &#39;My-Function-two&#39;, {<br>      functionName: &quot;Hello-World-two&quot;,<br>      runtime: lambda.Runtime.NODEJS_16_X,<br>      handler: &#39;index.main&#39;,<br>      code: lambda.Code.fromAsset(path.join(__dirname, &#39;/../src&#39;)),<br>    })<br>// Call the static method to create a Log group for the second Lambda function<br>    LogRetentionStack.createLogGroup(this, myFunctiontwo)<br>  }<br><br>  private static createLogGroup(<br>    scope: Construct,<br>    myFunctiontwo: lambda.Function<br>  ) {<br>    new logs.LogGroup(scope, &#39;LogGroup&#39;, {<br>      logGroupName: `/aws/lambda/${myFunctiontwo.functionName}`,<br>      retention: logs.RetentionDays.ONE_DAY,<br>      removalPolicy: cdk.RemovalPolicy.DESTROY<br>    });<br>  }<br>}</pre><p>After deploying the above stack, the results are below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*MXXafzUXjyZmVWKr" /></figure><p>With Log Retention method</p><p>The Log group created by both the functions are shown.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iZsd7Y5lqEJISM0O" /></figure><p>PS: I am always eager to learn and grow. If you have any suggestions or improvements, please share them with me. I am always open to new ideas and perspectives.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3d83e7b7cf0a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Resume Challenge — Week 1]]></title>
            <link>https://sahilg98.medium.com/cloud-resume-challenge-week-1-119e77fd75e9?source=rss-7233efc9dfdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/119e77fd75e9</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[cloud-development-kit]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[cloud-resume-challenge]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Sahil Gupta]]></dc:creator>
            <pubDate>Sun, 16 Apr 2023 17:01:04 GMT</pubDate>
            <atom:updated>2023-04-16T17:19:01.996Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="Cloud Resume Challenge — Week 1" src="https://cdn-images-1.medium.com/max/1024/1*er6xrpZjuqMFeSh_1VJmYg.png" /></figure><h3>Cloud Resume Challenge — Week 1</h3><blockquote>Forrest Brazeal’s “Cloud Resume Challenge” is an exciting way to enhance both your cloud and development skills. This challenge requires you to design, develop, and deploy a resume website on AWS using various cloud services.</blockquote><h3>Week 1 / Sprint — 1 : Build your “Front-end” of your resume website.</h3><p>Here is my static website</p><p><a href="https://sgupta.cloud/">Resume Website (sgupta.cloud)</a></p><p><strong>Helpful resources</strong></p><ul><li><a href="https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/getting-started-cloudfront-overview.html">AWS</a></li><li><a href="https://www.notion.so/Bon-App-tit-Foodcast-f39142fc8006438d81f7faf893426600">Youtube</a></li><li><a href="https://github.com/SahilGupta2810/Cloud_Resume_Challenge_Sprints.git">GitHub</a></li></ul><h3><strong>My Work:</strong></h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.canva.com%2Fdesign%2FDAFWumncH4o%2Fview%3Fembed%26meta&amp;display_name=Canva&amp;url=https%3A%2F%2Fwww.canva.com%2Fdesign%2FDAFWumncH4o%2Fview&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=canva" width="1366" height="768" frameborder="0" scrolling="no"><a href="https://medium.com/media/79cbf72bb066b52ffda8b0f4e51d077e/href">https://medium.com/media/79cbf72bb066b52ffda8b0f4e51d077e/href</a></iframe><h3><strong>Architecture</strong></h3><figure><img alt="Architecture — Front End" src="https://cdn-images-1.medium.com/max/1024/1*eScLHAs7RhQhkYilC3m7sg.png" /></figure><h3><strong>TASK — 1</strong> <strong>:</strong> <strong>Building a static website.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hq5uJs4E1TawP42abb7q_A.png" /></figure><ul><li>Using a template can be a convenient and efficient way to create a website if website building is not your primary focus. Free templates can be found on websites such as</li><li>W3Schools, BootstrapMade, HTML5 UP, CSS-Free-Templates, Free-CSS, and Template Monster.</li><li><strong><em>Be sure to read the terms of use before using a template</em>.</strong></li><li>Another option is to design your website using design tools like Canva or Figma and then using HTML, CSS, and JavaScript to build the website using the design as a guide.</li></ul><p><strong>LINKS:</strong></p><p><strong>Design your website</strong></p><ul><li><a href="https://www.canva.com/"><strong>Canva</strong></a></li><li><a href="https://www.figma.com/"><strong>Figma</strong></a></li></ul><p><strong>Free Templates</strong></p><ul><li>W3Schools (<a href="https://www.w3schools.com/w3css/w3css_templates.asp"><strong>https://www.w3schools.com/w3css/w3css_templates.asp</strong></a>)</li><li>BootstrapMade (<a href="https://bootstrapmade.com/"><strong>https://bootstrapmade.com/</strong></a>)</li><li>HTML5 UP (<a href="https://html5up.net/"><strong>https://html5up.net/</strong></a>)</li><li>CSS-Free-Templates (<a href="https://www.css-free-templates.com/"><strong>https://www.css-free-templates.com/</strong></a>)</li><li>Free-CSS (<a href="https://www.free-css.com/free-css-templates"><strong>https://www.free-css.com/free-css-templates</strong></a>)</li><li>Template Monster (<a href="https://www.templatemonster.com/free-website-templates/"><strong>https://www.templatemonster.com/free-website-templates/</strong></a>)</li></ul><h3><strong>TASK — 2 :</strong> <strong>Configuring a static website.</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pkJBx8bWped67Dw1goshpQ.png" /></figure><ul><li>Step 1 : <strong>Create an S3 Bucket</strong></li><li>Step 2 : <strong>Configure the S3 bucket for static website hosting</strong> and upload the website files into it.</li></ul><p>NOTE: <em>I have block all public access , and allowed traffic only from Cloudfront Distribution [Origin access identity].</em></p><ul><li>Step 3 : <strong>Create a Hosted Zone</strong> [ You need to <strong>replace</strong> the <strong>NS records from your domain provider with the NS records from your hosted zone</strong> after creating it ]</li><li>Step 4 : <strong>Request / Import a Certificate (SSL/TLS)</strong> for secure HTTP communication for your domain and all subdomain from <strong>Amazon Certificate Manager (ACM)</strong> ; and add all the records for domain and subdomain in Route53 Hosted Zone after requesting it.</li><li>ex: <a href="http://yourdomain.com/">yourdomain.com</a> , <a href="http://www.yourdomain.com/">www.yourdomain.com</a></li><li>You need to <strong>manually add CNAME record</strong> from Amazon Certificate Manager via management console into Route53.</li><li>While requesting a new certificate , add both domain and subdomain and later add the records to hsoted zones. If either of them is not added, this can cause 403 error.</li></ul><p><strong>NOTE:</strong> Your region should be N.Virginia</p><ul><li>Step 5 : Create a CloudFront Distribution [Normal/Web distribution] with the respective hosted zone and certificate.</li></ul><blockquote><strong><em>I performed Step 4 Manually, since I am working to solve an error. [if tried importing a new pending SSL/TLS certificate]</em></strong></blockquote><h3><strong>Error:</strong></h3><ul><li>Able to access website through cloudfront distribution , but not through domain name</li></ul><figure><img alt="Error" src="https://cdn-images-1.medium.com/max/1024/1*6MvzhulmQSpGNCG-ELkJ9Q.png" /></figure><p>Steps to Resolve :</p><ul><li><em>Created a new SSL/TLS Certificate from ACM and later deploy the stack which creates a Hosted Zone. After deployment , added the records [CName] from ACM to Route53 to validate it.</em></li><li><em>It was due to the missing record in Route53, I haven’t pointed domain name correctly.</em></li></ul><p>Full Article:</p><p><a href="https://sguptacloud.notion.site/Cloud_Resume_Challenge_Using_CDK-d9dc5752f2eb4013a12e99129d2320ca">Cloud_Resume_Challenge_Using_CDK</a></p><p>Connect with me on</p><p><a href="https://www.linkedin.com/in/sahilgupta2810/">Sahil Gupta | LinkedIn</a></p><p><a href="https://github.com/SahilGupta2810">SahilGupta2810 (Sahil Gupta) (github.com)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=119e77fd75e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Cloud Security]]></title>
            <link>https://sahilg98.medium.com/cloud-security-27b7ed8cc6b9?source=rss-7233efc9dfdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/27b7ed8cc6b9</guid>
            <dc:creator><![CDATA[Sahil Gupta]]></dc:creator>
            <pubDate>Fri, 24 Mar 2023 17:16:40 GMT</pubDate>
            <atom:updated>2023-03-24T17:16:40.838Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>A) What is Cloud Security?</blockquote><p>Cloud Security is an integration of a broad set of policies, technologies, rules and regulations, procedures in order to protect services; public and private data stored on the cloud from the Breach scenarios/Hackers/Accessing data from a third party.</p><blockquote>B) Who is responsible for Security?</blockquote><p>Cloud providers and customers are responsible for security. They work in the Shared Service Model where Customer is responsible for their security IN the cloud whereas the cloud providers are responsible for the security OF the cloud. Also, Only the customer is responsible for the data once it is uploaded to the cloud.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*crBzmdbcbQ-PNSXe" /></figure><blockquote>C) Difference between On-premises security and Cloud security</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/772/0*U6M_uP1Z_eZhBUFn" /></figure><p>Note: CAPEX-Capital expenditure, OPEX-Operational expenditure</p><p>D)Security Levels in Cloud Computing</p><ol><li>Infrastructure Level Cloud Security: It consists of Network Security, Application Security, Host / Virtual Machine Security.</li><li>Application Level Cloud Security: It is responsible for application-level security threats-End User’s Security</li><li>Data Level Cloud Security: It is responsible for Data availability, Data confidentiality, Data Integration.</li><li>User Interface Cloud Security: It is responsible for granting, managing, audit logging, and authentication of permission, security credentials, passwords, and policies.</li></ol><p>Credits :</p><p><a href="https://aws.amazon.com/security/">Cloud Security — Amazon Web Services (AWS)</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27b7ed8cc6b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[“NO-CODE RESPONSIVE WEB APP DEVELOPMENT”]]></title>
            <link>https://sahilg98.medium.com/no-code-responsive-web-app-development-cb2caf7ee5c2?source=rss-7233efc9dfdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/cb2caf7ee5c2</guid>
            <dc:creator><![CDATA[Sahil Gupta]]></dc:creator>
            <pubDate>Fri, 24 Mar 2023 17:14:43 GMT</pubDate>
            <atom:updated>2023-03-24T17:14:43.395Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/752/0*62psiu7dD5djkvaV" /></figure><p>Yes, you read it right. Amazon Web Service recently launched the beta version of AMAZON HONEYCODE, a fully managed/no-code app development tool, making it easier to for anyone to build an app for their team as per the requirement. AMAZON HONEYCODE is backed by the database in AWS and a web-based, drag and drop interface builder.</p><p>During the announcement AWS VP, Larry Augustin said, “Customers have told us that the need for custom applications far outstrips the capacity of developers to create them.” He added, “Now with Amazon Honeycode, almost anyone can create powerful custom mobile and web applications without the need to write code.”</p><p>Amazon Honeycode includes templates for some common applications that you and other members of your team can use right away:</p><ul><li>Simple To-Do</li><li>Customer Tracker</li><li>Simple Survey</li><li>Inventory management</li><li>Content Tracker and much more.</li></ul><p>Below is the diagram of the evolvement of Amazon Honeycode from the spreadsheet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/0*NKYq9wa2qKsmwUXd" /></figure><p>Credits :</p><p><a href="https://aws.amazon.com/blogs/aws/introducing-amazon-honeycode-build-web-mobile-apps-without-writing-code/">Introducing Amazon Honeycode — Build Web &amp; Mobile Apps Without Writing Code | AWS News Blog</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cb2caf7ee5c2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IAM(Identity and Access Management) — WHO AND WHAT]]></title>
            <link>https://sahilg98.medium.com/iam-identity-and-access-management-who-and-what-78c0fee38dd7?source=rss-7233efc9dfdf------2</link>
            <guid isPermaLink="false">https://medium.com/p/78c0fee38dd7</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-iam]]></category>
            <dc:creator><![CDATA[Sahil Gupta]]></dc:creator>
            <pubDate>Fri, 24 Mar 2023 17:13:10 GMT</pubDate>
            <atom:updated>2023-03-24T17:13:10.464Z</atom:updated>
            <content:encoded><![CDATA[<h3>IAM(Identity and Access Management) — WHO AND WHAT</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/0*sKVY_jGJ90pzfB3q" /></figure><p>Ever wondered…………..!!!</p><p>Working in a company irrespective of the field and profile, each and every employer encounters with the dashboard(Console) for operations/services, the common interface for all, but different interaction with each role. Yes, Responsibilities(operations/services) according to the role.</p><p>Roles are identities. Thus in order to identify these roles, there is a need for AUTHENTICATION. Similarly, for validating the responsibilities we need to AUTHORIZE.</p><p>Therefore, IAM is an integrated cloud service needed to assign, authenticate, authorize, monitor the services for your account. In short, it is used to validate WHO REQUESTED AND WHAT IS REQUESTED!!! It consists of Permission(WHAT IS REQUESTED BY IDENTITY ACCORDING TO POLICIES).</p><p>Terminologies:-</p><ul><li>Roles(Created and assigned the AWS resources)</li><li>Permission(Access request)</li><li>Users(Individual that, using the credentials, can request the services )</li><li>Groups(Group of IAM users)</li><li>Principal(Instance that can make a request for some action or operations)</li><li>Policies(Documents)</li></ul><p>Credits:</p><p><a href="https://aws.amazon.com/iam/">AWS IAM | Identity and Access Management | Amazon Web Services</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=78c0fee38dd7" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>