<?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 Shantam Sultania on Medium]]></title>
        <description><![CDATA[Stories by Shantam Sultania on Medium]]></description>
        <link>https://medium.com/@techwithshantam?source=rss-1437399c0d73------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*d9glyvkokyfe1mOVhl8GfQ.jpeg</url>
            <title>Stories by Shantam Sultania on Medium</title>
            <link>https://medium.com/@techwithshantam?source=rss-1437399c0d73------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 09:04:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@techwithshantam/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[Spec-Driven Java 21 Migration: A GitHub Copilot Workflow That Actually Works]]></title>
            <link>https://medium.com/analytics-vidhya/spec-driven-java-21-migration-a-github-copilot-workflow-that-actually-works-afe698f56a1b?source=rss-1437399c0d73------2</link>
            <guid isPermaLink="false">https://medium.com/p/afe698f56a1b</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[spec-driven-development]]></category>
            <category><![CDATA[java21]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Shantam Sultania]]></dc:creator>
            <pubDate>Sat, 28 Mar 2026 10:05:57 GMT</pubDate>
            <atom:updated>2026-03-28T10:05:57.553Z</atom:updated>
            <cc:license>https://creativecommons.org/publicdomain/mark/1.0/</cc:license>
            <content:encoded><![CDATA[<blockquote><strong><em>Introduction</em></strong></blockquote><p>This series presents practical user guides and examples that demonstrate how developers can effectively utilize GitHub Copilot in their day-to-day work to solve real-world problems.</p><blockquote><strong><em>Overview</em></strong></blockquote><p>Modernizing legacy Java applications is no longer just about upgrading syntax — it’s about <strong>adopting a smarter, AI-assisted development workflow</strong>.</p><p>In this article, we’ll walk through how to migrate an existing Java application to <strong>Java 21 (LTS)</strong> using:</p><ul><li><strong>GitHub Copilot</strong> for AI-assisted coding</li><li><strong>Spec-Driven Development (SDD</strong>) for structured, predictable upgrades</li></ul><p>This approach ensures your migration is not only successful but also <strong>repeatable, testable, and production-safe</strong>.</p><h3>Why Java 21</h3><blockquote>Java 21 = Performance + Security + Stability + Longevity</blockquote><p>Upgrading to Java 21 is not just about syntax improvements — it’s about <strong>stability, security, and long-term sustainability</strong> of your systems</p><ol><li>Stronger Security &amp; CVE Remediation</li><li>Stronger <strong>cryptographic algorithms and defaults</strong></li><li>Fixes for known vulnerabilities across core libraries</li><li>Improved JVM Performance &amp; GC Enhancements</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wr8Aa5YvaZuaTvcdkdKh2Q.png" /></figure><blockquote><em>Upgrading to Java 21 is not just a technical upgrade — it’s a </em><strong><em>risk reduction strategy</em></strong><em>.</em></blockquote><p>You’re not just getting new features — you’re:</p><ol><li>Securing your systems</li><li>Future-proofing your architecture</li><li>Aligning with modern engineering standards</li></ol><h3>What is Spec- Driven Development</h3><p>Learn more here:</p><p><a href="https://medium.com/@techwithshantam/making-developers-lives-easier-with-github-copilot-and-spec-driven-development-434ef28243bb">https://medium.com/@techwithshantam/making-developers-lives-easier-with-github-copilot-and-spec-driven-development-434ef28243bb</a></p><h3>Proposed Flow:</h3><pre>Spec → AI-assisted implementation → Validation → Iteration</pre><blockquote><strong><em>Migration Strategy Overview</em></strong></blockquote><p>We’ll break the migration into <strong>4 phases</strong>:</p><ol><li><strong>Assessment</strong></li><li><strong>Spec Creation</strong></li><li><strong>AI-Assisted Refactoring (Copilot)</strong></li><li><strong>Validation &amp; Optimization</strong></li></ol><h3><strong>Step 1: Assessment</strong></h3><p>Before touching your code, we first need to analyze what Java version you are using, what type of code dependencies you have, and more.</p><p>Suggested Tools for this are :</p><ul><li>jdeps → dependency analysis</li><li>jdeprscan → deprecated APIs</li><li>Build tools (Maven/Gradle reports)</li></ul><p>and create a <strong>migration readiness report</strong></p><p>Once we have an idea, let&#39;s open VS Code and make sure you have Copilot set up.</p><p>Next, let&#39;s go to the Copilot settings in the top right corner.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/442/1*dnzaxAlX7BXInkoKh3pSVw.png" /></figure><p>Click on Settings, then select Generate Chat Instructions, as shown in the image below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mk8uYc74aopWWwVYpu1D0w.png" /></figure><p>This process will take a predefined prompt and scan your codebase. It will then generate a complete and ready-to-use set of instructions based on your code structure, explaining what your code does and including any additional relevant items.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XG6SjmqZ2xHeqrf_hBot8A.png" /></figure><p>I am proposing a Repo structure as below</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/475/1*83feiEXI1DWan-lOGT5P_g.png" /></figure><h3><strong>Step 2: Spec Creation</strong></h3><h4>What’s in test.prompt.md</h4><p>Each spec has its own [SPEC-XX] section with three layers of verification:</p><ul><li><strong>Structural checks</strong> — things Copilot verifies by reading code (no grep remaining, annotations present, no wrong types converted, etc.)</li><li><strong>Automated test cases</strong> — concrete Java snippets Copilot generates and runs if no existing test covers the scenario</li><li><strong>Build + test gate</strong> — the exact Maven/Gradle command to run, with what exit code and output is expected</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/708/1*GTitkK0EzICcedbZ_B5xTA.png" /></figure><h4>What’s in java21-migration.prompt.md</h4><p>This is where magic happens. This file is now a proper <strong>orchestrator</strong> with four phases:</p><blockquote><strong>Phase 0 — Bootstrap</strong></blockquote><p>runs once at the start. Copilot reads your. copilot-instructions.md, reads test.prompt.md, detects your build system (Maven vs Gradle), then scans the entire codebase and generates a <strong>master TODO list</strong> — grouped by spec, with a checkbox per file — before touching anything. It then waits for your GO command.</p><blockquote><strong>The Spec Loop</strong></blockquote><p>For every spec, Copilot now follows five locked steps:</p><pre>Announce → Apply → Test Gate → Report → Confirm</pre><p>It cannot advance to the next spec until you type NEXT. You also have RETRY, SKIP, ABORT, and STATUS as control commands at every pause point.</p><blockquote><strong>SPEC-11 (CI/CD)</strong></blockquote><p>It runs <em>first</em> in the execution order, so your pipelines are on Java 21 before any code changes are built. It covers GitHub Actions, Dockerfiles (including multi-stage), pom.xml, build.gradle/kts, Jenkinsfiles, Azure Pipelines, .sdkmanrc, Helm values, and Kubernetes manifests.</p><blockquote><strong>Dependency-aware execution order</strong></blockquote><p>The specs no longer run 01–11 linearly. SPEC-02 (Sealed Classes) runs before SPEC-04 (Pattern Matching switch), so exhaustive seals can be used to drop default branches. SPEC-09 (Deprecation) runs early to clean up removed APIs before new patterns are applied.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/741/1*5IsvvIY0-LhZsjITkX6X9Q.png" /></figure><blockquote><strong>What does Specs cover?</strong></blockquote><ol><li>Records (replaces plain data classes)</li><li>Sealed Classes (closed hierarchies)</li><li>Text Blocks (multi-line strings, SQL, JSON)</li><li>Pattern Matching switch (replaces instanceof chains)</li><li>Pattern Matching instanceof (removes redundant casts)</li><li>Virtual Threads (I/O-bound executors)</li><li>Sequenced Collections (getFirst()/getLast())</li><li>String Templates (annotate candidates only — still preview)</li><li>switch Expressions (value-producing switches)</li><li>Deprecation cleanup (Thread.stop, SecurityManager, finalisers)</li></ol><h3><strong>Step 3: AI-Assisted Refactoring (Copilot)</strong></h3><p><strong>How to use it in Copilot Chat</strong></p><pre>@workspace #file:java21-migration.prompt.md Begin migration.</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/782/1*xbeDPeKLOtxIAnclpxV1Ag.png" /></figure><h3><strong>Step 4: Validation &amp; Optimization</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*p4J8j2ceDQ_Yg79Uj3hj2A.png" /></figure><h3><strong><em>Final Thoughts :</em></strong></h3><blockquote><em>Copilot is a powerful tool — but without a structured approach, it functions merely as autocomplete. However, Spec-Driven Development transforms it into a dependable engineering assistant.</em></blockquote><p>Migrating to Java 21 doesn’t have to be painful.</p><p>By combining:</p><ul><li><strong>Spec-Driven Development</strong></li><li><strong>GitHub Copilot</strong></li><li><strong>Incremental modernization</strong></li></ul><p>You can transform your codebase into a <strong>modern, scalable, and future-ready system</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u7SLtg4f0BFVNYjpcDfmvg.png" /></figure><h3><strong>Reference Articles :</strong></h3><p>New articles on how to achieve a more hands-on approach are coming soon.</p><ol><li><a href="https://medium.com/@techwithshantam/making-developers-lives-easier-with-github-copilot-and-spec-driven-development-434ef28243bb">https://medium.com/@techwithshantam/making-developers-lives-easier-with-github-copilot-and-spec-driven-development-434ef28243bb</a></li><li>Download and review the Spec here: <a href="https://github.com/TechWithShantam/java21-migration-example">@githubtechWithShantam</a></li></ol><blockquote><strong><em>Follow me for more articles, and let me know how I can improve my writing and knowledge sharing. </em></strong><em>@ </em><a href="https://www.linkedin.com/in/shantam-sultania-737084175/"><em>Shantam Sultania | LinkedIn</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=afe698f56a1b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/spec-driven-java-21-migration-a-github-copilot-workflow-that-actually-works-afe698f56a1b">Spec-Driven Java 21 Migration: A GitHub Copilot Workflow That Actually Works</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Making Developers’ Lives Easier with GitHub Copilot and Spec-Driven Development]]></title>
            <link>https://techwithshantam.medium.com/making-developers-lives-easier-with-github-copilot-and-spec-driven-development-434ef28243bb?source=rss-1437399c0d73------2</link>
            <guid isPermaLink="false">https://medium.com/p/434ef28243bb</guid>
            <category><![CDATA[java17]]></category>
            <category><![CDATA[sdd]]></category>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[migration]]></category>
            <dc:creator><![CDATA[Shantam Sultania]]></dc:creator>
            <pubDate>Mon, 05 Jan 2026 09:12:51 GMT</pubDate>
            <atom:updated>2026-01-05T09:12:51.259Z</atom:updated>
            <content:encoded><![CDATA[<blockquote><strong><em>Introduction</em></strong></blockquote><p>This series presents practical user guides and examples that demonstrate how developers can effectively utilize GitHub Copilot in their day-to-day work to solve real-world problems.</p><blockquote>In the article below, we will discuss the advantages and disadvantages of using this approach. Later, we will start with hands-on training.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CIxIM0P49Vge6EPAaOa_gQ.jpeg" /></figure><blockquote><strong>#1 Transitioning from Java 11 to Java 17: Upgrading Legacy Applications with Specification-Driven Development &amp; GitHub Copilot</strong></blockquote><blockquote><strong>Overview</strong></blockquote><p>Many enterprise applications continue to run on Java 11 simply because they are stable and familiar. However, the Java ecosystem has moved forward, and <strong>Java 17 is now the preferred long-term support (LTS) version</strong> for production systems. Upgrading is no longer just about accessing new language features — it is increasingly about <strong>security, compliance, and long-term reliability</strong>.</p><p>Staying on Java 11 exposes applications to growing security risks. Over time, fewer security patches are backported, and older runtimes rely on weaker defaults such as outdated TLS versions and deprecated cryptographic algorithms.</p><p>Critical vulnerabilities like <strong>Log4Shell (CVE-2021–44228)</strong> highlighted how deeply security flaws can impact Java-based systems, especially when legacy libraries remain unnoticed.</p><p>While upgrading Java sounds straightforward, the real difficulty lies in legacy codebases — tight coupling, hidden dependencies, and limited test coverage. Without a structured approach, manual migrations often lead to broken builds, runtime failures, and production regressions, making Java upgrades feel risky and unpredictable.</p><blockquote><strong>Understanding the Problem with Legacy Java Upgrades</strong></blockquote><p>Upgrading a legacy Java application can be more complex than it initially appears. Many teams underestimate the effort involved and assume it is just a configuration change. In reality, several hidden challenges surface during the process.</p><ul><li><strong>Why “just changing the Java version” fails</strong><br>Updating the Java version alone can break builds due to the removal of APIs, unsupported JVM options, and outdated library behavior.</li><li><strong>Common migration pain points</strong><br>Common issues include incompatible third-party dependencies, obsolete build plugins, and JVM flags that no longer work.</li><li><strong>Time and effort were wasted during manual migration</strong><br> Engineers spend weeks debugging errors, upgrading dependencies through trial and error, and fixing regressions that appear late in the process. This slows delivery and distracts teams from building new features.</li><li><strong>Setting the stage for AI assistance</strong><br> This is where AI can help by automating repetitive refactoring, dependency updates, and test generation, while humans focus on decisions and validation rather than manual troubleshooting.</li></ul><blockquote><strong>What Is Spec-Driven Development (SDD)?</strong></blockquote><ul><li>Spec-Driven Development (SDD) is an approach where changes are guided by written specifications instead of ad-hoc coding.</li><li>Teams define <em>what should change, what must not change, and how success is measured</em> before touching the code.</li><li>Specs become a shared contract for developers, reviewers, and automation tools.</li><li>This is especially useful for legacy Java systems where behavior is fragile and poorly documented.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*qteYLRjh6HMlYmYnnALK_w.png" /><figcaption>how does the file structure looks like</figcaption></figure><blockquote><strong>SDD vs Vibe Coding or Direct Agent-Based/Vibe Coding</strong></blockquote><ul><li>Vibe coding relies on intuition and quick fixes, often leading to inconsistent or risky changes.</li><li>Direct agent-based coding without specs can introduce unintended refactors and hidden regressions.</li><li>SDD adds guardrails, ensuring every change follows predefined rules and objectives.</li></ul><blockquote><strong>Defining the Migration Specs Using the SDD Flow</strong></blockquote><ul><li><strong>Analyze</strong><br> Assess the existing Java 11 application, including dependencies, JVM options, build tools, and current test coverage.(Here AI can help )</li><li><strong>Specify</strong><br> Define clear migration rules such as target Java 17 version, allowed dependencies, forbidden APIs, build configurations, and scope limits.</li><li><strong>Test</strong><br> Specify testing requirements, minimum coverage, and regression checks to ensure existing behavior remains unchanged.</li><li><strong>Implement</strong><br> Apply code, build, and dependency changes strictly following the defined specs rather than manual refactoring.</li><li><strong>Verify</strong><br> Validate the migration by running tests, builds, and CI pipelines on Java 17 before moving to higher environments.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/1*UFH4fThaWqLQ10esnySJ5w.jpeg" /></figure><blockquote><strong>Final Thoughts</strong></blockquote><p>Migrating from Java 11 to Java 17 does not need to be risky or overwhelming. Most upgrade issues arise not from Java itself, but from unstructured changes, missing rules, and a lack of safety checks in legacy systems. Spec-Driven Development brings clarity and control by defining expectations before any code is modified.</p><p>By treating a Java upgrade as an engineering process rather than a quick version bump, teams can reduce surprises, preserve existing behavior, and move forward with confidence. SDD aligns developers, reviewers, and automation around a shared definition of success.</p><p>In the next article, we move from concepts to execution, walking through a real Java 11 to Java 17 migration using practical specs, a sample repository structure, and AI-assisted implementation for backend applications.</p><p><strong>Reference Articles :</strong></p><p>New articles demonstrating how to achieve a more hands-on perspective are coming soon.</p><p><strong><em>Follow me for more articles, and let me know how I can improve my writing and knowledge sharing. </em></strong>@ <a href="https://www.linkedin.com/in/shantam-sultania-737084175/">Shantam Sultania | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=434ef28243bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From One Truck to a Fleet: Explaining Snowflake’s Multi-Cluster Magic]]></title>
            <link>https://techwithshantam.medium.com/from-one-truck-to-a-fleet-explaining-snowflakes-multi-cluster-magic-6f12cd7d134b?source=rss-1437399c0d73------2</link>
            <guid isPermaLink="false">https://medium.com/p/6f12cd7d134b</guid>
            <category><![CDATA[snowflake-computing]]></category>
            <category><![CDATA[snowflakedb]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[snowflake-connector]]></category>
            <dc:creator><![CDATA[Shantam Sultania]]></dc:creator>
            <pubDate>Fri, 20 Jun 2025 09:33:32 GMT</pubDate>
            <atom:updated>2025-06-20T09:33:32.858Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Snowflake</strong></p><blockquote><strong>Overview</strong></blockquote><p>Hey all, in this Article, we will be deep diving more into the 2nd Layer of Snowflake, that is Query processing or Computation layer</p><p>This is one of the most important layers for our understanding of data engineering from a point of view.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PNebe5NeegyC148NjenSOA.avif" /><figcaption>Snowflake Architecture Digram</figcaption></figure><blockquote><strong>What is this Query processing or Computation layer?</strong></blockquote><p>Query processing or a Computation layer is the middle layer of Snowflake Architecture. This layer is responsible for acting as both a transport and Computation for Snowflake.</p><p>Query processing or Computation layer consists of a “virtual warehouse” where each Virtual warehouse is responsible for the execution of a task and the result for the same.</p><p>As the name suggests, it&#39;s a warehouse which is existing in the cloud, hence the name virtual warehouse</p><p>Each “virtual warehouse” is made up of multiple Virtual hosts/machines Example EC2 machine and a local Cache system, which has a “share nothing” architecture</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/571/1*ij82mKdn16pVXWGJivKv9g.png" /><figcaption>break down of Virtual WareHouse</figcaption></figure><p>Now let&#39;s say, when we run a command like below</p><pre>Create warehouse my_warehouse warehouse_size = Large </pre><blockquote><strong>what happens now ?</strong></blockquote><p>Snowflake will create a Virtual Warehouse based on your chosen cloud provider and will fully manage the computing resources and cache network.</p><p>As a consumer, you don&#39;t need to take any action for this. Since Snowflake operates as a Software as a Service (SaaS), it will handle everything for you.</p><p>This layer is constructed using a series of virtual warehouses that are specifically designed to accommodate user demand.</p><p>The warehouses are categorized based on varying sizes, similar to how T-shirt sizes are designated (e.g., small, medium, large).</p><p>This approach allows for flexible scaling, ensuring that resources can be allocated efficiently according to the specific needs of users, optimizing both performance and cost-effectiveness.</p><p>By tailoring virtual warehouse sizes to user requirements, we can provide a more responsive and adaptive infrastructure that can handle fluctuations in workload seamlessly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/731/1*bosua6_agUR3Ptrlqv1yTA.png" /><figcaption>Basic Diagram of middle layer</figcaption></figure><blockquote><strong>Now let&#39;s take an Example of our favorite Ice Cream Tucks and under stand by Muti Cluster ?</strong></blockquote><p>Imagine your ice cream business is booming. You don’t just have <strong>one truck</strong> anymore — you have a <strong>fleet of trucks</strong> ready to serve people across town. This is <strong>multi-cluster</strong> in action.</p><p>Let&#39;s say each ice cream truck has one server. On a typical day, one server in one truck can easily meet customer demands.</p><p>However, on hot days or during peak hours, there can be a long line of customers outside the truck, leading to potential issues and negative feedback.</p><p>To address this, you can add more servers to the ice cream truck or deploy additional trucks at that location. Additionally, you can categorize areas with more customers into large and small segments based on traffic and workload demands.</p><p>A similar approach is applied here with a multi-cluster architecture.</p><blockquote><strong>Why It Matters in Snowflake</strong></blockquote><ul><li><strong>Elastic Performance</strong>: Handles high concurrency (many users or dashboards) smoothly.</li><li><strong>Isolated Workloads</strong>: Marketing and finance can each get their data, with no delays caused by the other.</li><li><strong>No Bottlenecks</strong>: Each request is served efficiently, scaling horizontally.</li></ul><p><strong>Reference Articles:</strong></p><ol><li><a href="https://docs.snowflake.com/en/user-guide/intro-key-concepts">https://docs.snowflake.com/en/user-guide/intro-key-concepts</a></li><li><a href="https://docs.snowflake.com/en/user-guide/warehouses-multicluster">https://docs.snowflake.com/en/user-guide/warehouses-multicluster</a></li></ol><blockquote><strong><em>Follow me for more articles and let me know how I can improve my writing and knowledge sharing. </em></strong><em>@ </em><a href="https://www.linkedin.com/in/shantam-sultania-737084175/"><em>Shantam Sultania | LinkedIn</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6f12cd7d134b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Demystifying Snowflake’s Architecture — One Ice Cream Scoop at a Time!]]></title>
            <link>https://medium.com/analytics-vidhya/snowflake-architecture-overview-b81412e24b68?source=rss-1437399c0d73------2</link>
            <guid isPermaLink="false">https://medium.com/p/b81412e24b68</guid>
            <category><![CDATA[snowflake]]></category>
            <category><![CDATA[data-engineering]]></category>
            <category><![CDATA[snowflake-computing]]></category>
            <category><![CDATA[data]]></category>
            <category><![CDATA[snowflake-data-cloud]]></category>
            <dc:creator><![CDATA[Shantam Sultania]]></dc:creator>
            <pubDate>Tue, 17 Jun 2025 19:42:06 GMT</pubDate>
            <atom:updated>2025-06-18T08:35:32.681Z</atom:updated>
            <content:encoded><![CDATA[<h3><strong>Overview</strong></h3><p>Hey, all, welcome to my Medium article for Snowflake Architecture</p><p>In this article, I’d love to share some insights about the different layers of Snowflake&#39;s architecture in the Data Warehouse.</p><p>Let’s take a friendly journey together to discover how these pieces fit together to make data management easier and more efficient!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*SMKWjd_QODgYaMpRoKgcYA.gif" /></figure><blockquote><strong><em>What is OLAP (Online Analytical Processing) ?</em></strong></blockquote><p>OLAP or Online Analytical Processing is an approach where one can analyze and process data from different points of view for business needs.</p><blockquote>Online analytical processing (OLAP) is software technology you can use to analyze business data from different points of view.</blockquote><p><strong>Let&#39;s take an example</strong> of a financial service where you, as a financial service organization, are collecting multiple types of data from multiple sources example, financial histories, credit and debit details, Company public and private reference data, and more.</p><p>Now, as an organization, you would like to collect and store this data, but also combine it and group this data together for more analysis and application insights; That&#39;s where OLAP comes in.</p><blockquote><strong>What is Snowflake?</strong></blockquote><p>Snowflake is a cloud-based advanced data platform system, provided as Software-as-a-Service (SaaS), which provides an advanced solution for OLAP (Online Analytical Processing) technology.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/498/1*Ks9dxwB29319fEWWTV0a3w.gif" /></figure><blockquote><strong>Why Snowflake ?</strong></blockquote><p>Snowflake provides a Data Platform as a Cloud Service.</p><ul><li>Provides proper data sharing as both secured objects and non-secure views with other Snowflake accounts, according to your business needs</li><li>Support proper replication and failover across multiple Snowflake accounts</li><li>Supports proper Api and Application connectivity</li><li>There is no hardware, neither virtual nor physical, to select, install, configure, or manage from the client side.</li><li>There is no software to install, configure, or manage to access it.</li><li>Snowflake itself owns all ongoing maintenance, management, upgrades, and patching.</li></ul><p>Now let&#39;s talk about Snowflake — Data Architecture, which makes it an optimal choice from both the consumer and producer point of view.</p><blockquote><strong>Snowflake Architecture</strong></blockquote><p>Snowflake enables data storage, processing, and analytic solutions that are faster, easier to use, and far more flexible than traditional offerings.</p><p><strong>Data Platform as a Self-managed Service</strong></p><ul><li>There is no hardware, neither virtual nor physical, to select, install, configure, or manage from the client side.</li><li>There is no software to install, configure, or manage to access it.</li><li>Snowflake itself owns all ongoing maintenance, management, upgrades, and patching.</li></ul><p>Snowflake runs completely on cloud infrastructure. All components of Snowflake’s service (other than optional command line clients, drivers, and connectors) run in public cloud infrastructures.</p><p>Snowflake uses virtual compute instances for its compute needs and a storage service for persistent storage of data. Snowflake cannot be run on private cloud infrastructures (on-premises or hosted).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/858/1*yjipF2FwcESQ7zxDqoV35g.png" /></figure><p>Snowflake is not a packaged software offering that can be installed by a user. Snowflake manages all aspects of software installation and updates.</p><p><strong><em>Now let&#39;s discuss its unique three-layer architecture. Snowflake consists of three layers.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PNebe5NeegyC148NjenSOA.avif" /></figure><ol><li><strong>Data storage // This is the actual Data Layer</strong></li><li><strong>Query processing // We will call this computation Layer</strong></li><li><strong>Cloud service // One can think of it as the Security and Application layer.</strong></li></ol><blockquote><strong>Data Storage Layer</strong></blockquote><ol><li><em>This layer is responsible for storing the actual data, data can be in any format, structural or non-structural.</em></li><li><em>This layer holds the actual data disc for the Data warehouse</em></li></ol><blockquote><strong>Query Processing layer or Computation Layer</strong></blockquote><ol><li>This layer consists of the actual computation power for running and processing data for your data warehouse.</li><li>Snowflake processes queries using “virtual warehouses”.</li><li>Each virtual warehouse is an MPP compute cluster composed of multiple compute nodes allocated by Snowflake from a cloud provider.</li></ol><blockquote><strong>Cloud Services</strong></blockquote><ol><li>This service acts as an application layer for an end user, through which it can access the computation layer and perform the necessary commands needed.</li><li>It acts as a security provider, authorization, and as well as helps in infrastructure management.</li></ol><blockquote><strong>Let’s take an Example of an ice cream truck, for instance.</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XHzFwXY1vTm1VljmR1eF6g.png" /></figure><p>Your and my favorite ice cream truck consists of multiple instances or items which collectively help us in delivering a good ice cream on a sunny day.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/445/1*jC51M_04sGDBnmWaG-T8xQ.gif" /></figure><ol><li>Imagine we need a freezer to keep ice cream tubs cool. This freezer can accommodate any type of ice cream, whether it’s tubs, sticks, or cones, as long as there is enough storage space available. <strong>This example illustrates the concept of a “Data Storage Layer.”</strong></li><li>If you have ice cream in your freezer, you need to prepare it for the consumer. To do this, you will need to scoop out some ice cream. The speed of this process can vary depending on the number of people involved and the size of the ice cream order. <strong>This is an example of a &quot;computation layer&quot; or &quot;query processing.&quot;</strong></li><li>Imagine you need someone to manage billing, ensure security to prevent anyone from stealing the ice cream from the freezer, and handle order processing and inquiries. <strong>This is an example of a &quot;service provider&quot; or &quot;cloud service.&quot;</strong></li></ol><p><strong>Reference Articles:</strong></p><ol><li><a href="https://docs.snowflake.com/en/user-guide/intro-key-concepts">https://docs.snowflake.com/en/user-guide/intro-key-concepts</a></li><li><a href="https://docs.snowflake.com/en/user-guide/setup">https://docs.snowflake.com/en/user-guide/setup</a></li></ol><blockquote><strong>Follow me for more articles and let me know how I can improve my writing and knowledge sharing. </strong><em>@ </em><a href="https://www.linkedin.com/in/shantam-sultania-737084175/"><em>Shantam Sultania | LinkedIn</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b81412e24b68" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/snowflake-architecture-overview-b81412e24b68">Demystifying Snowflake’s Architecture — One Ice Cream Scoop at a Time!</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Chronicles#00 Foundations of Orchestration]]></title>
            <link>https://techwithshantam.medium.com/chronicles-00-foundations-of-orchestration-f212611ac0da?source=rss-1437399c0d73------2</link>
            <guid isPermaLink="false">https://medium.com/p/f212611ac0da</guid>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[workflow-automation]]></category>
            <category><![CDATA[airflow]]></category>
            <category><![CDATA[airflow-installation]]></category>
            <category><![CDATA[apache-airflow]]></category>
            <dc:creator><![CDATA[Shantam Sultania]]></dc:creator>
            <pubDate>Wed, 16 Apr 2025 20:06:03 GMT</pubDate>
            <atom:updated>2025-04-16T20:12:44.442Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Hey Data Enthusiasts!</strong></p><p>Welcome to the First chapter of my <strong>Control Tower Chronicles </strong>Series — a series dedicated to exploring the world of workflow orchestration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pea6Mpc03cOMe7x0aSCLXg.jpeg" /></figure><p>In this first chapter we would be discussing about what do you mean by Orchestration , why Orchestration and Sample scenarios of Orchestration.</p><h4>What is Automation</h4><blockquote><strong>Definition:</strong><br>Automation is about making a <em>single task or process</em> run without human intervention.</blockquote><blockquote><strong>Think of it as: </strong><em>“Doing one thing automatically.”</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*w3nVn7_DUBoVNM6vNR4Igw.jpeg" /></figure><h4>What is Orchestration ?</h4><blockquote><strong>Definition:</strong><br>Orchestration is about <strong>coordinating multiple automated tasks</strong> across systems in a structured workflow to achieve a broader goal.</blockquote><blockquote><strong>Think of it as: </strong><em>“Automating the automation.”</em></blockquote><h4>Lets learn by taking an sample scenario “Airports”</h4><p>Let’s say you are at an Airport where you are going to take a flight to travel from City A to city B.</p><p>Now at an airport there will be multiple Task/Processes like :</p><ul><li>Passengers</li><li>Luggage</li><li>Aircraft maintenance</li><li>Boarding gates</li><li>Security</li><li>Air traffic control</li><li>Ground crews and more.</li></ul><p>All these tasks need to be completed <strong>in the right order</strong>, <strong>at the right time</strong>, and <strong>with coordination between departments</strong>.</p><blockquote><strong>Scenario 1 :</strong></blockquote><p>Once a Boarding pass is generated and scanned Ground crew will allocate the seats t the Traveller , his Lugged needs to be handled and more.</p><blockquote><strong>Scenario 2 :</strong></blockquote><p>Lets say there is a delay due to some technical issues for flight A , the control tower / centre will then look for whats the best option and notify the passengers accordingly and take the necessary steps needed to full fill the task.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QaZX683AZnCw95c85L8EnA.png" /></figure><p><strong>Here we need a coordination between multiple tasks which also needs to be monitored the Tasks.</strong></p><blockquote><strong>Why We need to Orchestration (Not Just Automation):</strong></blockquote><ul><li>Each task is automated <strong>but interdependent</strong>.</li><li>If luggage loading is delayed, boarding is delayed → the <strong>entire chain adjusts</strong>.</li><li>The control tower acts like an <strong>orchestrator</strong>, ensuring the flow of all parts, handling exceptions (like weather, delays, VIPs), and maintaining global visibility.</li></ul><p>With this Lets end our Article for Today. in next article we will dig more into orchestration tools like Airflow and Temporal explore some mini projects on the same.</p><blockquote><strong><em>A bit about myself</em></strong></blockquote><p>Hey, I’m Shantam — a backend developer based in Dehradun. I’m passionate about data integration and platform modernization, with a strong interest in cloud-based technologies and DevOps.</p><p>I enjoy building scalable systems and exploring how cloud infrastructure can drive efficiency and innovation.</p><blockquote><strong>End note:</strong></blockquote><blockquote><em>✈️ </em><strong><em>Control Tower Chronicles</em></strong><br><em>“Where automation ends and orchestration begins.”</em></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f212611ac0da" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Control Tower Chronicles: Kickoff]]></title>
            <link>https://techwithshantam.medium.com/control-tower-chronicles-kickoff-d3b5f7041438?source=rss-1437399c0d73------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3b5f7041438</guid>
            <category><![CDATA[apache-airflow]]></category>
            <category><![CDATA[airflow-installation]]></category>
            <category><![CDATA[airflow-dag]]></category>
            <category><![CDATA[orchestration]]></category>
            <category><![CDATA[airflow]]></category>
            <dc:creator><![CDATA[Shantam Sultania]]></dc:creator>
            <pubDate>Tue, 15 Apr 2025 19:11:29 GMT</pubDate>
            <atom:updated>2025-04-15T19:11:29.064Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>“Guiding data and processes through the skies of orchestration — with Apache Airflow.”</blockquote><p><strong>Hey Data Enthusiasts!</strong></p><p>Welcome to the kickoff article of my <strong>Control Tower Chronicles</strong> — a series dedicated to exploring the world of workflow orchestration.</p><p>Throughout this journey, we’ll dive deep into powerful tools like Apache Airflow and Temporal.io, unravel core concepts, and build hands-on mini projects that solve real-world, day-to-day use cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0n1QTFnjRs-sjBuE97AwQ.jpeg" /></figure><p>The whole series is divided into multiple Chronicles :</p><ol><li><strong>Chronicle #00</strong>— Why orchestration matters</li><li><strong>Chronicle #00</strong> — History behind tools/ frameworks like Airflow, Temporal and more</li><li><strong>Chronicle #01</strong>— How Airflow is acting as heart of MLOps</li><li><strong>Chronicle #01</strong>—Step by Step guides on setup of platform and trouble shooting the common errors and mistakes</li><li><strong>Chronicle #02</strong>— Writing your First DAG</li><li><strong>Chronicle #03</strong>— Integrating External Systems with Dags</li><li><strong>Chronicle #04</strong> — Building a Real-World Data Pipeline</li><li><strong>Chronicle #05</strong>— Task Dependencies and DAG Best Practices</li><li><strong>Chronicle #06 </strong>—Some more Mini Projects Ideas &amp; case studies</li><li><strong>Chronicle #07 </strong>—Comparisons on various tools</li></ol><blockquote>A bit about myself,</blockquote><p>Hey, I’m Shantam — a backend developer based in Dehradun. I’m passionate about data integration and platform modernization, with a strong interest in cloud-based technologies and DevOps.</p><p>I enjoy building scalable systems and exploring how cloud infrastructure can drive efficiency and innovation.</p><p>End note:</p><blockquote>✈️ <strong>Control Tower Chronicles</strong></blockquote><blockquote>“Guiding your data workflows from takeoff to landing.”</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3b5f7041438" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developers Guide to Cloud using Project Based Learning Part -1. B]]></title>
            <link>https://techwithshantam.medium.com/developers-guide-to-cloud-using-project-based-learning-part-1-b-09b614df0f4c?source=rss-1437399c0d73------2</link>
            <guid isPermaLink="false">https://medium.com/p/09b614df0f4c</guid>
            <category><![CDATA[terraforming]]></category>
            <category><![CDATA[learning-and-development]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[terraform-cloud]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Shantam Sultania]]></dc:creator>
            <pubDate>Sat, 13 Apr 2024 00:13:09 GMT</pubDate>
            <atom:updated>2024-04-13T00:13:09.169Z</atom:updated>
            <content:encoded><![CDATA[<h4>Cloud Resume Challenge</h4><h3>Overview</h3><p>For <strong>Part 1.a </strong>of<strong> <em>A Developers Guide to Cloud using Project Based Learning</em></strong> I wanted to demo everything without Terraform now as a next step we will add Terraform (IaaS) to our current Architecture with GitHub Actions to Automate everything as much as possible.</p><p>if you are new here Link to part one is below :</p><p><a href="https://bihari-engineer.medium.com/developers-guide-to-cloud-using-project-based-learning-part-1-a-f2ec9b7317dc">Developers Guide to Cloud using Project Based Learning Part -1. A | by Shantam Sultania | Apr, 2024 | Medium</a></p><h3>Introduction</h3><p>In part 1.B we will be working on automating all the infra deployment with the help of Terraform.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*AuqGwvmJS7JMrDF6xJRfVw.jpeg" /></figure><h3>What is Terraform?</h3><p>Terraform is a popular infrastructure-as-code tool that allows you to automate the provisioning and management of infrastructure resources. It uses configuration files written in the HashiCorp Configuration Language (HCL) to define the desired state of your infrastructure, and it uses various commands to apply those configurations and manage your infrastructure resources. read more here : <a href="https://www.geeksforgeeks.org/what-is-terraform/">What is Terraform? — GeeksforGeeks</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*DNY40MYxvrPzZDuyzHYhHQ.jpeg" /></figure><h3>Project Structure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/1*dHpITDIZ1SE7nRThjMVtqQ.png" /><figcaption>Project Structure</figcaption></figure><h3>Terraform Structure</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/406/1*r2ki41KzHYT3ynEenrwg8A.png" /></figure><p>We have divided our Terraform project into 3 parts.</p><ol><li>Provider<br>This holds all the main or provider information every terraform module needs a provider example AWS this helps in enabling the plugin to make interactions with external API’s.</li><li>Main <br>This is the main or primary endpoint for a TF file without this terraform may not get initialized properly.</li><li>Input/Output <br>These are set of files which are used to store input and output variables so that the whole terraform file is clear to understand.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/537/1*n2jxzpoADy5L0xLpYtwqZg.png" /><figcaption>Terraform Structure</figcaption></figure><h3>Architecture Diagram</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yJShCVgdNPzaDwyGBbRcmA.png" /><figcaption>Cloud Resume Architecture</figcaption></figure><h3>Requirements Gathering and Recalling what we did in Part 1.A</h3><blockquote>let’s, recall everything, we did last time manually.</blockquote><p>This is a great way to break down the steps which you need to automate.</p><p>This also helps us in reducing the Errors and knowing what needs to be automated and what are the requirements for our whole process.</p><blockquote>Example:</blockquote><p>For Cloud Resume to be deployed as a static website we had to add the policy to our bucket with helped enable access to our Cloud Resume and more …</p><blockquote>Accordingly, I have broken the whole process down into the below Steps.</blockquote><ol><li><strong><em>Create an I am Role in AWS to reduce multiple policy creation.</em></strong></li><li><strong><em>Create an S3 bucket first to check the storage of the Cloud Resume</em></strong></li><li><strong><em>Enable and update bucket configurations, add ownership controls and update Bucket Public Access policy.</em></strong></li><li><strong><em>Test this creation by running the Terraform plan for any Errors and resolve the errors if any.</em></strong></li><li><strong><em>Work on AWS Lambda Creation, Create Data module for AWS Lambda Backend code i.e. function handler.</em></strong></li><li><strong><em>Create AWS lambda function and AWS lambda function URL (as I don&#39;t have a custom domain, we are trying to avoid CORS errors so for now not using AWS API Gateway and AWS Route 53 will update in part 1.C)</em></strong></li><li><strong><em>Test and Deploy AWS Lambda Function.</em></strong></li><li><strong><em>Setup CI/CD pipeline for the same and Test</em></strong></li></ol><blockquote>Step 1: Create I AM ROLE</blockquote><p>for this step to avoid multiple Policy creation in terraform i create an IAM user role in AWS manually and granted access to it to our AWS S3, AWS Lambda and DynamoDB.</p><blockquote>Step 2: Create an S3 bucket using Terraform.</blockquote><p>this is a very simple process.</p><p>for this we will be using the below code spinet</p><p>we need to define which function to use example “awss3_bucket” followed by a variable for that function example “my_aws_bucket_example02”.</p><pre>resource &quot;aws_s3_bucket&quot; &quot;my_aws_bucket_example02&quot; {<br><br>  bucket = var.aws_bucket_name<br>}</pre><p>to make the bucket name as a user input we have defined it via input variable.</p><pre>variable &quot;aws_bucket_name&quot; {<br><br>  description = &quot;this is sample bucket name&quot;<br>  type        = string<br>  default     = &quot;mybucketss-new1.com&quot;<br>}</pre><p>here, aws_bucket_name is the name of variable, if you want a hard coded value, you can define it in default as shown above.</p><blockquote>Step 3: add and update policy and permissions.</blockquote><p>first let&#39;s enable the public access to our bucket.</p><pre>resource &quot;aws_s3_bucket_public_access_block&quot; &quot;site&quot; {<br>  bucket = aws_s3_bucket.my_aws_bucket_example02.id<br><br>  block_public_acls       = false<br>  block_public_policy     = false<br>  ignore_public_acls      = false<br>  restrict_public_buckets = false<br>}</pre><p>after that we will work on setting up the Static confg</p><pre>resource &quot;aws_s3_bucket_website_configuration&quot; &quot;site&quot; {<br>  bucket = aws_s3_bucket.my_aws_bucket_example02.id<br><br>  index_document {<br>    suffix = &quot;home.html&quot;<br>  }<br><br>  error_document {<br>    key = &quot;resumeErrorFile.html&quot;<br>  }<br>}</pre><p>after that ACL and ownership this helps in proper access to the resource</p><pre>resource &quot;aws_s3_bucket_ownership_controls&quot; &quot;site&quot; {<br>  bucket = aws_s3_bucket.my_aws_bucket_example02.id<br>  rule {<br>    object_ownership = &quot;BucketOwnerPreferred&quot;<br>  }<br>}<br>resource &quot;aws_s3_bucket_acl&quot; &quot;site&quot; {<br>  bucket = aws_s3_bucket.my_aws_bucket_example02.id<br><br>  acl        = &quot;public-read&quot;<br>  depends_on = [<br>    aws_s3_bucket_ownership_controls.site,<br>    aws_s3_bucket_public_access_block.site<br>  ]<br>}</pre><p>Last but not the least add read data policy to the bucket.</p><pre>resource &quot;aws_s3_bucket_policy&quot; &quot;site&quot; {<br>  bucket = aws_s3_bucket.my_aws_bucket_example02.id<br><br>  policy = jsonencode({<br>    Version   = &quot;2012-10-17&quot;<br>    Statement = [<br>      {<br>        Sid       = &quot;PublicReadGetObject&quot;<br>        Effect    = &quot;Allow&quot;<br>        Principal = &quot;*&quot;<br>        Action    = &quot;s3:GetObject&quot;<br>        Resource  = [<br>          aws_s3_bucket.my_aws_bucket_example02.arn,<br>          &quot;${aws_s3_bucket.my_aws_bucket_example02.arn}/*&quot;,<br>        ]<br>      },<br>    ]<br>  })<br><br>  depends_on = [<br>    aws_s3_bucket_public_access_block.site<br>  ]<br>}</pre><p>This will grant final access to our Cloud Resume to be visible.</p><blockquote>Step 4 : Test and Deploy</blockquote><p>for this we need to run 3 commands</p><blockquote>Terraform init</blockquote><p>After writing your code or cloning your existing Terraform code from source control, the terraform init command is the first command you should use to initialize the working directory.</p><p>In order to prepare the working directory for use with Terraform, the terraform init command performs the following steps:</p><ul><li>Backend Initialization</li><li>Child Module Installation</li><li>Plugin Installation</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GduKSxlisa1VhRUFcZuJ8Q.png" /><figcaption>Terraform init</figcaption></figure><p>now before deploying let&#39;s test this out by Terraform Plan</p><blockquote>Terraform Plan</blockquote><p>Terraform plan is a Terraform CLI command that previews the changes that will be made to the infrastructure based on the current code configuration. It generates and displays an execution plan, detailing which actions will be taken on which resources, allowing for a review before actual application.</p><p>The terraform plan command does three things:</p><ul><li>Ensures the state is up to date by reading the current state of any already-existing remote infrastructure.</li><li>Determines the deltas between the current configuration and the prior state data.</li><li>Proposes a series of changes that will make the remote infrastructure match the current configuration.</li></ul><p>This can be used to check for any error in early stage of development as well</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wSvzU-RtSjDO_P3BR_Lajg.png" /><figcaption>error handling using terraform plan.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*8Jz3JHCs-d8ytHE3srzE3A.jpeg" /></figure><p>when success Terraform, plan will inform us of what and how many resources are getting updated or change or destroyed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/701/1*kuqxpDz4H9kJuqYvAbooMQ.png" /><figcaption>Terraform Plan 1.2</figcaption></figure><blockquote>Terraform Apply</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/949/1*b7avWqN7zdjWEmHSvdmQ8w.jpeg" /></figure><p>This is the last stage which is responsible for Deployment of our resource.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*W_FCPb3cl7Ye9AlAsZDeCQ.png" /></figure><p>Result after Terraform Apply, Cloud Resume Deployed successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rMyEuystP-69n9XIFdG_7w.png" /><figcaption>Cloud Resume Deployed successfully</figcaption></figure><blockquote>Step 5: Create Data module for AWS Lambda Backend code i.e. function handler.</blockquote><p>Data module holds data like what&#39;s the name of source of backend code for our AWS Lambda function.</p><pre>data &quot;archive_file&quot; &quot;zip_the_python_code&quot; {<br>  type        = &quot;zip&quot;<br>  source_dir  = &quot;${path.module}/backendApiLambda/&quot;<br>  output_path = &quot;${path.module}/backendApiLambda/lambdaCode.zip&quot;<br><br>}</pre><p>We also need a sample .py Script to get the visitor count from out AWS DynamoDB Table.</p><pre>import json<br>import logging<br>import os<br><br>import boto3<br><br>dynamodb_client = boto3.client(&quot;dynamodb&quot;, region_name=&#39;us-east-1&#39;)<br><br><br>def lambda_handler(event, context):<br>    # TODO implement<br>    response = dynamodb_client.get_item(TableName=os.getenv(&quot;DYNAMODB_TABLE&quot;), Key={&#39;CounterName&#39;: {&#39;S&#39;: &#39;visitors&#39;}})<br><br>    logging.debug(response)<br><br>    current_visit_count = int(list(response.get(&#39;Item&#39;).get(&#39;visits&#39;).values())[0]) + 1<br><br>    logging.debug(list(response.get(&#39;Item&#39;).get(&#39;visits&#39;).values())[0])<br>    logging.debug(current_visit_count)<br><br>    dynamodb_client.update_item(<br>        TableName=os.getenv(&quot;DYNAMODB_TABLE&quot;),<br>        Key={&#39;CounterName&#39;: {&#39;S&#39;: &#39;visitors&#39;}},<br>        UpdateExpression=&quot;SET visits = :newVisitor&quot;,<br>        ExpressionAttributeValues={&quot;:newVisitor&quot;: {&#39;S&#39;: str(current_visit_count)}}<br>    )<br><br>    headers = {<br>        &#39;Content-Type&#39;: &#39;application/json&#39;,<br>        &#39;Access-Control-Allow-Methods&#39;: &#39;POST&#39;,<br>        &quot;Access-Control-Allow-Headers&quot;: &quot;Content-Type&quot;<br>    }<br><br>    data = {&quot;visits&quot;: current_visit_count}<br><br>    result = {<br>        &#39;statusCode&#39;: 200,<br>        # &#39;headers&#39;:headers,<br>        &quot;body&quot;: json.dumps(data),<br>        &quot;headers&quot;: {<br>            &quot;Content-Type&quot;: &quot;application/json&quot;,<br>            &quot;Access-Control-Allow-Headers&quot;: &quot;Content-Type&quot;,<br>            &quot;Access-Control-Allow-Methods&quot;: &quot;POST&quot;,<br>        },<br>    }<br><br>    return result;</pre><p>After this we can work on creating the Terraform Configurations for AWS Lambda Function and Function URL Creation</p><blockquote>Step 6: Create AWS lambda function and AWS lambda function URL.</blockquote><p>The process involves letting Terraform the location of our lambda handler code and also the configurations for our Lambda function which runtime env it needs to run and also, we can pass Environmental variables in this part as parameters.</p><pre>resource &quot;aws_lambda_function&quot; &quot;myCounterApiFunc&quot; {<br><br>  filename         = data.archive_file.zip_the_python_code.output_path<br>  source_code_hash = data.archive_file.zip_the_python_code.output_base64sha256<br><br>  function_name = var.lambda_function_name<br>  role          = var.aws_role_arn<br>  handler       = &quot;lambdaCode.lambda_handler&quot;<br>  runtime       = &quot;python3.8&quot;<br><br>  environment {<br>    variables = {<br>      DYNAMODB_TABLE = var.table_name<br>    }<br>  }<br>}</pre><pre>resource &quot;aws_lambda_function_url&quot; &quot;url1&quot; {<br>  function_name      = aws_lambda_function.myCounterApiFunc.function_name<br>  authorization_type = &quot;NONE&quot;<br>}</pre><blockquote>Step 7 : Test and Deploy AWS Lambda Function.</blockquote><p>Once done we will again follow the same process to run the 3 Terraform commands.</p><blockquote>Terraform init</blockquote><blockquote>Terraform plan</blockquote><blockquote>Terraform apply</blockquote><p>here you can pass variable values as inputs as below to save time:</p><pre>terraform apply  -var=&quot;aws_bucket_name=${{ secrets.AWS_S3_BUCKET }}&quot;  -var=&quot;aws_role_arn=${{ secrets.AWS_IAM_ROLE }}&quot;  -var=&quot;table_name=${{ secrets.AWS_DB_TABLE_NAME }}&quot; -var=&quot;lambda_function_name=${{ secrets.AWS_LAMBDA_FUCNTION_NAME }}&quot; -no-color -input=false -auto-approve</pre><blockquote>Step 8 : Setup CI/CD pipeline for the same and Test</blockquote><p>Know the Last Step is to test the deployment by Setting up the CI/CD pipeline for our code.</p><p>For this I separate the pipeline for front end code and back-end code using GitHub Workflow → paths.</p><p>This will help us with separating the deployment for front end Cloud Resume and Back end Infra and AWS Lambda updates.</p><h4>Front — end CI/ CD Pipeline</h4><pre>name: Upload frontend<br><br>on:<br>  push:<br>    branches:<br>      - main<br>    paths:<br>      - &#39;Resume-website/**&#39;<br><br>permissions:<br>  contents: read<br>  issues: write<br><br>env:<br>  AWS_REGION: &#39;us-east-1&#39;<br>  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}<br>  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}<br><br><br>jobs:<br>  list-changes:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: List Changed Files<br>        run: |<br>          echo &quot;Changed Files:&quot;<br>          echo &quot;${{ github.event_name }} event&quot;<br>          echo &quot;Modified Files: ${{ github.event.head_commit.modified }}&quot;<br>          echo &quot;Added Files: ${{ github.event.head_commit.added }}&quot;<br>          echo &quot;Removed Files: ${{ github.event.head_commit.removed }}&quot;<br>  front-end-deploy:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: checkout github<br>        uses: actions/checkout@master<br>      - name: approval required<br>        uses: trstringer/manual-approval@v1<br>        with:<br>          secret: ${{ github.TOKEN }}<br>          approvers: shantamsultania<br>          minimum-approvals: 1<br>          issue-title: &quot;Deploying v1.0.0 to prod&quot;<br>          issue-body: &quot;Review the code before deployment, then approve or deny the deployment of v1.0.0 to prod.&quot;<br>          exclude-workflow-initiator-as-approver: false<br>      - name: upload to S3 bucket<br>        uses: jakejarvis/s3-sync-action@master<br>        with:<br>          args: --acl private --follow-symlinks --delete<br>        env:<br>          AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}<br>          AWS_REGION: &#39;us-east-1&#39;<br>          SOURCE_DIR: &#39;Resume-website&#39;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OTd1cie2ad-iJaTTKW1yIQ.png" /></figure><h4>Back — End CI/CD pipeline</h4><pre>name: Upload backend<br><br>on:<br>  push:<br>    branches:<br>      - main<br>    paths:<br>      - &#39;terraform/**&#39;<br><br>permissions:<br>  contents: read<br>  issues: write<br><br>env:<br>  AWS_REGION: &#39;us-east-1&#39;<br>  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}<br>  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}<br><br>jobs:<br>  list-changes:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: List Changed Files<br>        run: |<br>          echo &quot;Changed Files:&quot;<br>          echo &quot;${{ github.event_name }} event&quot;<br>          echo &quot;Modified Files: ${{ github.event.head_commit.modified }}&quot;<br>          echo &quot;Added Files: ${{ github.event.head_commit.added }}&quot;<br>          echo &quot;Removed Files: ${{ github.event.head_commit.removed }}&quot;<br>  backend-aws-deploy:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: Checkout Git repository<br>        uses: actions/checkout@master<br>      - name: Setup terraform<br>        uses: hashicorp/setup-terraform@v1<br>        with:<br>          aws_bucket_name: ${{ secrets.AWS_S3_BUCKET }}<br>          aws_role_arn: ${{ secrets.AWS_IAM_ROLE }}<br>          table_name: ${{ secrets.AWS_DB_TABLE_NAME }}<br>      - name: Terraform init and validate<br>        working-directory: ./terraform<br>        run: terraform init<br>      - name: terraform plan and test<br>        working-directory: ./terraform<br>        run: terraform plan  -var=&quot;aws_bucket_name=${{ secrets.AWS_S3_BUCKET }}&quot;  -var=&quot;aws_role_arn=${{ secrets.AWS_IAM_ROLE }}&quot;  -var=&quot;table_name=${{ secrets.AWS_DB_TABLE_NAME }}&quot; -var=&quot;lambda_function_name=${{ secrets.AWS_LAMBDA_FUCNTION_NAME }}&quot;<br>      - name: approval required<br>        uses: trstringer/manual-approval@v1<br>        with:<br>          secret: ${{ github.TOKEN }}<br>          approvers: shantamsultania<br>          minimum-approvals: 1<br>          issue-title: &quot;Deploying v1.0.0 to prod&quot;<br>          issue-body: &quot;Review the terraform plan, then approve or deny the deployment of v1.0.0 to prod.&quot;<br>          exclude-workflow-initiator-as-approver: false<br>      - name: terraform apply to prod<br>        working-directory: ./terraform<br>        run: terraform apply  -var=&quot;aws_bucket_name=${{ secrets.AWS_S3_BUCKET }}&quot;  -var=&quot;aws_role_arn=${{ secrets.AWS_IAM_ROLE }}&quot;  -var=&quot;table_name=${{ secrets.AWS_DB_TABLE_NAME }}&quot; -var=&quot;lambda_function_name=${{ secrets.AWS_LAMBDA_FUCNTION_NAME }}&quot; -no-color -input=false -auto-approve</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/918/1*qPFuKUrKzQuimI9XFvaY9g.png" /><figcaption>GitHub Actions Flow and Deployment Status</figcaption></figure><h3>Final Result:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DOrBDIk7gLLAe1kTpgy6UQ.png" /></figure><h3><strong>So, What&#39;s Next?</strong></h3><p>For Part 1.C we will be adding a Cutom Domain to our Cloud Resume and also updating the UI making it more Intractive and also including AWS Route 53 for Domain Setup and Cloud Front for DNS of our Cloud Resume.</p><p>Project files Store GitHub Repo: <a href="https://github.com/shantamsultania/Developers-Guide-to-Cloud-using-Project-Based-Learning">shantamsultania/Developers-Guide-to-Cloud-using-Project-Based-Learning (github.com)</a></p><blockquote><em>Follow me on my Journey of </em><strong><em>a Developers Guide to Cloud using Project Based Learning </em></strong><em>where I am complete 4 beginner to Intermediate level Projects!</em></blockquote><blockquote><em>@ </em><a href="https://www.linkedin.com/in/shantam-sultania-737084175/"><em>Shantam Sultania | LinkedIn</em></a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=09b614df0f4c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Developers Guide to Cloud using Project Based Learning Part -1. A]]></title>
            <link>https://medium.com/analytics-vidhya/developers-guide-to-cloud-using-project-based-learning-part-1-a-f2ec9b7317dc?source=rss-1437399c0d73------2</link>
            <guid isPermaLink="false">https://medium.com/p/f2ec9b7317dc</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[cloud-resume-challenge]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[terraform-cloud]]></category>
            <category><![CDATA[learning-to-code]]></category>
            <dc:creator><![CDATA[Shantam Sultania]]></dc:creator>
            <pubDate>Thu, 11 Apr 2024 08:55:54 GMT</pubDate>
            <atom:updated>2024-04-11T08:55:54.518Z</atom:updated>
            <content:encoded><![CDATA[<h4><strong>Cloud Resume Challenge</strong></h4><blockquote><strong>So, what is this Cloud Resume Challenge?</strong></blockquote><p>The Cloud Resume Challenge by <a href="https://forrestbrazeal.com/">Forrest Brazel</a> is a fun yet challenging way of one&#39;s approach towards Resume’s.</p><p>This is a 16 Steps challenge in which you will be creating your own dynamic and Intractive Resume using power of Cloud Technologies, IaaS and DevOps (CI/CD pipelines).</p><p>This step-by-step guide will walk you through the process of leveraging AWS services like S3, CloudFront, DynamoDB, Lambda, Route53, and GitHub</p><p>If you want to learn more about the challenge and explore other success stories, be sure to visit: <a href="https://cloudresumechallenge.dev/">https://cloudresumechallenge.dev/</a></p><p>so, are you ready to take your resume to the next level and leave a lasting impression on potential employers?</p><blockquote><strong>Learning Objective:</strong></blockquote><p>by the end of this Whole Project, you will be able to learn.</p><ol><li>How to deploy a Static website using AWS S3 and Cloud Front</li><li>How to configure AWS Lambda with a database (AWS Dynamo DB)</li><li>How to configure a Custom Domain in AWS using AWS Route 54 (Optional)</li><li>How to deploy and end to end Application using Terraform (IAAC)</li><li>CI/CD pipelines how to separate deployment for infra, Back-end and Front-end Code.</li><li>and more ….</li></ol><h3>Getting Started:</h3><p>For part one we will be tackling the static deployment of the code/ Resume to AWS S3 Bucket and then configure AWS Lambda with Database Connectivity (AWS DynamoDB) also we will be moving the static Deployment to Cloud front for better experience and have DNS system availability for our Cloud Resume</p><p>Optional: For first part i am not adding a custom domain so i am skipping AWS Route 53 for now this i will add later in part c of my Project thus making it an optional item.</p><h3>Project Overview</h3><h4>Project Structure</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/265/1*jUidrTuRC5m6zVtt6rc08w.png" /><figcaption>initial Project Structure for Front End File</figcaption></figure><h4>Architecture Diagram</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*5Cl6_YfxVjkABmzi3xMcVQ.png" /><figcaption>Cloud Resume Architecture Diagram</figcaption></figure><p>For <strong>Part 1.a </strong>of<strong> <em>A Developers Guide to Cloud using Project Based Learning</em></strong> I wanted to demo everything without Terraform now as a next step we will add Terraform (IaaS) to our current Architecture with GitHub Actions to Automate everything as much as possible.</p><p>So, without wasting time let&#39;s start:</p><h3>Step 1: Setting up the frontend website.</h3><blockquote>Flow: <br>Resume Website Code -&gt; GitHub</blockquote><p>I created a simple website using HTML, CSS and JS to display some content and also created a JS script to get the visitor count of people visiting my Resume.</p><p>Once Done I deployed the same to GitHub.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/876/1*TRnf4shMZ06OPUbUCYkrXw.png" /><figcaption>Sample Resume Front End with Visitor Count</figcaption></figure><pre>var visitorCount = localStorage.getItem(&quot;page_view&quot;);<br><br>//setting up a visitor count<br><br>if(visitorCount){<br>visitorCount = Number(visitorCount) + 1;<br>}<br>else{<br>visitorCount = 1;<br>}<br>localStorage.setItem(&quot;page_view&quot;, visitorCount);<br><br>console.log(&quot;count is &quot;, visitorCount);<br><br>var display = document.getElementById(&quot;counter-output&quot;);<br>const textnode = document.createTextNode(visitorCount);<br>display.appendChild(textnode);<br><br>// setting up a reset btn after 50 visitor count<br>if(visitorCount &gt;= 50 ){<br>visitorCount = 1;<br>localStorage.setItem(&quot;page_view&quot;, visitorCount);<br>}</pre><h3>Step 2: Deploy Resume to an AWS S3 bucket to create a Static Website manually.</h3><blockquote>Flow: <br>Resume Website Code -&gt; GitHub -&gt; GitHub Actions -&gt; AWS s3 -&gt; AWS CloudFront</blockquote><p>first, I logged in to my AWS Console and created a sample S3 Bucket manually and uploaded the Code also I configured it to make the website Static.</p><p>once the code has been uploaded you need to enable the Static web hosting, after that you can try it out by the link given below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*o_9xMPtqjxrt5zBbx8_uNQ.png" /><figcaption>Static Hosting done</figcaption></figure><p>but wait why does it says Error 403?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/805/1*Pr-V07LEtw0W8-y7ngAWqQ.png" /></figure><p>This is because we have not added the policies to allow the traffic and read the bucket objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H7U3VI90HKEiJJheLQMzlg.png" /></figure><p>now add the bucket policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/728/1*HGSsEYaI--vtzvotyIU4ew.png" /></figure><pre>{<br>    &quot;Version&quot;: &quot;2012-10-17&quot;,<br>    &quot;Statement&quot;: [<br>        {<br>            &quot;Sid&quot;: &quot;PublicReadGetObject&quot;,<br>            &quot;Effect&quot;: &quot;Allow&quot;,<br>            &quot;Principal&quot;: &quot;*&quot;,<br>            &quot;Action&quot;: &quot;s3:GetObject&quot;,<br>            &quot;Resource&quot;: &quot;arn:aws:s3:::new-bucket-project1-cloud-resume-challenge/*&quot;<br>        }<br>    ]<br>}</pre><p>Result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I_z_6xsecj7VamDMWw8l9Q.png" /></figure><h3>Step 3: Setting up Back-end.</h3><blockquote>Flow: <br>AWS Lambda -&gt; DynamoDB</blockquote><p>A part of the Challenge is to make it Intractive plus Dynamic, to do so we have a functionality to implement here that is add visitor counts basically out resume website should show each visitor count.</p><p>to store Visitor Count we are using AWS DynamoDB and to update and retrieve it I will be using AWS Lambda.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9GQP4KqKQxSBrvXWqTiLPg.png" /><figcaption>AWS Lambda Function</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m9vhHXSzMJoScywXQX7zAw.png" /></figure><p>API Testing</p><pre>{<br>  &quot;statusCode&quot;: 200,<br>  &quot;body&quot;: &quot;{\&quot;visits\&quot;: 137}&quot;,<br>  &quot;headers&quot;: {<br>    &quot;Content-Type&quot;: &quot;application/json&quot;,<br>    &quot;Access-Control-Allow-Headers&quot;: &quot;Content-Type&quot;,<br>    &quot;Access-Control-Allow-Methods&quot;: &quot;POST&quot;<br>  }<br>}</pre><p>Once Done I updated the Resume Website Code to use AWS Lambda in place of the JS Script to get Visitor Count.</p><pre>async function updateCounter() {<br>    return await fetch(VISITORS_ENDPOINT_LAMBDA_CROS)<br>        .then(it =&gt; {<br>        console.log(&quot;log 1&quot;)<br>            if (!it.ok) {<br>                throw &quot;Server error: [${it.status}] [${it.statusText}] [${it.url}]&quot;;<br>            }<br>            return it.json();<br>        })<br>        .then(receivedJson =&gt; {<br>        console.log(&quot;log 2&quot;)<br>            console.log(receivedJson);<br>            const visitorCount = receivedJson.visits;<br>            const textnode = document.createTextNode(visitorCount);<br>            display.appendChild(textnode);<br>        })<br>        .catch(err =&gt; {<br>        console.log(&quot;log 3 &quot;)<br>            console.log(&quot;Error in fetch&quot;, err);<br>        });<br>}<br>console.log(&quot;working &quot;)<br>window.addEventListener(&quot;DOMContentLoaded&quot;, updateCounter());</pre><h3>Step 4: Setting up CI/CD Pipeline</h3><p>Once I have tried everything out, I added automation to it with GitHub Actions</p><p>Every time there is a change in the Front-end Code it should deploy the code again to AWS S3 Bucket and it should work without any issue.</p><p>Front — end CI/CD pipeline.</p><p>this is responsible to update the Code changes to S3 bucket.</p><pre>name: Upload frontend<br><br>on:<br>  push:<br>    branches:<br>      - main<br>    paths:<br>      - &#39;Resume-website/**&#39;<br><br>permissions:<br>  contents: read<br>  issues: write<br><br>env:<br>  AWS_REGION: &#39;us-east-1&#39;<br>  AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}<br>  AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}<br><br><br>jobs:<br>  list-changes:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: List Changed Files<br>        run: |<br>          echo &quot;Changed Files:&quot;<br>          echo &quot;${{ github.event_name }} event&quot;<br>          echo &quot;Modified Files: ${{ github.event.head_commit.modified }}&quot;<br>          echo &quot;Added Files: ${{ github.event.head_commit.added }}&quot;<br>          echo &quot;Removed Files: ${{ github.event.head_commit.removed }}&quot;<br>  front-end-deploy:<br>    runs-on: ubuntu-latest<br>    steps:<br>      - name: checkout github<br>        uses: actions/checkout@master<br>      - name: approval required<br>        uses: trstringer/manual-approval@v1<br>        with:<br>          secret: ${{ github.TOKEN }}<br>          approvers: shantamsultania<br>          minimum-approvals: 1<br>          issue-title: &quot;Deploying v1.0.0 to prod&quot;<br>          issue-body: &quot;Review the code before deployment, then approve or deny the deployment of v1.0.0 to prod.&quot;<br>          exclude-workflow-initiator-as-approver: false<br>      - name: upload to S3 bucket<br>        uses: jakejarvis/s3-sync-action@master<br>        with:<br>          args: --acl private --follow-symlinks --delete<br>        env:<br>          AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}<br>          AWS_REGION: &#39;us-east-1&#39;<br>          SOURCE_DIR: &#39;Resume-website&#39;</pre><p>this Should run when we have changes to only Front end code</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bEreBvkglvA4bug0NGz1cg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jiw-M_iv93x8X1HAHamwNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qOoeVb1IBHQAjABBFhFC1g.png" /></figure><h3>Final Result:</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*4J-xzrAJ4-WaomfrOAq5dw.gif" /><figcaption>Final Result</figcaption></figure><p>Project files Store GitHub Repo: <a href="https://github.com/shantamsultania/Developers-Guide-to-Cloud-using-Project-Based-Learning">shantamsultania/Developers-Guide-to-Cloud-using-Project-Based-Learning (github.com)</a></p><blockquote><em>Follow me on my Journey of </em><strong><em>a Developers Guide to Cloud using Project Based Learning </em></strong><em>where I am complete 4 beginner to Intermediate level Projects!</em></blockquote><blockquote>@ <a href="https://www.linkedin.com/in/shantam-sultania-737084175/">Shantam Sultania | LinkedIn</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f2ec9b7317dc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/developers-guide-to-cloud-using-project-based-learning-part-1-a-f2ec9b7317dc">Developers Guide to Cloud using Project Based Learning Part -1. A</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Best Pickup Lines Ever API using Flask-Python]]></title>
            <link>https://techwithshantam.medium.com/best-pickup-lines-ever-api-using-flask-python-1130d1bd227a?source=rss-1437399c0d73------2</link>
            <guid isPermaLink="false">https://medium.com/p/1130d1bd227a</guid>
            <category><![CDATA[flask-framework]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[crush]]></category>
            <category><![CDATA[love]]></category>
            <category><![CDATA[funny]]></category>
            <dc:creator><![CDATA[Shantam Sultania]]></dc:creator>
            <pubDate>Tue, 18 Apr 2023 14:22:02 GMT</pubDate>
            <atom:updated>2023-04-18T14:23:53.202Z</atom:updated>
            <content:encoded><![CDATA[<h3>Best Pickup Lines Ever an API using Flask-Python</h3><p>This article is a quick tutorial to create a CRUD API using Flask-Python</p><p>To make learning fun we will be using the use case as an app to give us some <strong>Pickup lines </strong>which we want to use to impress our crush.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*q9EUvSwCRQ-X-AanSYPEcw.jpeg" /></figure><p><strong>So, without wasting our precious time let&#39;s start:</strong></p><blockquote><strong>What is Flask-Python</strong></blockquote><figure><img alt="A Web Framework for all your needs" src="https://cdn-images-1.medium.com/max/1024/1*KEWo7ttVrwuv9XG9h9rmKw.jpeg" /></figure><p>Flask is a web framework, it’s a Python module that lets you develop web applications easily. It’s has a small and easy-to-extend core: it’s a microframework that doesn’t include an ORM (Object Relational Manager) or such features.</p><p>It does have many cool features like URL routing, template engine. It is a WSGI web app framework.</p><p>Flask is based on the WSGI toolkit and the Jinja2 template engine.</p><p><strong>Let&#39;s Get Started with the Best Pickup lines Api:</strong></p><blockquote>Architecture:</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/608/1*2-gEk3tdt55T1tu9F-IaGw.png" /></figure><p>The whole App is divided into 3 Parts.</p><ol><li>Service Provider: <br>This is responsible for providing Basic functionalities to the App <br>example: - get Dad Jokes, add Dad jokes, etc. …</li><li>Handler:<br>This is responsible for handling the Services Data and Request and will route the service with appropriate request.</li><li>App Controller:<br>This is responsible for handling the Service Request.</li><li>Helper Classes: <br>This classes for the API</li></ol><p>Code:</p><ol><li>Helper Class: —</li></ol><pre># This is currently acting as a database for Pickup lines <br><br># A list of Pick up lines <br><br>list_of_pickup_lines = [<br>    &#39;I would flirt with you, but I would rather seduce you with my awkwardness.&#39;,<br>    &#39;I believe in following my dream. Can I have your Instagram?&#39;,<br>    &#39;I believe in following my dream. Can I have your Instagram?&#39;,<br>    &#39;I hope you know CPR because you are taking my breath away.&#39;,<br>    &#39;What does it feel like to be the most gorgeous girl in the room?&#39;,<br>    &#39;I have never been in an Escape Room, but here I am, wanting to solve the riddle that is you.&#39;,<br>    &#39;If you were a song, you would be the best track on the album.&#39;,<br>    &#39;Well, here I am! What are your other two wishes?&#39;,<br>    &#39;Are you a parking ticket? You have got FINE written all over you.&#39;,<br>    &#39;Call me a thief cause I want to steal your heart.&#39;<br>]</pre><p>2. Service Provider: —</p><pre># This will Handle the CRUD APP working<br><br># C = Create<br># R = Read<br># U = Update<br># D = Delete<br><br># have methords lile <br><br>&quot;&quot;&quot; <br>Methord present <br> 1. get_pickup_lines <br> 2. get_pickup_line <br> 3. add_PickupLines<br> 4. delete_PickupLine<br> 5. update_PickupLine<br>  <br>&quot;&quot;&quot;<br># get multiple PickupLines<br>def get_pickup_lines():<br>    return pickup_lines<br><br><br># get a PickupLine<br>def get_pickup_line():<br>    return random.choice(pickup_lines)<br><br><br># add a PickupLine<br>def add_PickupLines(pickup_line):<br>    pickup_lines.append(pickup_line)<br>    return f&#39;PickupLine has been added to the database new PickupLine = {pickup_lines[len(pickup_lines) - 1]}&#39;<br><br><br># update a PickupLine<br>def update_PickupLine(pickup_line_to_be_updated, updated_pickup_line):<br>    for idx, item in enumerate(pickup_lines):<br>        if pickup_line_to_be_updated == item:<br>            pickup_lines[idx] = updated_pickup_line<br>    return get_pickup_lines()<br><br><br># delete a PickupLine<br>def delete_PickupLine(pickup_line):<br>    previous_count = len(pickup_lines)<br>    pickup_lines.remove(pickup_line)<br>    return f&#39;PickupLine has been removed from the database old count = {previous_count} new count = {len(pickup_lines)} &#39;<br></pre><p>3. App Handler: —</p><pre><br>&quot;&quot;&quot; <br>This is responsible for Routeing the app request<br>&quot;&quot;&quot;<br><br><br><br>from PickupLineApp.Service.ServiceProvider import get_pickup_lines, get_pickup_line, add_PickupLines, delete_PickupLine, \<br>    update_PickupLine<br>from flask import Flask, request<br><br>app = Flask(__name__)<br><br><br>@app.route(&quot;/getPickupLines&quot;, methods=[&#39;GET&#39;])<br>def handle_get_all():<br>    return get_pickup_lines()<br><br><br>@app.route(&quot;/getPickupLine&quot;, methods=[&#39;GET&#39;])<br>def handle_get_one():<br>    return get_pickup_line()<br><br><br>@app.route(&quot;/addPickupLine&quot;, methods=[&#39;POST&#39;])<br>def handle_add_pickup_lines():<br>    request_data = request.json<br>    line = request_data[&#39;addPickupLine&#39;]<br>    return add_PickupLines(line)<br><br><br>@app.route(&quot;/updatePickupLines&quot;, methods=[&#39;PUT&#39;])<br>def handle_update_line():<br>    request_data = request.json<br>    return update_PickupLine(request_data[&#39;updatePickupLine&#39;], request_data[&#39;updatePickupLinesWith&#39;])<br><br><br>@app.route(&quot;/deletePickupLines&quot;, methods=[&#39;DELETE&#39;])<br>def handle_delete_line():<br>    request_data = request.json<br>    return delete_PickupLine(request_data[&quot;deletePickupLine&quot;])</pre><p>4. App : —</p><pre>&quot;&quot;&quot; <br>This is responsible for running the Flask Application<br>&quot;&quot;&quot;<br><br>from PickupLineApp.Handler.appHandler import app<br><br>if __name__ == &quot;__main__&quot;:<br>    app.run()</pre><h3>Testing</h3><p>Find the curl commands to try the same below:</p><pre><br># get All <br><br>curl --location &#39;http://127.0.0.1:5000/getPickupLines&#39;<br><br># get One <br><br>curl --location &#39;http://127.0.0.1:5000/getPickupLine&#39;<br><br># add line<br><br>curl --location &#39;http://127.0.0.1:5000/addPickupLine&#39; \<br>--header &#39;Content-Type: application/json&#39; \<br>--data &#39;{<br>&quot;addPickupLine&quot; : &quot;Did the sun come out, or did you just smile at me?&quot;,<br>&quot;updatePickupLine&quot; : &quot;&quot;,<br>&quot;updatePickupLinesWith&quot; : &quot;&quot;,<br>&quot;deletePickupLine&quot; : &quot;&quot;<br>}&#39;<br><br># update line <br><br>curl --location --request PUT &#39;http://127.0.0.1:5000/updatePickupLines&#39; \<br>--header &#39;Content-Type: application/json&#39; \<br>--data &#39;{<br>&quot;addPickupLine&quot; : &quot;&quot;,<br>&quot;updatePickupLine&quot; : &quot;Did the sun come out, or did you just smile at me?&quot;,<br>&quot;updatePickupLinesWith&quot; : &quot;I am new in town. Can you give me directions to where our date is tonight?&quot;,<br>&quot;deletePickupLine&quot; : &quot;&quot;<br>}&#39;<br><br># delete line <br><br>curl --location --request DELETE &#39;http://127.0.0.1:5000/deletePickupLines&#39; \<br>--header &#39;Content-Type: application/json&#39; \<br>--data &#39;{<br>&quot;addPickupLine&quot; : &quot;&quot;,<br>&quot;updatePickupLine&quot; : &quot;&quot;,<br>&quot;updatePickupLinesWith&quot; : &quot;&quot;,<br>&quot;deletePickupLine&quot; : &quot;I am new in town. Can you give me directions to where our date is tonight?&quot;<br>}&#39;<br></pre><p>thanks for giving it a read i hope you had a fun , following the tutorial</p><p>Find the GitHub Link for the same below :</p><p>GitHub Link :</p><p><a href="https://github.com/shantamsultania/PickupLineApp">shantamsultania/PickupLineApp: this is a Basic App build over flask-python to return some common pickup lines (github.com)</a></p><p>Follow me on linkedIn:</p><p><a href="https://www.linkedin.com/in/shantam-sultania-737084175/">Shantam Sultania | LinkedIn</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1130d1bd227a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Setup Java — Spring boot using Gradle in Intellij community edition]]></title>
            <link>https://techwithshantam.medium.com/how-to-setup-java-spring-boot-using-gradle-in-intellij-community-edition-39aad7edb1ad?source=rss-1437399c0d73------2</link>
            <guid isPermaLink="false">https://medium.com/p/39aad7edb1ad</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[gradle]]></category>
            <category><![CDATA[intellij]]></category>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[setup-guide]]></category>
            <dc:creator><![CDATA[Shantam Sultania]]></dc:creator>
            <pubDate>Tue, 17 Aug 2021 10:45:58 GMT</pubDate>
            <atom:updated>2021-08-17T10:46:42.411Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to Setup Java — Spring boot using Gradle in Intellij community edition</h3><p>This article is a quick tutorial For how to setup Java — Spring boot in Intellij community edition using Gradle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*TRAPLj8PghDqO2DlxjwYYQ.jpeg" /></figure><p><strong>What is Spring Boot ?</strong></p><p>Spring Boot is an open source Java-based framework used to create a micro Service. This is basically a Tool that makes developing web application and microservices with Spring Framework faster and easier through three core capabilities:</p><ol><li>Autoconfiguration</li><li>An opinionated approach to configuration</li><li>The ability to create standalone applications</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/440/1*vbT99cEJhSgqNJsvd1FKuw.jpeg" /></figure><p><strong>What is Intellij ?</strong></p><p>IntelliJ is one of the most powerful and popular Integrated Development Environments (IDE) for Java.</p><p>It is developed and maintained by <strong>JetBrains</strong> and available as community and ultimate edition.</p><p>What is Intellij Community Edition ?</p><p>Intellij Community Edition is an edition provided by Intellij for free and its basically has all the features required for day to day developer life. the main Difference between The Ultimate Edition is designed to assist in web and enterprise development, whereas the Community Edition is designed for JVM and Android Development.</p><p>In Ultimate Edition the Spring boot frame can be found easily but for community edition you need to make use of Gradle/ Maven Directly or You can use <a href="https://start.spring.io/">https://start.spring.io/</a> and download a gradle/maven project.</p><p>for this Tutorial i would be focusing on Gradle.</p><p>So <strong>Without wasting your time Lets start:-</strong></p><p>Step 1 :</p><p>Download and Install Intellij Community edition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yklC5cW7KnulBLI0QM-paw.png" /></figure><p>for this use can use this link below:</p><p><a href="https://www.jetbrains.com/idea/download/#section=windows">Download IntelliJ IDEA: The Capable &amp; Ergonomic Java IDE by JetBrains</a> .</p><p>Step 2 :</p><p>Open The IntelliJ IDEA</p><p>It Looks Like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/1*KchFQNzIUW2AgJ09gQou2w.png" /></figure><p>Steps 3 :</p><p>Click on Create a new Project</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/717/1*y6SLvtd_Ub_ln-9ScTHIpA.png" /></figure><p>Step 4 :</p><p>in this window Click on Gradle and Select Java Version that Suits you</p><p>If you don’t have any Java Version Installed you can just select download option and it will download and install the JVM version of your choice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*Q75MSq50xLrPNQWkdXOouA.png" /></figure><p>Step 5 :</p><p>Give your project a name and Location of your choice .</p><p>for this demo i am mentioning the name as “ TestSpringboot”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*HDOg1QMs2zLSG4br-ObMww.png" /></figure><p>Step 6:</p><p>Click on Finish</p><p>This will create a project and install / Download all the required dependencies for Gradle Build this will usually takes around 2- 5 mins but depending upon your System it can take some more time also.</p><p>Step 7:</p><p>Go to this file located here File name : Build.gradle</p><p>It will look Like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hk8tyuaCMyzuVBMq2sxUtA.png" /></figure><p>Step 8 :</p><p>In Build.gradle Do the Following</p><ol><li>Add these Pulgins</li></ol><pre>plugins <strong>{<br>    </strong>id &#39;org.springframework.boot&#39; version &#39;2.4.5&#39;<br>    id &#39;io.spring.dependency-management&#39; version &#39;1.0.11.RELEASE&#39;<br>    id &#39;java&#39;<br><strong>}</strong></pre><p>2. Add Configurations</p><pre>configurations <strong>{<br>    </strong>compileOnly <strong>{<br>        </strong>extendsFrom annotationProcessor<br>    <strong>}<br>}</strong></pre><p>3. Add these Dependencies</p><pre>dependencies <strong>{<br>    </strong>implementation &#39;org.springframework.boot:spring-boot-starter-data-jpa&#39;<br>    implementation &#39;org.springframework.boot:spring-boot-starter-web&#39;<br>    testImplementation &#39;org.springframework.boot:spring-boot-starter-test&#39;<br><br>    testImplementation &#39;org.junit.jupiter:junit-jupiter-api:5.7.0&#39;<br>    testRuntimeOnly &#39;org.junit.jupiter:junit-jupiter-engine:5.7.0&#39;<br><strong>}</strong></pre><p>Note : Please double check the Dependency Version number as per your comfort as the time this article is been written these are the latest dependencies.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D4Lcy2Po9rzSIWA6Leyx3w.png" /><figcaption>It will look like this</figcaption></figure><p>After this Click on Build Icon</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GL1COsdXJWXN9jQbQwABeg.png" /></figure><p>Step 9 :</p><p>Now go to Src/main/java folder and Right Click and Create a new Package.</p><p>Give your package any name you want for demo i am naming it “new.package”</p><p>after that again right click and create a new Java Class Example (Main.java).</p><p>this will be your main class to run Spring boot Application</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/346/1*psJDlZK3W8mYRF8toMczuA.png" /></figure><p>now we will import the Spring boot Application with the help of Annotation as show below</p><pre>import org.springframework.boot.SpringApplication;<br>import org.springframework.boot.autoconfigure.SpringBootApplication;<br><br>@SpringBootApplication<br>public class Main {<br><br>    public static void main(String[] args) {<br>        SpringApplication.run(Main.class,args);<br>    }<br><br>}</pre><p>After All this it will look like this</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JctQKJKGiJKMDCbAybnUcw.png" /></figure><p>Now Go Back to Src/main/java/newPackage and create another Class this will be your Rest Controller Class.</p><p>For Demo i am naming it SpringRestController.java</p><p>and Copy and Paste this code in that class</p><pre>import org.springframework.boot.autoconfigure.EnableAutoConfiguration;<br>import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;<br>import org.springframework.web.bind.annotation.GetMapping;<br>import org.springframework.web.bind.annotation.RestController;<br><br>@EnableAutoConfiguration(exclude={DataSourceAutoConfiguration.class})<br><br>@RestController<br>public class SpringRestController {<br><br>    @GetMapping(&quot;/connect&quot;)<br>    public void connect(){<br>        System.<em>out</em>.println(&quot;Spring Boot Application Connected.&quot;);<br>    }<br><br>}</pre><p>After this it will look like this :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CUiDrr3eGpbfW8ikCXeGPA.png" /></figure><p>And Eureka you are done you will see something like this.</p><blockquote><strong><em>End Results</em></strong></blockquote><p>To run just Go and Run the main Method in Main.java class</p><p>and after the class has run it will look like this.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m1_oWtfzjL-RC6CrQ1m9IA.png" /></figure><p>after that just write the following in any web browser or API testing tool and you will get the desired result as followed <a href="http://localhost:8080/connect">localhost:8080/connect</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J9pKaDMApkxnyWpbLUOj9Q.png" /><figcaption>As you can see it performed as required</figcaption></figure><p>Code and other resources of the file can be found at</p><p>Github Link :</p><p><a href="https://github.com/shantamsultania/Medium-SpringBoot-Repo">shantamsultania/Medium-SpringBoot-Repo</a>/</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=39aad7edb1ad" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>