<?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 Deepak Cardoza on Medium]]></title>
        <description><![CDATA[Stories by Deepak Cardoza on Medium]]></description>
        <link>https://medium.com/@deepakcardoza?source=rss-cbfe363f8f26------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*n3JD5UB85YlpNn7dn8Tv6g.jpeg</url>
            <title>Stories by Deepak Cardoza on Medium</title>
            <link>https://medium.com/@deepakcardoza?source=rss-cbfe363f8f26------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 10:41:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@deepakcardoza/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[Your Website Is Being Read
by AI, Not Humans — Here’s How to Optimize for Both]]></title>
            <link>https://medium.com/@deepakcardoza/your-website-is-being-read-by-ai-not-humans-heres-how-to-optimize-for-both-bfed821f6d81?source=rss-cbfe363f8f26------2</link>
            <guid isPermaLink="false">https://medium.com/p/bfed821f6d81</guid>
            <category><![CDATA[seo]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <dc:creator><![CDATA[Deepak Cardoza]]></dc:creator>
            <pubDate>Sun, 13 Sep 2026 14:15:34 GMT</pubDate>
            <atom:updated>2026-09-13T14:15:34.199Z</atom:updated>
            <content:encoded><![CDATA[<p>From meta tags and robots.txt to JSON-LD structured data, Bing Webmaster Tools, GEO, AEO, and AI crawler optimization — a complete developer’s guide to being found by both search engines and generative AI in 2026.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IX59eG_4-ZwNIslfQikfcg.png" /></figure><h3>Table of Contents</h3><p>· <a href="#8327">The Internet Has Changed — And Most Developers Haven’t Noticed</a><br>· <a href="#08a6">SEO vs GEO vs AEO — What’s the Difference?</a><br> ∘ <a href="#b306">SEO — Search Engine Optimization</a><br> ∘ <a href="#ffb8">GEO — Generative Engine Optimization</a><br> ∘ <a href="#44e6">AEO — Answer Engine Optimization</a><br>· <a href="#db49">SEO Is Still the Foundation — The Gaps Most Developers Miss</a><br> ∘ <a href="#976a">Canonical Tags — Preventing Duplicate Content</a><br> ∘ <a href="#0bc2">Heading Hierarchy — Structure That AI Reads First</a><br> ∘ <a href="#4355">Image Alt Text — AI Reads This Too</a><br> ∘ <a href="#527e">Internal Linking — Help Crawlers Navigate</a><br>· <a href="#f851">robots.txt — Tell Crawlers What to Touch</a><br> ∘ <a href="#a89d">Basic Structure</a><br> ∘ <a href="#e55c">Controlling Specific AI Crawlers</a><br>· <a href="#2d6c">JSON-LD Structured Data — The Biggest Gap Most Developers Miss</a><br> ∘ <a href="#308f">Where to Place JSON-LD</a><br>· <a href="#f8a4">Submitting to AI Search Engines — Beyond Google</a><br> ∘ <a href="#8b4d">Bing Webmaster Tools</a><br> ∘ <a href="#c172">IndexNow — Push Changes Instantly</a><br>· <a href="#1923">GEO — Optimizing for Generative AI</a><br> ∘ <a href="#045c">Write in a Clear Q&amp;A or Definition Style</a><br> ∘ <a href="#8c63">Use Specific Factual Statements</a><br> ∘ <a href="#9a31">Be Cited on Authoritative Sources</a><br> ∘ <a href="#cc5f">Submit to Perplexity Publisher Program</a><br>· <a href="#409a">AI Crawler Optimization — robots.txt for the AI Age</a><br> ∘ <a href="#56c4">The Strategic Question: Allow or Block?</a><br>· <a href="#3f01">llms.txt — The New robots.txt for LLMs</a><br> ∘ <a href="#b225">Where to Place It</a><br> ∘ <a href="#da6e">What to Include</a><br>· <a href="#7007">Implementation Guide — HTML, React &amp; Next.js</a><br> ∘ <a href="#2c71">Plain HTML Sites</a><br> ∘ <a href="#bfbe">React (Create React App / Vite)</a><br> ∘ <a href="#3c92">Next.js — App Router (Recommended)</a><br>· <a href="#ebeb">The Complete Developer Checklist</a><br>· <a href="#f1ac">Wrapping Up</a><br>· <a href="#e262">Bonus Resources</a></p><h3>The Internet Has Changed — And Most Developers Haven’t Noticed</h3><p>Recently, <strong>Cloudflare </strong>reported a milestone that quietly changed how we should think about web traffic. According to Cloudflare’s latest data, <strong>roughly 57% of web requests are now generated by non-human traffic</strong> — including bots, crawlers, and automated systems rather than human-driven browsing. More than half of every request hitting your web server is a machine reading your content, extracting what it needs, and moving on. It doesn’t scroll. It doesn’t click your CTA. It doesn’t see your beautiful hero section. It definitely doesn’t click your ads.</p><p>Think about the hours you’ve spent writing blog posts, optimizing your portfolio, crafting the perfect About page. Now ask yourself: who’s actually reading it? The answer, increasingly, is an AI model that’s indexing your content to answer someone else’s question — in its own interface, without ever sending that person to your website.</p><p>This is not doom and gloom — it’s an opportunity. While most developers still optimize for human visitors and traditional search, those who also optimize for AI can get cited in ChatGPT, appear in Perplexity, and be recommended by Gemini. This guide covers exactly that — building on the SEO fundamentals you already know and exploring the next layer of optimization: <strong>GEO, AEO, JSON-LD, llms.txt, and AI crawler strategy.</strong></p><blockquote><strong>Already Know Basic SEO? </strong>If you’ve already set up meta tags, a sitemap, and submitted to Google Search Console, you have the foundation. This blog builds on top of that. If you haven’t done those basics yet, read the <a href="https://medium.com/@deepakcardoza/does-your-website-have-seo-heres-how-to-get-it-right-your-step-by-step-seo-guide-128b11e98cd2">beginner SEO guide first</a>, then come back here.</blockquote><p><a href="https://medium.com/@deepakcardoza/does-your-website-have-seo-heres-how-to-get-it-right-your-step-by-step-seo-guide-128b11e98cd2">Does Your Website Have SEO? Here’s How to Get It Right: Your Step-by-Step SEO Guide</a></p><h3>SEO vs GEO vs AEO — What’s the Difference?</h3><h4>SEO — Search Engine Optimization</h4><p>Optimizing your website to rank higher in traditional search engine results pages (SERPs) on Google, Bing, and DuckDuckGo. Someone searches → your page appears → they click. Traffic comes directly to your site.</p><h4>GEO — Generative Engine Optimization</h4><p>Optimizing your content so that generative AI systems — ChatGPT, Gemini, Claude, Perplexity — accurately represent your content, cite your site, and recommend you when users ask relevant questions.</p><h4>AEO — Answer Engine Optimization</h4><p>Optimizing your content to become the direct answer that appears in AI-powered answer boxes, voice assistants, and featured snippets. The goal is to be the source the AI quotes directly when it gives an answer.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1021/1*hpYUVIzjl_6TY8n7f1Pqgg.png" /><figcaption>Difference between SEO, GEO &amp; AEO</figcaption></figure><blockquote>💡<strong>SEO is the foundation for all three — </strong>You cannot do effective GEO or AEO without solid SEO in place. A well-structured, fast, crawlable website with good meta tags and structured data is the starting point. Think of SEO as the infrastructure — GEO and AEO are the advanced features you build on top.</blockquote><h3>SEO Is Still the Foundation — The Gaps Most Developers Miss</h3><p>The <a href="https://medium.com/@deepakcardoza/does-your-website-have-seo-heres-how-to-get-it-right-your-step-by-step-seo-guide-128b11e98cd2">earlier SEO guide</a> covered meta tags, Google Search Console, sitemaps, and page speed. All essential. But there are several foundational SEO elements that most developers skip — and that AI systems specifically depend on to understand your content.</p><h4>Canonical Tags — Preventing Duplicate Content</h4><p>If the same content is accessible at multiple URLs — https://yoursite.com/blog and https://yoursite.com/blog?ref=twitter — search engines see duplicate pages and split your ranking power. A canonical tag tells them which version is the &quot;real&quot; one.</p><pre>&lt;!-- Tell search engines this is the authoritative URL --&gt;<br>&lt;link rel=&quot;canonical&quot; href=&quot;https://yoursite.com/blog/your-post-title&quot; /&gt;</pre><h4>Heading Hierarchy — Structure That AI Reads First</h4><p>AI models parse your page top-to-bottom, using heading tags to understand your content’s structure. One &lt;h1&gt; per page, followed by logical &lt;h2&gt; sections and &lt;h3&gt; subsections. Never skip levels. Never use headings just to make text bigger — use them to organize meaning.</p><blockquote>⚠️ <strong>Common Mistake Developers Make — </strong>Using &lt;h1&gt; twice on a page, or jumping from &lt;h1&gt; directly to &lt;h4&gt;. This confuses both search engines and AI parsers. Your heading structure should read like a clean outline of your page.</blockquote><h4>Image Alt Text — AI Reads This Too</h4><p>Alt text isn’t just for accessibility (though that matters hugely). Google’s image search, Google Lens, and AI systems that process your page all read alt text to understand what an image represents. Descriptive alt text adds semantic context to your page.</p><pre>&lt;!-- ❌ Bad: empty or generic --&gt;<br>&lt;img src=&quot;chart.png&quot; alt=&quot;image&quot; /&gt;<br><br>&lt;!-- ✅ Good: descriptive, specific --&gt;<br>&lt;img<br>  src=&quot;aws-knowledge-chart.png&quot;<br>  alt=&quot;Bar chart showing AWS knowledge improvement from 36% to 75% after workshop&quot;<br>/&gt;</pre><h4>Internal Linking — Help Crawlers Navigate</h4><p>Every page on your site should be reachable via links from other pages — not buried, not orphaned. Internal links help both Google’s crawlers and AI systems discover all your content and understand which pages are most important (pages with more internal links pointing to them signal higher importance).</p><h3>robots.txt — Tell Crawlers What to Touch</h3><p>robots.txt is a plain text file at the root of your domain (https://yoursite.com/robots.txt) that tells web crawlers — search engines and AI bots alike — which pages or directories they are allowed to access and which they should ignore.</p><blockquote>💡 Real-World Analogy</blockquote><blockquote>Think of robots.txt as a sign at the entrance of your building. It says &quot;Visitors welcome in the lobby and meeting rooms. Staff-only areas are off-limits.&quot; Legitimate crawlers — Google, Bing, responsible AI bots — read and respect this sign. Bad actors don&#39;t, which is why robots.txt is access control, not security.</blockquote><h4>Basic Structure</h4><pre># Allow all crawlers to access everything<br>User-agent: *<br>Allow: /<br><br># Block all crawlers from admin and private areas<br>User-agent: *<br>Disallow: /admin/<br>Disallow: /private/<br>Disallow: /api/<br><br># Point to your sitemap<br>Sitemap: https://yoursite.com/sitemap.xml</pre><h4>Controlling Specific AI Crawlers</h4><p>Each AI company’s crawler has its own User-agent name. You can allow or block them individually. This is new territory that didn&#39;t exist in traditional SEO — and we&#39;ll cover the full list of AI crawlers in Section 8.</p><pre># Allow Google and Bing normally<br>User-agent: Googlebot<br>Allow: /<br><br>User-agent: Bingbot<br>Allow: /<br><br># Allow OpenAI&#39;s crawler (means ChatGPT can cite your content)<br>User-agent: GPTBot<br>Allow: /<br><br># Allow Anthropic&#39;s crawler<br>User-agent: ClaudeBot<br>Allow: /<br><br># Block Google from using your content to train Gemini<br>User-agent: Google-Extended<br>Disallow: /<br><br># Always include your sitemap<br>Sitemap: https://yoursite.com/sitemap.xml</pre><blockquote>⚠️<strong>robots.txt is not a security barrier — </strong>Legitimate crawlers respect it. Malicious bots ignore it. Never put sensitive data behind robots.txt disallows and assume it’s protected — use proper authentication instead. robots.txt controls <em>access</em>, not <em>security</em>.</blockquote><h3>JSON-LD Structured Data — The Biggest Gap Most Developers Miss</h3><p>This is the single most impactful thing you can add to your site that most developers have never done. <strong>JSON-LD (JavaScript Object Notation for Linked Data)</strong> is a way to embed structured, machine-readable data directly in your HTML — data that tells Google, Bing, and AI systems not just <em>what your page says</em>, but <em>what it means</em>.</p><p>Without JSON-LD, a search engine or AI reads your page like raw text and has to guess your name, your job title, what kind of content this is, whether this is an article or a product. With JSON-LD, you tell it directly — in a language machines understand perfectly.</p><blockquote><strong>💡Why This Matters for GEO and AEO Specifically — </strong>When ChatGPT, Gemini, or Perplexity answers a question and says “According to Deepak Cardoza, software engineer at…” — that attribution comes from structured data. Without it, AI systems might get your details wrong, attribute your content to someone else, or not cite you at all.</blockquote><h4>Where to Place JSON-LD</h4><p>Always inside a <strong>script tag with the type set to application/ld+json</strong> in your head section. Never in the body. One script block per schema type, or multiple types combined in an array.</p><p><strong>Schema 1 — Person (For Portfolio &amp; Personal Sites)</strong></p><p>The most important schema for a personal portfolio. Tells AI systems exactly who you are, what you do, and where to find you. This is what gets you accurately described when someone asks an AI about you.</p><pre>// Add in inside the head section of your code with<br>// script type=application/ld+json<br>{<br>  &quot;@context&quot;: &quot;https://schema.org&quot;,<br>  &quot;@type&quot;: &quot;Person&quot;,<br>  &quot;name&quot;: &quot;Deepak Cardoza&quot;,<br>  &quot;jobTitle&quot;: &quot;Full Stack Engineer&quot;,<br>  &quot;worksFor&quot;: {<br>    &quot;@type&quot;: &quot;Organization&quot;,<br>    &quot;name&quot;: &quot;Idyaite Technology Solutions&quot;<br>  },<br>  &quot;url&quot;: &quot;https://deepakcardoza.com&quot;,<br>  &quot;sameAs&quot;: [<br>    &quot;https://linkedin.com/in/deepak-cardoza-b544961aa&quot;,<br>    &quot;https://github.com/deepak-cardoza&quot;,<br>    &quot;https://medium.com/@deepakcardoza&quot;<br>  ],<br>  &quot;address&quot;: {<br>    &quot;@type&quot;: &quot;PostalAddress&quot;,<br>    &quot;addressLocality&quot;: &quot;Mangaluru&quot;,<br>    &quot;addressRegion&quot;: &quot;Karnataka&quot;,<br>    &quot;addressCountry&quot;: &quot;IN&quot;<br>  },<br>  &quot;knowsAbout&quot;: [<br>    &quot;AWS&quot;,<br>    &quot;Serverless Architecture&quot;,<br>    &quot;Node.js&quot;,<br>    &quot;TypeScript&quot;,<br>    &quot;Cloud Computing&quot;<br>  ]<br>}</pre><p><strong>Schema 2 — WebSite (Enables Sitelinks Search Box)</strong></p><p>Tells Google the name of your website and enables a search box directly in Google results for your site. Also helps AI systems identify your domain as an authoritative entity.</p><pre>// Add in inside the head section of your code with<br>// script type=application/ld+json<br>{<br>  &quot;@context&quot;: &quot;https://schema.org&quot;,<br>  &quot;@type&quot;: &quot;WebSite&quot;,<br>  &quot;name&quot;: &quot;Deepak Cardoza&quot;,<br>  &quot;url&quot;: &quot;https://deepakcardoza.com&quot;,<br>  &quot;description&quot;: &quot;Portfolio and blog of Deepak Cardoza — AWS Certified Full Stack Engineer based in Mangaluru, India&quot;,<br>  &quot;potentialAction&quot;: {<br>    &quot;@type&quot;: &quot;SearchAction&quot;,<br>    &quot;target&quot;: &quot;https://deepakcardoza.com/search?q={search_term_string}&quot;,<br>    &quot;query-input&quot;: &quot;required name=search_term_string&quot;<br>  }<br>}</pre><p><strong>Schema 3 — Article / BlogPosting (For Every Blog Post)</strong></p><p>Add this to every blog post page. It tells AI systems the article’s title, author, publish date, and topic — which is exactly how ChatGPT and Perplexity attribute quotes and information to the right source.</p><pre>// Add in inside the head section of your code with<br>// script type=application/ld+json<br>{<br>  &quot;@context&quot;: &quot;https://schema.org&quot;,<br>  &quot;@type&quot;: &quot;BlogPosting&quot;,<br>  &quot;headline&quot;: &quot;Your Website Is Being Read by AI, Not Humans&quot;,<br>  &quot;description&quot;: &quot;A complete developer guide to SEO, GEO, AEO and AI crawler optimization in 2026&quot;,<br>  &quot;author&quot;: {<br>    &quot;@type&quot;: &quot;Person&quot;,<br>    &quot;name&quot;: &quot;Deepak Cardoza&quot;,<br>    &quot;url&quot;: &quot;https://deepakcardoza.com&quot;<br>  },<br>  &quot;publisher&quot;: {<br>    &quot;@type&quot;: &quot;Person&quot;,<br>    &quot;name&quot;: &quot;Deepak Cardoza&quot;<br>  },<br>  &quot;datePublished&quot;: &quot;2026-06-01&quot;,<br>  &quot;dateModified&quot;:  &quot;2026-06-01&quot;,<br>  &quot;url&quot;: &quot;https://deepakcardoza.com/blog/seo-geo-aeo-guide&quot;,<br>  &quot;image&quot;: &quot;https://deepakcardoza.com/images/seo-geo-thumbnail.png&quot;,<br>  &quot;keywords&quot;: [&quot;SEO&quot;, &quot;GEO&quot;, &quot;AEO&quot;, &quot;AI optimization&quot;, &quot;JSON-LD&quot;]<br>}</pre><p><strong>Schema 4 — FAQPage (The Most Powerful for AEO)</strong></p><p>While FAQPage structured data can still help machines understand Q&amp;A content, Google no longer generally displays FAQ rich results for most websites, so its value today is primarily semantic and contextual rather than a guaranteed search-result enhancement. AI systems use it to extract clean, authoritative answers to common questions — and cite your page as the source.</p><p>The key is to write real questions your audience actually asks, with clear, direct answers. Not marketing fluff — concise, factual statements.</p><pre>// Add in inside the head section of your code with<br>// script type=application/ld+json<br>{<br>  &quot;@context&quot;: &quot;https://schema.org&quot;,<br>  &quot;@type&quot;: &quot;FAQPage&quot;,<br>  &quot;mainEntity&quot;: [<br>    {<br>      &quot;@type&quot;: &quot;Question&quot;,<br>      &quot;name&quot;: &quot;What is GEO in SEO?&quot;,<br>      &quot;acceptedAnswer&quot;: {<br>        &quot;@type&quot;: &quot;Answer&quot;,<br>        &quot;text&quot;: &quot;GEO (Generative Engine Optimization) is the practice of optimizing web content so that generative AI systems like ChatGPT, Gemini, and Perplexity accurately represent, cite, and recommend your content when users ask relevant questions.&quot;<br>      }<br>    },<br>    {<br>      &quot;@type&quot;: &quot;Question&quot;,<br>      &quot;name&quot;: &quot;What is the difference between SEO and AEO?&quot;,<br>      &quot;acceptedAnswer&quot;: {<br>        &quot;@type&quot;: &quot;Answer&quot;,<br>        &quot;text&quot;: &quot;SEO (Search Engine Optimization) focuses on ranking in traditional search results so users click through to your site. AEO (Answer Engine Optimization) focuses on becoming the direct answer that AI systems and voice assistants provide, often without the user needing to visit your site at all.&quot;<br>      }<br>    },<br>    {<br>      &quot;@type&quot;: &quot;Question&quot;,<br>      &quot;name&quot;: &quot;What is JSON-LD and why does it matter for SEO?&quot;,<br>      &quot;acceptedAnswer&quot;: {<br>        &quot;@type&quot;: &quot;Answer&quot;,<br>        &quot;text&quot;: &quot;JSON-LD is a structured data format embedded in HTML that tells search engines and AI systems what your content means, not just what it says. It enables rich search results, correct AI attribution, and better content understanding — making it one of the most impactful SEO improvements a developer can make.&quot;<br>      }<br>    }<br>  ]<br>}</pre><p>💡<strong>Test Your JSON-LD Before Publishing — </strong>Use Google’s <a href="https://search.google.com/test/rich-results">Rich Results Test</a> to validate your structured data and preview how it’ll appear in search results. Also use the <a href="http://schema.org/">schema.org</a> validator to catch any errors in your markup.</p><h3>Submitting to AI Search Engines — Beyond Google</h3><p>Most developers submit to Google Search Console and stop there. But here’s the thing: <strong>ChatGPT uses Bing’s index for its web search feature.</strong> If your site isn’t in Bing’s index, you’re invisible to ChatGPT’s browsing. Let’s fix that.</p><h4>Bing Webmaster Tools</h4><ol><li>Create an Account</li></ol><p>Go to <a href="https://www.bing.com/webmasters">bing.com/webmasters</a> and sign in with a Microsoft account. If you already have Google Search Console set up, you can import your sites directly from GSC with one click — a massive time saver.</p><p>2. Add Your Site</p><p>Click <strong>Add a Site</strong> → enter your domain URL → choose a verification method. The easiest: download an XML file and upload it to your root directory, or add a meta tag to your homepage &lt;head&gt;.</p><p><strong>3. </strong>Submit Your Sitemap</p><p>In the left sidebar → <strong>Sitemaps</strong> → paste your sitemap URL (https://yoursite.com/sitemap.xml) → Submit. Bing will begin crawling your site and indexing your pages.</p><p>✅ Once indexed by Bing, your content becomes discoverable by ChatGPT’s web search, DuckDuckGo, and other Bing-powered search tools.</p><h4>IndexNow — Push Changes Instantly</h4><p>Traditional crawling is passive — you wait for Bing or Google to come back to your site and notice your new content. <strong>IndexNow</strong> is a protocol that lets you <em>push</em> URL changes to search engines the moment you publish — no waiting. Bing, Yandex, and DuckDuckGo all support it.</p><pre># 1. Generate a random API key (any UUID works)<br>YOUR_KEY=&quot;a1b2c3d4-e5f6-7890-abcd-ef1234567890&quot;<br><br># 2. Create a text file at: yoursite.com/a1b2c3d4-e5f6-7890-abcd-ef1234567890.txt<br>#    Contents of the file: just your key<br><br># 3. Submit a URL to IndexNow (Bing endpoint)<br>curl &quot;https://www.bing.com/indexnow&quot; \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{<br>    &quot;host&quot;: &quot;yoursite.com&quot;,<br>    &quot;key&quot;: &quot;a1b2c3d4-e5f6-7890-abcd-ef1234567890&quot;,<br>    &quot;keyLocation&quot;: &quot;https://yoursite.com/a1b2c3d4.txt&quot;,<br>    &quot;urlList&quot;: [<br>      &quot;https://yoursite.com/blog/new-post&quot;<br>    ]<br>  }&#39;</pre><blockquote>ℹ️ <strong>IndexNow for Next.js — </strong>The next-sitemap package supports automatic IndexNow submission on build. Set generateIndexSitemap: true in your config and add your API key as INDEXNOW_KEY in your environment variables. It submits all new/changed URLs automatically on every deploy.</blockquote><h3>GEO — Optimizing for Generative AI</h3><p>GEO is the newest and least-understood discipline in this list. The rules are still emerging, but researchers and practitioners have identified consistent patterns in what makes content get cited by AI systems versus ignored.</p><h4>Write in a Clear Q&amp;A or Definition Style</h4><p>AI systems are built to extract answers to questions. If your content is structured around clear questions followed by direct answers, it’s far easier for an AI to extract and cite it. Notice how this guide asks questions in its headings and answers them directly in the first paragraph — that’s intentional GEO structure.</p><p>Compare these two approaches:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kp1v9OcEELGXQgY6ksmJww.png" /><figcaption>Writing Styles</figcaption></figure><h4>Use Specific Factual Statements</h4><p>AI models are trained to prefer content with verifiable, specific claims over vague generalities. Replace “many users” with actual percentages. Replace “fast loading” with “loads in under 2 seconds.” Replace “popular framework” with “used by 70% of React developers.” Specificity signals authority.</p><h4>Be Cited on Authoritative Sources</h4><p>AI training data heavily weights content from trusted platforms — GitHub, Stack Overflow, Wikipedia, established tech blogs, academic papers. Having your content shared or referenced on these platforms significantly increases the chance that AI systems have “seen” your work and will cite it.</p><ul><li><strong>Publish on Multiple Platforms</strong><br>Cross-post on Medium, Dev.to, and Hashnode. More indexed versions of your content across trusted domains means more chances of AI systems encountering it.</li><li><strong>GitHub README Quality</strong><br>Your GitHub repos are indexed and read by AI. A well-written README with clear descriptions, use cases, and examples is GEO-friendly content.</li><li><strong>Answer on Stack Overflow</strong><br>Detailed, accurate answers on Stack Overflow are heavily weighted in AI training data. A well-crafted answer can get you cited in AI responses for years.</li><li><strong>LinkedIn Articles</strong><br>LinkedIn’s domain authority is very high. Long-form articles there often get picked up by AI training pipelines, building your personal brand’s AI footprint.</li></ul><h4>Submit to Perplexity Publisher Program</h4><p>Perplexity has a publisher program that allows you to submit your site for prioritized indexing in their AI search results. Visit <a href="https://www.perplexity.ai/publishers">perplexity.ai/publishers</a> and register your domain. This is one of the few direct ways to influence your visibility in an AI search engine as a content creator.</p><h3>AI Crawler Optimization — robots.txt for the AI Age</h3><p>Every major AI company has its own crawler that visits websites to gather training data, build search indexes, or fetch content for real-time answers. Each has a specific User-agent name you can reference in your robots.txt.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZL0MQBXUOpudVnLGacYolA.png" /><figcaption>Company and their Crawler names with purpose</figcaption></figure><h4>The Strategic Question: Allow or Block?</h4><p>This is a genuinely nuanced decision. Here’s how to think about it:</p><ul><li><strong>Allow AI Crawlers</strong><br>Your content gets into AI training data and search indexes. You get cited in AI responses. Your brand appears when people ask AI systems about your topic area. <strong>Best for:</strong> developers, bloggers, anyone building personal authority.</li><li><strong>Block AI Crawlers</strong><br>Your content isn’t scraped for training. You maintain control of your writing. But you’re invisible to AI-powered search. <strong>Best for:</strong> businesses with proprietary content, paywalled sites, or legal concerns about training data usage.</li></ul><blockquote>💡<strong>For Most Developers and Bloggers — </strong>Allow GPTBot, ClaudeBot, PerplexityBot, and Bingbot. These are the crawlers that directly contribute to AI-powered search results. Block or allow Google-Extended based on your comfort with Google using your content for Gemini training — it doesn’t affect your Google Search ranking either way (that’s Googlebot, not Google-Extended).</blockquote><h3>llms.txt — The New robots.txt for LLMs</h3><p>llms.txt is an emerging standard — proposed in 2024 and gaining adoption — that provides AI language models with a structured, human-readable summary of your website specifically designed for LLM consumption. Think of it as a robots.txt for AI, but instead of access control, it&#39;s a <em>curated briefing</em> that tells AI models exactly what your site is about, who you are, and which content is most important.</p><blockquote><strong>💡 Real-World Analogy</strong></blockquote><blockquote>Imagine you’re a journalist researching a company. Instead of reading thousands of pages on their website, someone hands you a two-page executive summary: who they are, what they do, key facts, and where to find the important stuff. That’s llms.txt — a briefing document written specifically for AI systems.</blockquote><h4>Where to Place It</h4><p>At the root of your domain: https://yoursite.com/llms.txt It&#39;s a plain Markdown file — simple to create and maintain.</p><h4>What to Include</h4><pre># Deepak Cardoza — deepakcardoza.com<br><br>## About<br>Deepak Cardoza is a Full Stack Engineer and AWS Certified Developer Associate<br>based in Mangaluru, Karnataka, India. He works at Idyaite Technology Solutions<br>and is the CEO and founder of Ezra Techland. He specializes in AWS serverless<br>architecture, Node.js, TypeScript, and cloud-native backend development.<br><br>## Blog<br>Deepak writes technical blogs on Medium at https://medium.com/@deepakcardoza<br>covering AWS cloud services, serverless architecture, Infrastructure as Code,<br>and web development fundamentals.<br><br>## Key Content<br>- AWS for Beginners (8-part series): https://medium.com/@deepakcardoza<br>- SEO, GEO &amp; AEO Guide: https://deepakcardoza.com/blog/seo-geo-guide<br>- Personal Portfolio: https://deepakcardoza.com<br><br>## Expertise<br>AWS Lambda, API Gateway, DynamoDB, CloudFormation, Serverless Framework,<br>Node.js, TypeScript, Python, React, Next.js, SEO, GEO, AEO<br><br>## Certifications<br>- AWS Certified Cloud Practitioner (CCP)<br>- AWS Certified Developer Associate (DVA)<br><br>## Contact<br>Email: deepakcardoza12@gmail.com<br>LinkedIn: https://linkedin.com/in/deepak-cardoza-b544961aa<br>GitHub: https://github.com/deepak-cardoza</pre><blockquote>💡<strong>Is llms.txt an Official Standard Yet? — </strong>As of 2026, llms.txt remains a proposed standard rather than a universally adopted web standard, but its use has continued to grow across websites and documentation platforms. But creating one has zero downside: it costs nothing, takes 15 minutes to write, and positions you ahead of the curve. As AI systems mature, a well-structured llms.txt will be as standard as robots.txt is today.</blockquote><h3>Implementation Guide — HTML, React &amp; Next.js</h3><p>Everything above applies to any website. Here’s how to implement it depending on your tech stack.</p><h4>Plain HTML Sites</h4><p>Add all meta tags and JSON-LD directly in the &lt;head&gt; section of each page. Place robots.txt and llms.txt in your root directory.</p><pre>&lt;head&gt;<br>  &lt;!-- Basic --&gt;<br>  &lt;meta charset=&quot;UTF-8&quot; /&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;<br><br>  &lt;!-- Primary Meta --&gt;<br>  &lt;title&gt;Deepak Cardoza — AWS Engineer &amp; Developer&lt;/title&gt;<br>  &lt;meta name=&quot;description&quot; content=&quot;AWS Certified Full Stack Engineer based in Mangaluru.&quot; /&gt;<br>  &lt;link  rel=&quot;canonical&quot; href=&quot;https://deepakcardoza.com&quot; /&gt;<br><br>  &lt;!-- Open Graph --&gt;<br>  &lt;meta property=&quot;og:title&quot;       content=&quot;Deepak Cardoza&quot; /&gt;<br>  &lt;meta property=&quot;og:description&quot;  content=&quot;AWS Certified Full Stack Engineer.&quot; /&gt;<br>  &lt;meta property=&quot;og:url&quot;         content=&quot;https://deepakcardoza.com&quot; /&gt;<br>  &lt;meta property=&quot;og:image&quot;       content=&quot;https://deepakcardoza.com/og-image.png&quot; /&gt;<br>  &lt;meta property=&quot;og:type&quot;        content=&quot;website&quot; /&gt;<br><br>  &lt;!-- Twitter / X --&gt;<br>  &lt;meta name=&quot;twitter:card&quot;        content=&quot;summary_large_image&quot; /&gt;<br>  &lt;meta name=&quot;twitter:title&quot;       content=&quot;Deepak Cardoza&quot; /&gt;<br>  &lt;meta name=&quot;twitter:description&quot; content=&quot;AWS Certified Full Stack Engineer.&quot; /&gt;<br>  &lt;meta name=&quot;twitter:image&quot;      content=&quot;https://deepakcardoza.com/og-image.png&quot; /&gt;<br>  <br>  &lt;!-- Add in inside the head section of your code with --&gt;<br>  &lt;!-- script type=application/ld+json --&gt;<br>  &lt;!-- Refer Detailed example given above in JSON LD Section of this blog --&gt;<br>  { &quot;@context&quot;: &quot;https://schema.org&quot;, &quot;@type&quot;: &quot;Person&quot;, &quot;name&quot;: &quot;Deepak Cardoza&quot;, &quot;url&quot;: &quot;https://deepakcardoza.com&quot; }<br>&lt;head&gt;</pre><h4>React (Create React App / Vite)</h4><p>In client-side React apps, use the react-helmet-async package to manage your &lt;head&gt; tags dynamically per page.</p><pre>npm install react-helmet-async</pre><pre>import { Helmet } from &#39;react-helmet-async&#39;;<br><br>const SEO = ({ title, description, url, image, schema }) =&gt; (<br>  &lt;Helmet&gt;<br>    {/* Primary */}<br>    &lt;title&gt;{title}&lt;/title&gt;<br>    &lt;meta name=&quot;description&quot;        content={description} /&gt;<br>    &lt;link  rel=&quot;canonical&quot;          href={url} /&gt;<br><br>    {/* Open Graph */}<br>    &lt;meta property=&quot;og:title&quot;      content={title} /&gt;<br>    &lt;meta property=&quot;og:description&quot; content={description} /&gt;<br>    &lt;meta property=&quot;og:url&quot;         content={url} /&gt;<br>    &lt;meta property=&quot;og:image&quot;       content={image} /&gt;<br><br>    {/* JSON-LD */}<br>    {schema &amp;&amp; (<br>    {/* script type = &quot;application/ld+json&quot; */}<br>    {JSON.stringify(schema)}<br>    {/* script closes */}<br>)}<br>  &lt;/Helmet&gt;<br>);<br><br>// Usage on a blog post page:<br>const blogSchema = {<br>  &quot;@context&quot;: &quot;https://schema.org&quot;,<br>  &quot;@type&quot;: &quot;BlogPosting&quot;,<br>  &quot;headline&quot;: &quot;My Blog Post Title&quot;,<br>  &quot;author&quot;: { &quot;@type&quot;: &quot;Person&quot;, &quot;name&quot;: &quot;Deepak Cardoza&quot; },<br>  &quot;datePublished&quot;: &quot;2025-06-01&quot;<br>};<br><br>&lt;SEO<br>  title=&quot;My Blog Post | Deepak Cardoza&quot;<br>  description=&quot;A guide to...&quot;<br>  url=&quot;https://deepakcardoza.com/blog/my-post&quot;<br>  image=&quot;https://deepakcardoza.com/og/my-post.png&quot;<br>  schema={blogSchema}<br>/&gt;</pre><blockquote>⚠️<strong>Client-Side React Has an SEO Problem — </strong>Standard Create React App renders on the client side — when a crawler visits your page, it may see an empty HTML shell before JavaScript loads. This means your meta tags and JSON-LD might not be seen by crawlers at all. Use Next.js for any site where SEO matters — it renders on the server, so crawlers always see the full content.</blockquote><h4>Next.js — App Router (Recommended)</h4><p>Next.js 13+ with App Router has first-class built-in metadata support. No external packages needed. The generateMetadata function runs server-side and is crawler-friendly by default.</p><pre>import { Metadata } from &#39;next&#39;;<br><br>export const metadata: Metadata = {<br>  title: {<br>    default: &#39;Deepak Cardoza — AWS Engineer&#39;,<br>    template: &#39;%s | Deepak Cardoza&#39;,  // blog posts use this<br>  },<br>  description: &#39;AWS Certified Full Stack Engineer based in Mangaluru, India.&#39;,<br>  metadataBase: new URL(&#39;https://deepakcardoza.com&#39;),<br>  alternates: {<br>    canonical: &#39;/&#39;,<br>  },<br>  openGraph: {<br>    type: &#39;website&#39;,<br>    siteName: &#39;Deepak Cardoza&#39;,<br>    title: &#39;Deepak Cardoza — AWS Engineer&#39;,<br>    description: &#39;AWS Certified Full Stack Engineer.&#39;,<br>    images: [{ url: &#39;/og-image.png&#39;, width: 1200, height: 630 }],<br>  },<br>  twitter: {<br>    card: &#39;summary_large_image&#39;,<br>    title: &#39;Deepak Cardoza&#39;,<br>    description: &#39;AWS Certified Full Stack Engineer.&#39;,<br>    images: [&#39;/og-image.png&#39;],<br>  },<br>  robots: {<br>    index: true,<br>    follow: true,<br>  },<br>};<br><br>export default function RootLayout({ children }) {<br>  return (<br>    &lt;html lang=&quot;en&quot;&gt;<br>      &lt;head&gt;<br>        {/* JSON-LD — add directly in head */}<br>        {/* script type = &quot;application/ld+json&quot; */}<br>        dangerouslySetInnerHTML={{<br>            __html: JSON.stringify({<br>              &quot;@context&quot;: &quot;https://schema.org&quot;,<br>              &quot;@type&quot;: &quot;Person&quot;,<br>              &quot;name&quot;: &quot;Deepak Cardoza&quot;,<br>              &quot;url&quot;: &quot;https://deepakcardoza.com&quot;,<br>              &quot;sameAs&quot;: [<br>                &quot;https://linkedin.com/in/deepak-cardoza-b544961aa&quot;,<br>                &quot;https://github.com/deepak-cardoza&quot;<br>              ]<br>            })<br>          }}<br>        /&gt;<br>      &lt;/head&gt;<br>      &lt;body&gt;{children}&lt;/body&gt;<br>    &lt;/html&gt;<br>  );<br>}</pre><p>robots.txt in Next.js</p><pre>import { MetadataRoute } from &#39;next&#39;;<br><br>export default function robots(): MetadataRoute.Robots {<br>  return {<br>    rules: [<br>      { userAgent: &#39;*&#39;,            allow: &#39;/&#39;,  disallow: &#39;/api/&#39; },<br>      { userAgent: &#39;GPTBot&#39;,        allow: &#39;/&#39; },<br>      { userAgent: &#39;ClaudeBot&#39;,     allow: &#39;/&#39; },<br>      { userAgent: &#39;PerplexityBot&#39;, allow: &#39;/&#39; },<br>      { userAgent: &#39;Google-Extended&#39;, allow: &#39;/&#39; }, // set to &#39;/&#39; or Disallow based on your preference<br>    ],<br>    sitemap: &#39;https://deepakcardoza.com/sitemap.xml&#39;,<br>  };<br>}</pre><p>Sitemap in Next.js</p><pre>import { MetadataRoute } from &#39;next&#39;;<br><br>export default async function sitemap(): Promise&lt;MetadataRoute.Sitemap&gt; {<br>  // Fetch your blog posts dynamically<br>  const posts = await getBlogPosts();<br><br>  const blogUrls = posts.map(post =&gt; ({<br>    url: `https://deepakcardoza.com/blog/${post.slug}`,<br>    lastModified: post.updatedAt,<br>    changeFrequency: &#39;monthly&#39; as const,<br>    priority: 0.8,<br>  }));<br><br>  return [<br>    { url: &#39;https://deepakcardoza.com&#39;,       lastModified: new Date(), priority: 1.0 },<br>    { url: &#39;https://deepakcardoza.com/blog&#39;,  lastModified: new Date(), priority: 0.9 },<br>    { url: &#39;https://deepakcardoza.com/about&#39;, lastModified: new Date(), priority: 0.7 },<br>    ...blogUrls,<br>  ];<br>}</pre><h3>The Complete Developer Checklist</h3><p>Run through this every time you launch a new site or publish a major update. The first two sections are the foundation — they must exist before anything else matters. The AI layer is what puts you ahead of 90% of developers.</p><p><strong>SEO Foundation</strong></p><ul><li>Meta title, description, canonical tag on every page</li><li>Open Graph tags (og:title, og:description, og:image, og:url)</li><li>Twitter card meta tags</li><li>Favicon in all required sizes (use realfavicongenerator.net)</li><li>XML sitemap generated and accessible at /sitemap.xml</li><li>Google Search Console — site verified and sitemap submitted</li><li>Google PageSpeed Insights score 90+ on mobile and desktop</li><li>One H1 per page, logical H2→H3 hierarchy</li><li>Meaningful alt text on all images</li><li>Canonical tag pointing to the correct URL on every page</li><li>Internal links connecting all pages — no orphaned content</li></ul><p><strong>AI &amp; GEO Layer</strong></p><ul><li>robots.txt present at domain root, correct crawler permissions set</li><li>GPTBot, ClaudeBot, PerplexityBot allowed (if applicable)</li><li>Bing Webmaster Tools — site verified, sitemap submitted</li><li>IndexNow API key file present, URL submissions triggered on publish</li><li>Person schema (JSON-LD) on homepage / about page</li><li>WebSite schema (JSON-LD) on homepage</li><li>BlogPosting / Article schema (JSON-LD) on every blog post page</li><li>FAQPage schema on any page with Q&amp;A content</li><li>llms.txt file at domain root with current, accurate content</li><li>Writing style: specific factual statements, clear Q&amp;A structure</li><li>Content cross-posted on Medium, Dev.to, or Hashnode</li><li>JSON-LD validated using Google Rich Results Test</li></ul><blockquote>💡<strong>Don’t try to Do Everything at once — </strong>Start with the SEO Foundation checklist — get that 100% complete first. Then move to the AI layer. A solid foundation with no GEO is better than great GEO on a slow, poorly-structured site. Build in order.</blockquote><h3>Wrapping Up</h3><p>The internet is not going back to being primarily human. AI crawlers are here, AI search is growing, and the developers who adapt now will have a significant head start. The good news is that most of what helps AI systems understand your content — clear structure, specific writing, proper metadata, JSON-LD — also makes your content better for humans. These disciplines reinforce each other.</p><p>SEO gets your content discovered by Google. GEO gets your content cited by AI. AEO makes your content the answer. All three are built on the same foundation: a fast, well-structured, semantically rich website.</p><p>Your website is already being read by AI, whether you’ve optimized for it or not. The only question is whether it’s being understood — and cited — correctly.</p><blockquote><em>“In the age of AI search, being indexed is not enough. You need to be understood. Structure your content for machines that don’t scroll, don’t click, and don’t forgive ambiguity.”</em></blockquote><h3>Bonus Resources</h3><ul><li><a href="https://search.google.com/test/rich-results?utm_source=chatgpt.com"><strong>Google Rich Results Test</strong></a><strong> — </strong>Validate your JSON-LD structured data and preview rich snippet appearance in Google search results.</li><li><a href="https://validator.schema.org/?utm_source=chatgpt.com"><strong>Schema.org Validator</strong></a><strong> — </strong>Validate any Schema.org markup — JSON-LD, Microdata, or RDFa — against the official specification.</li><li><a href="https://search.google.com/search-console?utm_source=chatgpt.com"><strong>Google Search Console</strong></a><strong> — </strong>Monitor your site’s presence in Google Search, submit sitemaps, and identify indexing issues.</li><li><a href="https://www.bing.com/webmasters?utm_source=chatgpt.com"><strong>Bing Webmaster Tools</strong></a><strong> — </strong>Submit your site to Bing’s index — essential for ChatGPT web search visibility. Import from GSC in one click.</li><li><a href="https://www.indexnow.org/?utm_source=chatgpt.com"><strong>IndexNow</strong></a><strong> — </strong>The official IndexNow protocol site — API docs, key generator, and supported search engines.</li><li><a href="https://metatags.io/?utm_source=chatgpt.com"><strong>Metatags.io</strong></a><strong> — </strong>Generate and preview Open Graph, Twitter Card, and other meta tags with a live visual preview.</li><li><a href="https://llmstxt.org/?utm_source=chatgpt.com"><strong>llms.txt Standard</strong></a><strong> — </strong>The emerging specification for llms.txt — how to write it, what to include, and current AI adopters.</li><li><a href="https://medium.com/@deepakcardoza/does-your-website-have-seo-heres-how-to-get-it-right-your-step-by-step-seo-guide-128b11e98cd2?utm_source=chatgpt.com"><strong>SEO Basics — Previous Guide</strong></a><strong> — </strong>If you missed the fundamentals — meta tags, Google Search Console, sitemaps — start here first.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bfed821f6d81" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS for Beginners (Part 8): The Final Project — Deploy a Real Serverless App on AWS]]></title>
            <link>https://medium.com/@deepakcardoza/aws-for-beginners-part-8-the-final-project-deploy-a-real-serverless-app-on-aws-d0fb39b82395?source=rss-cbfe363f8f26------2</link>
            <guid isPermaLink="false">https://medium.com/p/d0fb39b82395</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-cloudfront]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws-s3]]></category>
            <dc:creator><![CDATA[Deepak Cardoza]]></dc:creator>
            <pubDate>Tue, 16 Jun 2026 08:45:36 GMT</pubDate>
            <atom:updated>2026-09-13T13:55:11.636Z</atom:updated>
            <content:encoded><![CDATA[<p>Deploy a production-grade serverless registration app — Lambda, API Gateway, DynamoDB, S3, CloudFront, and IaC — all in one shot. This is where Parts 1 through 7 click into place.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_GqZtiOx5YT9-htVPG9yJw.png" /></figure><p><strong>This is the finale.</strong> If you’re jumping in fresh, here’s the full series to catch up on:</p><p><a href="https://medium.com/@deepakcardoza/list/aws-for-beginners-series-simple-explanations-with-hands-on-d2734f86262d">List: AWS for Beginners Series (Simple Explanations with Hands On) | Curated by Deepak Cardoza | Medium</a></p><h3>Table of Contents</h3><p>· <a href="#9f7a">The Journey So Far — What We’ve Learned</a><br>· <a href="#60f7">One New Service: Amazon CloudFront</a><br>· <a href="#0ff7">What We’re Building Today</a><br>· <a href="#7db0">Architecture at a Glance</a><br>· <a href="#4aae">New Concept: Lambda Layers</a><br>· <a href="#c2d1">Project Structure Explained</a><br>· <a href="#020c">Hands-On: Full Step-by-Step Deployment</a><br>· <a href="#f443">Verify What Got Created</a><br>· <a href="#9094">Test the APIs</a><br>· <a href="#02a3">Deploy the Frontend</a><br>· <a href="#3e8f">Cleanup — Remove All Resources</a><br>· <a href="#cb05">And That’s a Wrap 🎓</a><br>· <a href="#1060">Bonus Resources</a></p><h3>The Journey So Far — What We’ve Learned</h3><p>Eight parts. Eight AWS services. One consistent goal — to take you from clicking “Create account” on AWS to deploying real, production-grade cloud infrastructure with confidence. Before we dive into the final project, let’s take a moment to appreciate how much ground we’ve actually covered.</p><ul><li><strong>Part 1 — S3:</strong> Created an S3 bucket, uploaded HTML files, enabled static website hosting, and served your first cloud website publicly on the internet.</li><li><strong>Part 2 — EC2:</strong> Launched a Windows Server 2025 virtual machine, configured Security Groups, connected via RDP, and understood core EC2 concepts such as AMIs, key pairs, and instance types.</li><li><strong>Part 3 — EC2 &amp; EC2 User Data:</strong> Launched an Amazon Linux 2023 server, installed nginx using a User Data script, queried EC2 metadata through IMDSv2, and served a dynamic webpage from your virtual machine.</li><li><strong>Part 4 — VPC, Subnets &amp; Internet Gateway:</strong> Built a custom VPC from scratch with public and private subnets, Internet Gateway, Route Tables, and explored Security Groups vs NACLs to create your own private corner of the AWS cloud.</li><li><strong>Part 5 — RDS &amp; MySQL:</strong> Launched a managed MySQL 8.0 database, created a DB Subnet Group across multiple Availability Zones, connected through an EC2 bastion host, and ran real SQL queries in the cloud.</li><li><strong>Part 6 — Lambda, API Gateway &amp; DynamoDB:</strong> Built your first serverless architecture using a Python Lambda function triggered by API Gateway, storing visitor records in DynamoDB through boto3.</li><li><strong>Part 7 — CloudFormation &amp; Serverless Framework:</strong> Stopped clicking and started declaring infrastructure. Used Serverless Framework v3 to deploy the Part 6 architecture entirely from a serverless.yml file with a single command.</li><li><strong>Part 8 — Bringing It All Together:</strong> Deploy a complete, production-grade serverless registration and login system — frontend, backend, database, and infrastructure — all provisioned through Infrastructure as Code. This is what you’ve been building toward.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*WZvX3HB0bddH73YohzodhA.png" /><figcaption>Congratulations</figcaption></figure><h3>One New Service: Amazon CloudFront</h3><p>There’s one service in today’s project that we haven’t covered yet: <strong>Amazon CloudFront</strong>. It’s AWS’s Content Delivery Network — and understanding it takes about three minutes once you have the right analogy.</p><p><strong>💡 Real-World Analogy — The Newspaper Printing Press</strong></p><p>Imagine a popular newspaper printed at a single press in Mumbai. Readers in Chennai, Delhi, Bengaluru, and London all want their morning edition — but every copy has to travel from that one press in Mumbai. By the time the paper reaches London, it’s old news, and the delivery cost and time are enormous.</p><p>Smart publishers solved this decades ago: they print the same edition simultaneously at <strong>local presses in every major city</strong>. Readers in London get their copy from a press in London. Readers in Chennai get theirs from Chennai. Same content, delivered fast and cheaply, from the nearest source.</p><p><strong>That’s exactly what a CDN does.</strong> CloudFront caches your content at <strong>AWS Edge Locations</strong> — physical servers distributed across 400+ cities worldwide. A user in the US gets your website served from a US edge location. A user in India gets it from an edge location in Mumbai or Chennai. Same content, dramatically faster delivery.</p><h4>CloudFront in Plain Terms</h4><ul><li><strong>Speed</strong> — Your content is cached at the edge location nearest to the user, drastically reducing load times compared to serving everything from a single S3 bucket in one region.</li><li><strong>HTTPS by Default</strong> — CloudFront provides your S3-hosted site with a proper https:// URL automatically. S3 static website endpoints only support HTTP by default, and CloudFront solves that.</li><li><strong>Security</strong> — You can keep your S3 bucket completely private and allow only CloudFront to access it. Users never interact with S3 directly — all traffic flows through the CDN.</li><li><strong>Cost Savings</strong> — CloudFront caches repeated requests at edge locations, reducing the number of requests reaching S3 or Lambda. Data transfer through CloudFront is also generally cheaper than direct S3 data transfer.</li></ul><h4>Why Not Just Use S3 Directly?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tLxCFTymMgRASldRzoupbA.png" /><figcaption>Comparision Table for S3 and S3+CloudFront CDN</figcaption></figure><blockquote>ℹ️ <strong>How We Use CloudFront in This Project: </strong>Our frontend (HTML, CSS, JavaScript) lives in an S3 bucket. The Serverless Framework’s serverless-s3-sync plugin uploads the files to S3, and CloudFront sits in front of that bucket as the public-facing URL. You don&#39;t configure CloudFront manually — the serverless.yml in the frontend folder handles it entirely. You&#39;ll get a CloudFront URL like https://d1lrefdzq6r7v6.cloudfront.net at the end of deployment.</blockquote><h3>What We’re Building Today</h3><p>Today’s project is a <strong>full-stack serverless user authentication application</strong> — the kind of thing that sits at the core of almost every real-world web app. Users can register an account and log in. Passwords are hashed. Sessions use JWT tokens. The entire backend runs serverless on AWS, and the frontend is globally distributed via CDN. And the whole thing deploys from a YAML file.</p><p>The GitHub repository is at: <a href="https://github.com/deepak-cardoza/aws-serverless-registration-app">github.com/deepak-cardoza/aws-serverless-registration-app</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1013/1*NJvHznl1s-6fuew2OACV9A.png" /></figure><h4>What the App Does</h4><ul><li><strong>User Registration</strong> — POST /register accepts name, email, phone number, date of birth, and password. It validates input using Zod, hashes passwords with bcrypt, and stores users securely in DynamoDB.</li><li><strong>User Login</strong> — POST /login verifies the user&#39;s email and hashed password, then returns a signed JWT token valid for 24 hours. This follows the same authentication flow commonly used in production applications.</li><li><strong>Frontend UI</strong> — HTML, CSS, and JavaScript pages for registration and login, configured to communicate with your API Gateway endpoints. Hosted on S3 and delivered globally through CloudFront.</li><li><strong>Full Infrastructure as Code (IaC)</strong> — Every resource, including Lambda functions, API Gateway, DynamoDB, IAM roles, Lambda Layers, S3, and CloudFront, is defined in serverless.yml, eliminating the need for manual console clicks.</li></ul><h3>Architecture at a Glance</h3><p>The application has two distinct flows. The <strong>frontend flow</strong> serves static files. The <strong>backend flow</strong> handles API requests. Both are fully serverless.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qmQH7NI-Nh-e84wznbV8rw.png" /><figcaption>Architecture of the project</figcaption></figure><h3>New Concept: Lambda Layers</h3><p>In <a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-6-serverless-architecture-with-lambda-api-gateway-dynamodb-94c9a9a4868c">Part 6</a>, our Lambda function was simple Python that used only boto3 — which comes pre-installed in the Lambda runtime. No packaging needed. But this project is TypeScript, and it uses several heavy npm packages: bcryptjs, jsonwebtoken, zod, uuid, and the AWS SDK v3.</p><p>Without a Lambda Layer, you’d have to bundle all those dependencies <em>inside every Lambda function’s deployment zip file</em>. If you have 10 Lambda functions, you’re packaging the same 30MB of node_modules ten times over — slow deploys, bloated packages, and a maintenance headache.</p><blockquote><strong>💡 Real-World Analogy</strong></blockquote><blockquote>Imagine you work in an office building with 10 teams. Every team uses Microsoft Office. Without layers, each team installs their own separate copy of Office on their own computer. 10 computers, 10 installs, 10 times the storage and update effort.</blockquote><blockquote>With a Lambda Layer, it’s like having <strong>one shared network drive</strong> where Office is installed once, and every team just mounts and uses it. One update, one place, zero duplication.</blockquote><p>A <strong>Lambda Layer</strong> is a ZIP archive of code or dependencies that you package <em>once</em> and attach to multiple Lambda functions. The functions access it at runtime — they don’t need to include those files in their own deployment packages.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iUSUXh_l_iDh6dvnwM0lsQ.png" /><figcaption>Lambda Layer and its Usage</figcaption></figure><blockquote>ℹ️ <strong>Why We Deploy Resources First: </strong>The Lambda Layer lives in a separate CloudFormation stack called aws-reg-app-resources-dev. The auth service&#39;s Lambda functions reference this layer by its ARN, which is stored in SSM Parameter Store after the layer is deployed. This is why there&#39;s a specific deployment order — resources stack first, then the auth stack.</blockquote><h3>Project Structure Explained</h3><p>Before you deploy anything, let’s understand what you’re working with. The repository has two top-level folders — backend/ and frontend/. The backend itself has three layers: shared entities, shared libraries, and the auth microservice.</p><pre>aws-serverless-registration-app/<br>├── backend/<br>│   ├── entities/<br>│   │   └── User.ts<br>│   │       ← Zod schema defining what a User object must look like<br>│   │<br>│   ├── lib/<br>│   │   ├── aws/<br>│   │   │   └── dynamodb.ts<br>│   │   │       ← Reusable DynamoDB helper functions<br>│   │   └── helper.ts<br>│   │       ← Common response formatters and CORS headers<br>│   │<br>│   ├── resources/                          ← Stack 1: Lambda Layer + SSM<br>│   │   ├── nodejs/<br>│   │   │   └── package.json<br>│   │   │       ← Dependencies packaged into the Lambda Layer<br>│   │   └── serverless.yml<br>│   │       ← Deploys the Lambda Layer resources<br>│   │<br>│   ├── services/<br>│   │   └── auth/                           ← Stack 2: Authentication API<br>│   │       ├── src/<br>│   │       │   ├── handlers/<br>│   │       │   │   ├── register.ts<br>│   │       │   │   │   ← POST /register Lambda handler<br>│   │       │   │   └── login.ts<br>│   │       │   │       ← POST /login Lambda handler<br>│   │       │   │<br>│   │       │   └── utils/<br>│   │       │       ├── schema.ts<br>│   │       │       │   ← Zod validation rules for incoming requests<br>│   │       │       └── util.ts<br>│   │       │           ← bcrypt hashing and JWT helper functions<br>│   │       │<br>│   │       ├── serverless.yml<br>│   │       │   ← API Gateway, Lambda, DynamoDB, and IAM configuration<br>│   │       └── tsconfig.json<br>│   │           ← TypeScript compiler settings<br>│   │<br>│   ├── pre-deploy.sh<br>│   │   ← Copies shared lib/ and entities/ before building<br>│   │<br>│   └── ts-build.sh<br>│   │   ← Compiles TypeScript into JavaScript<br>│<br>└── frontend/<br>    ├── index.html<br>    ├── register.html<br>    ├── login.html<br>    ├── home.html<br>    │<br>    ├── js/<br>    │   └── config.js<br>    │       ← Update this with your API Gateway URL<br>    │<br>    ├── serverless.yml<br>    │   ← Deploys the S3 bucket and CloudFront distribution<br>    │<br>    └── .env.example<br>        ← Copy to .env and set the bucket name if desired</pre><h4>Key Files Worth Understanding</h4><ul><li><strong>resources/serverless.yml</strong> — Defines and deploys the Lambda Layer. When you run sls deploy here, it packages all the npm dependencies listed in nodejs/package.json into a ZIP file, uploads them to AWS as a Lambda Layer, and stores the Layer ARN in SSM Parameter Store under the key REG_APP_NODE_LAYER.</li><li><strong>services/auth/serverless.yml</strong> — The main application stack. It defines the two Lambda functions (register and login), HTTP API Gateway routes, the auth-users-dev DynamoDB table with its Global Secondary Index (GSI) on email, and the required IAM permissions. It automatically reads the Lambda Layer ARN from SSM, which is why the resources stack must be deployed first.</li><li><strong>pre-deploy.sh</strong> — A shell script that runs before deployment. It copies the shared lib/ and entities/ folders into the authentication service&#39;s source directory. This ensures TypeScript has access to all required source files before compilation. Think of it as preparing the workspace before the build begins.</li><li><strong>ts-build.sh</strong> — Runs the TypeScript compiler (tsc) to convert .ts files into .js files inside the dist/ folder. Since Lambda executes JavaScript, TypeScript must be compiled before deployment. This script is triggered automatically through Serverless Framework lifecycle hooks during sls deploy.</li><li><strong>Note:</strong> You need TypeScript installed globally because this build script invokes the global tsc command.</li><li><strong>frontend/js/config.js</strong> — The only frontend file you need to edit manually before deployment. It contains the BASE_URL constant that tells the frontend where your API Gateway is hosted. After deploying the backend, paste your API Gateway URL here so the frontend can communicate with your APIs.</li></ul><h3>Hands-On: Full Step-by-Step Deployment</h3><p>Here’s what we need to get in place before we run our first deploy command. Read through each step fully before executing it — a few of them have important notes you don’t want to miss.</p><blockquote>⚠️ <strong>Use a Bash Terminal Throughout: </strong>The shell scripts in this project (pre-deploy.sh, ts-build.sh) require a Bash-compatible terminal.</blockquote><blockquote>On <strong>macOS/Linux</strong>, your default terminal is fine.</blockquote><blockquote>On<strong> Windows</strong>— use <strong>Git Bash</strong>(installed automatically with Git), not PowerShell or Command Prompt. PowerShell&#39;s sls alias conflicts with Serverless Framework.</blockquote><h4>Step 1 — Fork and Clone the Repository</h4><p>1. Fork the Repository</p><ul><li>Go to <a href="http://github.com/deepak-cardoza/aws-serverless-registration-app">github.com/deepak-cardoza/aws-serverless-registration-app</a>.</li><li>Click the <strong>Fork</strong> button in the top-right corner.</li><li>This creates your own copy of the repository in your GitHub account, allowing you to push changes freely.</li></ul><p>2. Clone and Enter the Directory</p><ul><li>Clone your forked repository to your local machine.</li><li>Navigate into the project directory to begin the setup process.</li></ul><pre>git clone https://github.com/YOUR-USERNAME/aws-serverless-registration-app.git<br>cd aws-serverless-registration-app</pre><h4>Step 2 — Install Node.js v24</h4><p>The Serverless Framework CLI, TypeScript compiler, and npm packages all run on Node.js. This project is tested with <strong>Node.js v24.15.0</strong>.</p><pre>node -v   # Should output: v24.x.x<br>npm  -v   # Should output: 10.x.x or higher</pre><p>If Node isn’t installed or the version is lower than v18, download the LTS installer from <a href="https://nodejs.org/">nodejs.org</a> — npm comes bundled with it automatically. Restart your terminal after installing.</p><h4>Step 3 — Install the AWS CLI</h4><p>For macOS:</p><pre>curl &quot;https://awscli.amazonaws.com/AWSCLIV2.pkg&quot; -o &quot;AWSCLIV2.pkg&quot;<br>sudo installer -pkg AWSCLIV2.pkg -target /<br>aws --version   # Verify: aws-cli/2.x.x</pre><p>For Linux:</p><pre>curl &quot;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip&quot; -o &quot;awscliv2.zip&quot;<br>unzip awscliv2.zip<br>sudo ./aws/install<br>aws --version</pre><p>For <strong>Windows</strong>, download and run the MSI installer from the <a href="https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html">AWS CLI install page</a>.</p><h4>Step 4 — Install Serverless Framework v3.40.0</h4><p>We’re pinning to <strong>exactly v3.40.0</strong> — the version this project was built and tested with. Don’t use v4 (requires Serverless.com account login) and don’t use a different v3 patch version to avoid any unexpected behaviour.</p><pre>npm install -g serverless@3.40.0<br><br># Verify<br>sls -v<br># Expected: Framework Core: 3.40.0</pre><h4>Step 5 — Install TypeScript Globally</h4><p>The deployment scripts call tsc (the TypeScript compiler) directly from the command line. For this to work, TypeScript must be installed <em>globally</em> — not just as a local project dependency.</p><pre>npm install -g typescript<br><br># Verify<br>tsc -v<br># Expected: Version 5.x.x</pre><h4>Step 6 — Create IAM User &amp; Generate Access Keys</h4><p>The Serverless Framework needs AWS credentials to create resources on your behalf. We’ll create a dedicated IAM user for this purpose. (If you completed Part 7, you can reuse the serverless-deployer user you made there.)</p><p><strong>1. Open IAM → Users → Create User</strong></p><ul><li>In the AWS Console, search for IAM.</li><li>Click <strong>Users</strong>.</li><li>Click <strong>Create user</strong>.</li></ul><p><strong>2. Name the User</strong></p><ul><li>Set the username to serverless-deploy-user.</li><li>Leave <strong>“Provide user access to the AWS Management Console”</strong> unchecked — this is a programmatic access user only.</li><li>Click <strong>Next</strong>.</li></ul><p><strong>3. Attach Permissions</strong></p><ul><li>Choose <strong>“Attach policies directly”</strong>.</li><li>Search for and select AdministratorAccess</li><li>Click <strong>Next</strong>.</li><li>Click <strong>Create user</strong>.</li><li>⚠️ AdministratorAccess is fine for learning. In a production setup, always scope permissions down to only the services being deployed.</li></ul><p><strong>4. Generate Access Keys</strong></p><ul><li>Click on the newly created user.</li><li>Open the <strong>Security credentials</strong> tab.</li><li>Click <strong>Create access key</strong>.</li><li>Select <strong>“Command Line Interface (CLI)”</strong>.</li><li>Check the confirmation box.</li><li>Click <strong>Create access key</strong>.</li><li>Download the CSV file.</li><li>⚠️ The <strong>Secret Access Key</strong> is shown only once.</li></ul><blockquote>❌ <strong>Never Commit Keys to Git — </strong>AWS access keys committed to a public GitHub repository will be found by automated bots within minutes. If this ever happens, immediately go to IAM → Security credentials → deactivate the key, then generate a new one.</blockquote><h4>Step 7 — Configure AWS Credentials</h4><pre>aws configure<br><br>AWS Access Key ID [None]:     YOUR_ACCESS_KEY_ID<br>AWS Secret Access Key [None]: YOUR_SECRET_ACCESS_KEY<br>Default region name [None]:   ap-south-1<br>Default output format [None]: json<br><br># Verify it&#39;s working<br>aws sts get-caller-identity<br># Should show your Account ID and the serverless-deploy-user ARN</pre><h4>Step 8 — Install Project Dependencies</h4><p>Navigate to the root directory of the project:</p><pre>cd backend<br>npm install<br><br># If you see peer dependency warnings, use:<br># npm install --legacy-peer-deps</pre><blockquote>💡<strong>What’s Being Installed? </strong>This installs the dev-time dependencies for the project root — the TypeScript types, build tools, and Serverless Framework plugins. The <em>runtime</em> dependencies (bcrypt, jwt, zod, etc.) are installed separately inside the Lambda Layer in the next step.</blockquote><h4>Step 9 — Deploy the Lambda Layer (Resources Stack)</h4><p>This is the first of two deployments. We deploy the shared dependencies (Lambda Layer) first, so the auth service can reference them.</p><pre># From /backend folder, Run below commands<br>cd resources<br>sls deploy --stage dev</pre><p>What happens during this deployment:</p><ul><li>Serverless Framework reads resources/serverless.yml</li><li>npm packages in nodejs/ are installed and zipped into a Lambda Layer</li><li>CloudFormation stack aws-reg-app-resources-dev is created</li><li>Layer ARN is stored in the SSM Parameter Store as REG_APP_NODE_LAYER</li></ul><pre># Expected Output:<br>✔ Service deployed to stack aws-reg-app-resources-dev (XXs)<br><br>layers:<br>  NodeDependencies: arn:aws:lambda:ap-south-1:XXXX:layer:aws-reg-app-resources-dev-NodeDependencies:1</pre><p>💡<strong>Verify in the Console — </strong>Go to <strong>Lambda → Layers</strong> — you should see aws-reg-app-resources-dev-NodeDependencies. Go <strong>to Systems Manager → Parameter Store</strong>— you should see a parameter named REG_APP_NODE_LAYER containing the Layer ARN.</p><h4>Step 10 — Deploy the Auth Service Stack</h4><p>Now the main deployment. This creates your Lambda functions, API Gateway, DynamoDB table, and IAM roles — and attaches the Layer from Step 9.</p><pre># If you are currently in backend/resouces folder:<br>cd ../services/auth<br><br># Or from backend folder navigate to backend/services/auth folder and deploy:<br>sls deploy --stage dev</pre><p>Behind the scenes, this triggers a multi-step process:</p><ul><li>pre-deploy.sh copies lib/ and entities/ into src/</li><li>ts-build.sh runs tsc to compile TypeScript → JavaScript in dist/</li><li>Serverless Framework packages the compiled JS and uploads it to S3</li><li>CloudFormation creates a stack auth-dev with all your resources</li><li>Lambda functions are linked to the NodeDependencies layer</li></ul><pre># Expected Output<br><br>✔ Service deployed to stack auth-dev (XXs)<br><br>endpoints:<br>  POST - https://abc123.execute-api.ap-south-1.amazonaws.com/dev/register<br>  POST - https://abc123.execute-api.ap-south-1.amazonaws.com/dev/login<br><br>functions:<br>  register: auth-dev-register<br>  login:    auth-dev-login</pre><blockquote>⚠️ <strong>Save That API Gateway URL! — </strong>Copy the base URL — https://abc123.execute-api.ap-south-1.amazonaws.com/dev — right now. You&#39;ll need it in two places: testing the API in Step 11, and updating frontend/js/config.js in Step 13. Don&#39;t close this terminal output yet.</blockquote><h3>Verify What Got Created</h3><p>After both deployments are complete, do a quick tour of the AWS Console to confirm everything is in place. This is also great practice — understanding what each IaC command actually creates reinforces your mental model of the whole system.</p><h4>1. CloudFormation — Two Stacks</h4><ul><li>Go to <strong>CloudFormation → Stacks</strong>.</li><li>You should see both aws-reg-app-resources-dev and auth-dev with the status CREATE_COMPLETE.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cEUvGcAC7WYME00IDjhfSQ.png" /><figcaption>CloudFormation Stacks</figcaption></figure><ul><li>Click each stack and open the <strong>Resources</strong> tab to view every AWS resource that was created.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*m9u1Kt1-fqUc13DXnCNZZQ.png" /><figcaption>Open both stacks one by one and Check Resources Tab</figcaption></figure><h4>2. Lambda Functions</h4><ul><li>Go to <strong>Lambda → Functions</strong>.</li><li>You should see auth-dev-register and auth-dev-login.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YbVf1qcrKlw-jC6HGvSuqA.png" /><figcaption>Lambda Functions</figcaption></figure><ul><li>Open either function and navigate to <strong>Configuration → Layers</strong>.</li><li>Verify that the NodeDependencies Lambda Layer is attached.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*47bS9NnHwEslrcbhCyiEsg.png" /><figcaption>You can check the layer attached in Function Overview</figcaption></figure><h4>3. API Gateway</h4><ul><li>Go to <strong>API Gateway</strong>.</li><li>You should see an HTTP API named dev-auth.</li><li>Open it and go to <strong>Routes</strong>.</li><li>Verify that POST /register and POST /login exist and are integrated with their respective Lambda functions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qKfQFh_3JW-9KGw5c0wfKw.png" /><figcaption>API Gateway -&gt; Select and Open “dev-auth” and Click on any POST method</figcaption></figure><h4>4. DynamoDB Table</h4><ul><li>Go to <strong>DynamoDB → Tables</strong>.</li><li>You should see the auth-users-dev table.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d4xHuGjuWxPfRZCM5YlN-g.png" /><figcaption>DynamoDB -&gt; Tables</figcaption></figure><ul><li>Open the table and navigate to the <strong>Indexes</strong> tab.</li><li>Verify that a Global Secondary Index named EmailIndex exists on the email attribute.</li><li>This index helps prevent duplicate email registrations.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M3gg963u3MYnXL3VZKJMlA.png" /><figcaption>Open Table named “auth-users-dev” and check the Indexes</figcaption></figure><h4>5. CloudWatch Log Groups</h4><ul><li>Go to <strong>CloudWatch → Log Management -&gt; Log Groups</strong>.</li><li>You should see /aws/lambda/auth-dev-register and /aws/lambda/auth-dev-login.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hsPWKiFGZMAM9CjQXpcg5A.png" /><figcaption>CloudWatch Log Groups</figcaption></figure><ul><li>These log groups will begin populating as soon as you make your first API calls.</li></ul><h3>Test the APIs</h3><p>Time to hit the live endpoints. Replace YOUR_API_URL in the examples below with the base URL from your deployment output.</p><h4>Register a New User</h4><pre># Test - POST /register<br>curl -X POST YOUR_API_URL/register \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{<br>    &quot;name&quot;: &quot;Deepak Cardoza&quot;,<br>    &quot;email&quot;: &quot;deepak@example.com&quot;,<br>    &quot;phone&quot;: &quot;9876543210&quot;,<br>    &quot;dateOfBirth&quot;: &quot;1995-06-15&quot;,<br>    &quot;password&quot;: &quot;SecurePass123!&quot;<br>  }&#39;</pre><pre># Expected Response - 201 Created<br>{<br>  &quot;message&quot;: &quot;User registered successfully&quot;,<br>  &quot;data&quot;: {<br>    &quot;userId&quot;:  &quot;123e4567-e89b-12d3-a456-426614174000&quot;,<br>    &quot;name&quot;:    &quot;Deepak Cardoza&quot;,<br>    &quot;email&quot;:   &quot;deepak@example.com&quot;<br>  }<br>}</pre><h4>Log In</h4><pre># Test - Post /login<br>curl -X POST YOUR_API_URL/login \<br>  -H &quot;Content-Type: application/json&quot; \<br>  -d &#39;{<br>    &quot;email&quot;: &quot;deepak@example.com&quot;,<br>    &quot;password&quot;: &quot;SecurePass123!&quot;<br>  }&#39;</pre><pre># Expected Response - 200 OK<br>{<br>  &quot;message&quot;: &quot;Login successful&quot;,<br>  &quot;data&quot;: {<br>    &quot;token&quot;: &quot;eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...&quot;,<br>    &quot;user&quot;: {<br>      &quot;id&quot;:          &quot;123e4567-e89b-12d3-a456-426614174000&quot;,<br>      &quot;name&quot;:        &quot;Deepak Cardoza&quot;,<br>      &quot;email&quot;:       &quot;deepak@example.com&quot;,<br>      &quot;phone&quot;:       &quot;9876543210&quot;,<br>      &quot;dateOfBirth&quot;: &quot;1995-06-15&quot;<br>    }<br>  }<br>}</pre><h4>Verify the Record in DynamoDB</h4><p>Go to <strong>DynamoDB → Tables → auth-users-dev → Explore table items</strong>. You should see your registered user. Notice the password field — it&#39;s a long bcrypt hash string starting with $2b$10$..., not the plain text you entered. That&#39;s your password hashing working correctly.</p><blockquote><strong>Prefer a GUI? Use Postman or Swagger Editor — </strong>Import the Swagger file at backend/services/auth/docs/auth-swagger.json into <a href="https://www.postman.com/">Postman</a> or <a href="https://editor.swagger.io/">Swagger Editor</a> for a click-based API testing experience. Update the server URL to your API Gateway base URL first.</blockquote><h3>Deploy the Frontend</h3><p>The backend is live and tested. Now let’s deploy the frontend — the HTML/CSS/JS pages — to S3 and serve them globally via CloudFront.</p><h4>Step 1 — Update the API URL in config.js</h4><p>Navigate to frontend/js/config.js and update the BASE_URL with your API Gateway URL from the backend deployment:</p><pre>const API_CONFIG = {<br>  // Replace the URL below with YOUR actual API Gateway Invoke URL<br>  BASE_URL: &#39;https://YOUR-ID.execute-api.ap-south-1.amazonaws.com/dev&#39;,<br>  ENDPOINTS: {<br>    REGISTER: &#39;/register&#39;,<br>    LOGIN:    &#39;/login&#39;<br>  }<br>};</pre><h4>Step 2 — Install Frontend Dependencies</h4><pre># From the repo root<br>cd frontend<br>npm install</pre><blockquote>ℹ️ <strong>What’s Being Installed? </strong>The frontend package.json contains the Serverless Framework plugins: serverless-s3-sync (uploads files to S3), serverless-plugin-scripts (runs CloudFront invalidation after deploy), and serverless-dotenv-plugin (reads environment variables from .env). These are dev-time only — no runtime JS dependencies.</blockquote><h4>Step 3 — Set Up the .env File</h4><pre># From Frontend folder<br>cp .env.example .env<br># Open .env if you want to customise the S3 bucket name<br># If you don&#39;t edit it, the bucket name defaults to: aws-reg-app-frontend</pre><h4>Step 4 — Deploy the Frontend</h4><pre># From Frontend folder<br>sls deploy --stage dev<br><br># On Windows PowerShell, use the full command instead of the alias:<br># serverless deploy --stage dev</pre><pre># Expected Output<br>✅ Invalidation submitted (ID: I2DTK7FREP6YISJPNGFLUW6DP2)<br>🌐 CloudFront CDN URL: https://d1lrefdzq6r7v6.cloudfront.net</pre><p>Open that CloudFront URL in your browser. You should see the app’s landing page over HTTPS. Click <strong>Register</strong>, create an account, then log in — your frontend is now talking to your Lambda backend, storing data in DynamoDB, and returning a JWT token. <strong>The entire stack is live.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J4NW0W9yWujjDHdEU-Vyyg.png" /><figcaption>Serverless Registration Application</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gac3bIZl2LdLAmkEndRz7g.png" /><figcaption>Register -&gt; Login &gt; Go to Profile</figcaption></figure><blockquote>💡 <strong>Prefer to Run Locally? </strong>If you just want to test the frontend without deploying to AWS, you can serve it locally: python -m http.server 8000 (from the frontend folder), or open index.html with VS Code&#39;s Live Server extension. Make sure you config.js still have your real API Gateway URL — the backend always runs on AWS regardless of where the frontend is served from.</blockquote><h3>Cleanup — Remove All Resources</h3><p>When you’re done experimenting, tear everything down with three commands. Remove in reverse order — frontend first, then auth service, then resources (the layer must be removed last because the auth stack depends on it).</p><pre># Do these steps in this order (Paths mentioned from the root dir)<br><br># 1. Remove frontend (S3 + CloudFront)<br>cd frontend<br>sls remove --stage dev<br><br># 2. Remove auth service (Lambda + API GW + DynamoDB)<br>cd ../backend/services/auth<br>sls remove --stage dev<br><br># 3. Remove resources (Lambda Layer + SSM parameter)<br>cd ../../resources<br>sls remove --stage dev</pre><p><strong>This is what gets deleted:</strong></p><p>1. CloudFront Distribution and S3 Frontend Bucket</p><ul><li>The CloudFront distribution and S3 frontend bucket will be deleted.</li><li>All uploaded frontend assets, including HTML, CSS, and JavaScript files, will be removed.</li></ul><p>2. Lambda Functions</p><ul><li>auth-dev-register</li><li>auth-dev-login</li></ul><p>3. HTTP API Gateway</p><ul><li>The HTTP API Gateway and all configured routes will be deleted.</li></ul><p>4. DynamoDB Table</p><ul><li>The auth-users-dev table will be deleted.</li><li>All user records stored in the table will be permanently removed.</li></ul><p>5. IAM Execution Role</p><ul><li>The Lambda execution role and all attached policies will be deleted.</li></ul><p>6. Lambda Layer</p><ul><li>The NodeDependencies Lambda Layer will be deleted.</li></ul><p>7. SSM Parameter Store Entry</p><ul><li>The REG_APP_NODE_LAYER parameter will be removed from Systems Manager Parameter Store.</li></ul><p>8. CloudFormation Stacks</p><ul><li>auth-dev</li><li>aws-reg-app-resources-dev</li><li>The frontend CloudFormation stack</li></ul><p>9. S3 Deployment Artifact Bucket</p><ul><li>The deployment artifact bucket automatically created by the Serverless Framework will be deleted.</li></ul><blockquote>⚠️<strong>DynamoDB Data Is Deleted Too — </strong>sls remove deletes the DynamoDB table and all data inside it. If you registered users during testing, they&#39;re gone. In a real production app, you&#39;d set DeletionPolicy: Retain on the table in CloudFormation to prevent accidental data loss. For learning, this is perfectly fine.</blockquote><h3>And That’s a Wrap 🎓</h3><p><strong>Congratulations 🥳🎊, you made it.</strong> Eight parts ago, you were clicking “Create bucket” in the S3 console for the first time, wondering what a VPC even was. Today, you deployed a full-stack serverless authentication system across two CloudFormation stacks, a Lambda Layer, a CDN-backed frontend, and a real NoSQL database — all from YAML files and a handful of CLI commands.</p><p>That’s not just learning AWS. That’s learning how real cloud engineers build things.</p><blockquote><em>“You came in not knowing what a server was. You’re leaving having deployed a production-grade authentication system on AWS — serverless, version-controlled, globally distributed, and torn down with a single command. That’s not beginner work anymore. That’s cloud engineering.”</em></blockquote><h3>Bonus Resources</h3><ul><li><a href="https://github.com/deepak-cardoza/aws-serverless-registration-app"><strong>GitHub Repository</strong></a> — The full source code for this project — fork it, explore it, and extend it.</li><li><a href="https://editor.swagger.io/"><strong>Swagger Editor</strong></a> — Import the auth-swagger.json file from the repository and test the API endpoints using a visual interface.</li><li><a href="https://www.postman.com/"><strong>Postman</strong> </a>— Import the same Swagger file into Postman for a full-featured API client with environment variables, collections, and request history.</li><li><a href="https://jwt.io/"><strong>JWT Debugger</strong></a> — Paste the JWT token from your login response into jwt.io to inspect the decoded payload and verify the token signature.</li><li><a href="https://auth0.com/blog/hashing-in-action-understanding-bcrypt/"><strong>bcrypt Explained</strong></a> — A deep dive into how bcrypt password hashing works, including salting, work factors, and why it’s a strong choice for password storage.</li><li><a href="https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/Introduction.html"><strong>CloudFront Documentation</strong></a> — Learn more about distributions, edge locations, cache behaviours, and origin access control for your own projects.</li><li><a href="https://aws.amazon.com/architecture/well-architected/"><strong>AWS Well-Architected Framework</strong></a> — AWS’s official guide to building secure, high-performing, resilient, and efficient cloud infrastructure.</li><li><a href="https://aws.amazon.com/certification/"><strong>AWS Certifications</strong></a> — You’ve now covered many of the core concepts tested in the AWS Cloud Practitioner and Developer Associate exams. Consider making it official.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d0fb39b82395" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS for Beginners (Part 7): Infrastructure as Code (IaC) — AWS CloudFormation & Serverless Framework]]></title>
            <link>https://medium.com/@deepakcardoza/aws-for-beginners-part-7-infrastructure-as-code-iac-aws-cloudformation-serverless-framework-703681303496?source=rss-cbfe363f8f26------2</link>
            <guid isPermaLink="false">https://medium.com/p/703681303496</guid>
            <category><![CDATA[serverless-framework]]></category>
            <category><![CDATA[infrastructure-as-code]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[aws-cloudformation]]></category>
            <dc:creator><![CDATA[Deepak Cardoza]]></dc:creator>
            <pubDate>Wed, 03 Jun 2026 08:55:09 GMT</pubDate>
            <atom:updated>2026-06-03T08:55:09.187Z</atom:updated>
            <content:encoded><![CDATA[<p>Infrastructure as Code with AWS CloudFormation &amp; the Serverless Framework — because a YAML file remembers every decision you made, even when you don’t.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZwQLQy2qUZ4pxxaaO_kGJQ.png" /></figure><h3>Table of Contents</h3><p>· <a href="#d5e3">The Console Problem — How Did We Get Here?</a><br>· <a href="#003e">What is Infrastructure as Code (IaC)?</a><br> ∘ <a href="#8948">The IaC Landscape — Tools You’ll Hear About</a><br>· <a href="#15e6">AWS CloudFormation — The Engine Under the Hood</a><br> ∘ <a href="#9361">What a Raw CloudFormation Template Looks Like</a><br> ∘ <a href="#7d9f">Drift Detection — CloudFormation’s Safety Net</a><br>· <a href="#672c">AWS SAM — A Quick Mention</a><br>· <a href="#2303">Serverless Framework — Your IaC Superpower</a><br> ∘ <a href="#5cdf">How It Works Under the Hood</a><br> ∘ <a href="#b072">v3 vs v4 — Which One Should You Use?</a><br> ∘ <a href="#bd7b">Anatomy of a serverless.yml</a><br>· <a href="#ed85">Before We Deploy: IAM User &amp; AWS Credentials Setup</a><br>· <a href="#9094">Hands-On 1: Install Serverless Framework v3</a><br> ∘ <a href="#848c">Prerequisites</a><br> ∘ <a href="#aa30">Install the Serverless Framework</a><br>· <a href="#cdc1">Hands-On 2: Deploy Part 6’s Architecture as IaC</a><br>· <a href="#fcdd">What Just Happened Under the Hood?</a><br> ∘ <a href="#4f4b">What the Serverless Framework Creates on Your Behalf</a><br>· <a href="#ad4d">A Quick Look at Other IaC Tools</a><br>· <a href="#b64c">Wrapping Up</a><br>· <a href="#99df">Bonus Resources</a></p><blockquote><strong>New here?</strong> This is Part 7 of the AWS for Beginners series. Catch up on <a href="https://medium.com/@deepakcardoza/list/aws-for-beginners-series-simple-explanations-with-hands-on-d2734f86262d">earlier parts</a>.</blockquote><p><a href="https://medium.com/@deepakcardoza/list/aws-for-beginners-series-simple-explanations-with-hands-on-d2734f86262d">List: AWS for Beginners Series (Simple Explanations with Hands On) | Curated by Deepak Cardoza | Medium</a></p><h3>The Console Problem — How Did We Get Here?</h3><p>Let’s have an honest moment. Over the past six parts of this series, we’ve done a <em>lot</em> of clicking. We’ve navigated menus, filled forms, picked dropdowns, and hit “Create” more times than we can count. And it worked! We have a VPC, two subnets, an EC2 instance, an RDS database, a Lambda function, an API Gateway, and a DynamoDB table — all up and running.</p><p>Pat yourself on the back. Seriously.</p><p>But now I want you to imagine something. Imagine your manager walks over and says:</p><p><strong>The Scenario</strong></p><p><em>“Great job on the DEV environment! Can you replicate the same setup in Production by the end of the week? Oh, and make sure everything is configured identically — same VPC settings, same security group rules, same Lambda permissions. Also, don’t forget, we found that Security Group misconfiguration last Tuesday — make sure that’s fixed too.”</em></p><p>Your stomach drops a little. Because here’s the honest truth: <strong>can you remember every single click you made?</strong></p><p>Which CIDR block did you give that private subnet? Was the RDS parameter group modified, or left at the default? Which IAM policy did you attach to the Lambda role — was it AmazonDynamoDBFullAccess or something more scoped? Did you turn on termination protection on the EC2 instance? Is deletion protection on for RDS?</p><p>And here’s the scarier question: <strong>what if a teammate quietly changed a setting after you made it?</strong> Maybe they opened port 22 to 0.0.0.0/0 on the security group &quot;just for a quick test.&quot; Maybe they increased the Lambda timeout from 10 seconds to 30 seconds and forgot to tell you. How would you even know? The console doesn&#39;t have a changelog. There&#39;s no &quot;who changed this?&quot; button. There&#39;s no undo history.</p><p>You have a running environment with no paper trail, no documentation beyond your own memory, and no guarantee that Production will match DEV. One wrong click and you’ve introduced a configuration drift that could take hours to debug.</p><p>This is the exact problem that <strong>Infrastructure as Code</strong> was built to solve.</p><h3>What is Infrastructure as Code (IaC)?</h3><blockquote><strong>💡 Real-World Analogy</strong></blockquote><blockquote>Think of building a house. If you hire a builder and just describe your requirements verbally — “I want 3 bedrooms, 2 bathrooms, an open kitchen” — and they wing it from memory, every house they build for you will be slightly different. Doors in different places. Slightly different wiring. Different tile in the bathroom. And if that builder gets sick one day, the new builder has no idea what was already decided.</blockquote><blockquote>But if you have <strong>blueprints</strong> — detailed, precise architectural drawings — any builder can pick them up and build the exact same house. In Tokyo or Toronto. In DEV or Production. The blueprints <em>are</em> the source of truth.</blockquote><blockquote><strong>“Infrastructure as Code is your cloud blueprint”</strong></blockquote><p>Instead of clicking through the AWS Console to create your infrastructure, you <strong>describe it in a file</strong> — YAML, JSON, or actual code — and a tool reads that file and creates everything for you. Automatically. Consistently. Every single time.</p><p><strong>Why Does This Matter?</strong></p><ul><li><strong>Repeatability — </strong>Run the same file a hundred times and get the exact same infrastructure. DEV, Staging, Production — all identical.</li><li><strong>Version Control — </strong>Your infrastructure lives in Git. Every change is tracked, committed, and reviewed. “What changed between Tuesday and today?” — just run git diff.</li><li><strong>Auditability — </strong>Every infrastructure decision is visible in the file. No more “I think someone changed this, but I’m not sure when.”</li><li><strong>Disaster Recovery — </strong>If your entire environment gets deleted, you can redeploy everything from the file in minutes — not days of clicking through the console.</li><li><strong>Team Collaboration — </strong>Share a YAML file instead of a “20-step wiki page with screenshots.” New teammates can be onboarded by running a single command.</li></ul><h4>The IaC Landscape — Tools You’ll Hear About</h4><p>There are several IaC tools in the AWS world. Here’s a quick map so you know what’s what:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*emSqQSlb9mMYqLdTUGDFpg.png" /><figcaption>IaC Tools Comparisions</figcaption></figure><blockquote>ℹ️ <strong>What We’re Using in This Series? </strong>In this blog, we’ll use <strong>the Serverless Framework</strong>. It’s developer-friendly, widely used in the industry, and — importantly — it sits on top of CloudFormation. So understanding CF first gives you a strong mental model of what’s happening under the hood when you run a single serverless deploy command.</blockquote><h3>AWS CloudFormation — The Engine Under the Hood</h3><p>Before we touch the Serverless Framework, you need a mental model of what’s actually happening behind the scenes. Because every IaC tool we’ll use in this series — including Serverless Framework — ultimately talks to one AWS service: <strong>CloudFormation</strong>.</p><blockquote>💡 Real-World Analogy</blockquote><blockquote>CloudFormation is like a <strong>project manager at a construction company</strong>. You hand them the blueprints (your template file), and they coordinate with all the subcontractors — the electricians (EC2), the plumbers (RDS), the internet folks (VPC) — to build everything in the right order. They track what’s been built, what’s pending, and what failed. They also keep a record of the final state so they can update or tear down exactly what they built.</blockquote><ul><li><strong>Template</strong> — A YAML or JSON file that describes what AWS resources to create and how to configure them. This is your blueprint.</li><li><strong>Stack</strong> — When you deploy a template, CloudFormation creates a Stack — a named collection of all the resources defined in that template, managed as one unit.</li><li><strong>Resources</strong> — The actual AWS components being created, such as Lambda functions, DynamoDB tables, S3 buckets, and IAM roles. Each resource has a Type and Properties.</li><li><strong>Outputs</strong> — Values that CloudFormation returns after the stack is created, such as your API Gateway URL or S3 bucket name, which you can use elsewhere.</li></ul><h4>What a Raw CloudFormation Template Looks Like</h4><p>Just so you have a feel for it — here’s what a minimal CloudFormation YAML template looks like for creating a DynamoDB table:</p><pre>AWSTemplateFormatVersion: &quot;2010-09-09&quot;<br>Description: My DynamoDB Visitors Table<br><br>Resources:<br>  VisitorsTable:<br>    Type: AWS::DynamoDB::Table<br>    Properties:<br>      TableName: Visitors<br>      BillingMode: PAY_PER_REQUEST<br>      AttributeDefinitions:<br>        - AttributeName: visitor_id<br>          AttributeType: S<br>      KeySchema:<br>        - AttributeName: visitor_id<br>          KeyType: HASH<br><br>Outputs:<br>  TableName:<br>    Value: !Ref VisitorsTable<br>    Description: Name of the DynamoDB table</pre><p>That’s a fairly clean example. Now imagine writing raw CF YAML for a Lambda function + its execution role + API Gateway + all the event mapping configuration. You’re looking at 150+ lines for what is conceptually a simple setup. It gets verbose, fast.</p><blockquote>💡<strong>CloudFormation is Free — </strong>CloudFormation itself costs nothing to use. You only pay for the AWS resources it creates (the Lambda functions, DynamoDB tables, etc.). This makes IaC a zero-overhead addition to your workflow.</blockquote><h4>Drift Detection — CloudFormation’s Safety Net</h4><p>Remember the scenario from earlier — a teammate quietly changes a Security Group setting in the console? CloudFormation has a feature called <strong>Drift Detection</strong> that can compare your running resources against what your template says they should look like, and flag anything that’s changed manually. It won’t auto-fix it, but it’ll tell you exactly what drifted. That’s your audit trail.</p><h3>AWS SAM — A Quick Mention</h3><p>While we’re here, you’ll often hear about <strong>AWS SAM (Serverless Application Model)</strong>. It’s AWS’s own higher-level layer on top of CloudFormation, designed specifically for serverless workloads. SAM introduces a few shorthand resource types — like AWS::Serverless::Function — that expand into full CloudFormation behind the scenes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bTlWcjvRIue9UQWf9aCO_g.png" /></figure><blockquote>ℹ️<strong>Why Mention SAM at All? — </strong>You’ll encounter SAM in AWS documentation, tutorials, and job descriptions — so it’s worth knowing it exists. But for this series, we’re going with the Serverless Framework. It’s even more concise, has a massive community, and is widely used in production environments.</blockquote><h3>Serverless Framework — Your IaC Superpower</h3><p>The Serverless Framework is an open-source CLI tool that lets you define your entire serverless application — Lambda functions, API Gateway routes, DynamoDB tables, IAM roles, S3 buckets — in a single, beautifully concise serverless.yml file. One command deploys all of it. One command tears it all down.</p><h4>How It Works Under the Hood</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*7oZkM0aIWbVi662TItEDcg.png" /></figure><p>You never write raw CloudFormation. The Serverless Framework generates it for you from your much simpler serverless.yml. You get all the power of CloudFormation with a fraction of the YAML.</p><h4>v3 vs v4 — Which One Should You Use?</h4><p>This is something worth pausing on, because there’s been a change in the Serverless Framework that affects beginners.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T1XU_iiZOPdeZRaTur0MKg.png" /><figcaption>Serverless Framework V3 &amp; V4 Comparision</figcaption></figure><blockquote>⚠️ <strong>Don’t Panic — We’re Using v3, and Here’s Why — </strong>For this learning series, we’ll install Serverless Framework<strong>v3</strong>using npm install -g serverless@3. Why? Because v4 requires you to create a Serverless.com account and authenticate before you can deploy. That&#39;s one more login, one more dependency, and one more thing that can go wrong when you&#39;re just trying to learn. v3 is stable, works exactly the same for everything we&#39;ll do, and has zero friction. When you graduate to real production projects, switch to v4 — it has better tooling and active support.</blockquote><h4>Anatomy of a serverless.yml</h4><p>A serverless.yml has five main sections. Here&#39;s what each one does:</p><pre># ─── 1. SERVICE ──────────────────────────────────────────────<br># The name of your application / microservice<br>service: my-visitor-api<br><br># Pin to v3 so we don&#39;t accidentally auto-upgrade<br>frameworkVersion: &#39;3&#39;<br><br># ─── 2. PROVIDER ─────────────────────────────────────────────<br># Which cloud, what runtime, what region<br>provider:<br>  name: aws<br>  runtime: python3.12<br>  region: ap-south-1<br>  iam:               # IAM permissions for ALL Lambda functions<br>    role:<br>      statements:<br>        - Effect: Allow<br>          Action:<br>            - dynamodb:PutItem<br>            - dynamodb:GetItem<br>            - dynamodb:Scan<br>          Resource: !GetAtt VisitorsTable.Arn<br><br># ─── 3. FUNCTIONS ────────────────────────────────────────────<br># Your Lambda functions + their API Gateway triggers<br>functions:<br>  helloWorld:<br>    handler: handler.hello   # handler.py → hello() function<br>    events:<br>      - httpApi:<br>          path: /hello<br>          method: GET<br><br>  addVisitor:<br>    handler: handler.add_visitor<br>    events:<br>      - httpApi:<br>          path: /visitor<br>          method: POST<br><br># ─── 4. RESOURCES ────────────────────────────────────────────<br># Raw CloudFormation — for anything Serverless Framework<br># doesn&#39;t have a shorthand for (like DynamoDB tables)<br>resources:<br>  Resources:<br>    VisitorsTable:<br>      Type: AWS::DynamoDB::Table<br>      Properties:<br>        TableName: Visitors<br>        BillingMode: PAY_PER_REQUEST<br>        AttributeDefinitions:<br>          - AttributeName: visitor_id<br>            AttributeType: S<br>        KeySchema:<br>          - AttributeName: visitor_id<br>            KeyType: HASH</pre><blockquote>💡<strong>Notice the Indentation — </strong>YAML is whitespace-sensitive — indentation defines the structure. Always <strong>use 2 spaces per level</strong>, never tabs. If your deploy fails with a cryptic YAML error, it’s almost always a spacing issue.</blockquote><h3>Before We Deploy: IAM User &amp; AWS Credentials Setup</h3><p>The Serverless Framework runs on your local machine and talks to AWS on your behalf. To do that, it needs <strong>AWS credentials</strong> — an Access Key ID and Secret Access Key from an IAM user that has permission to create resources.</p><p>This is different from logging into the AWS Console with your email. Console login uses your root or IAM user password. CLI tools use <strong>access keys</strong> — a separate authentication mechanism for programmatic access.</p><h4>Step 1: Create a Dedicated IAM User for Deployments</h4><p>We’ll create a new IAM user specifically for deploying infrastructure. It’s good practice to keep this separate from your personal IAM user.</p><p><strong>1. Open IAM in the AWS Console</strong></p><ul><li>Search for IAM in the top search bar.</li><li>Click Users in the left sidebar.</li><li>Click Create user.</li></ul><p><strong>2. Name the User</strong></p><ul><li>Enter a username like serverless-deployer.</li><li>Leave <strong>“Provide user access to the AWS Management Console”</strong> unchecked — this is a programmatic user only, not a console login.</li><li>✅ Click Next.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*foZXRlfz3aldwCpUaeS3pw.png" /><figcaption>AWS Console -&gt; IAM -&gt; Create User</figcaption></figure><p><strong>3. Attach Permissions</strong></p><ul><li>Choose <strong>“Attach policies directly”</strong>.</li><li>Search for and check AdministratorAccess.</li><li>⚠️ In a real production environment, you’d create a custom scoped-down policy covering only the services you use. For learning purposes, AdministratorAccess is fine — just never share these keys.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZcqxM4sIn_FuVYwNr9g1ZA.png" /><figcaption>Attach Policies Directly -&gt; Select AdministratorAccess -&gt; Next</figcaption></figure><p><strong>4. Review and Create</strong></p><ul><li>Click through the review step.</li><li>Click Create user.</li><li>The user now exists but has no access keys yet.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vTeQmUEn8OJTPMz8gszEfA.png" /><figcaption>Review and Click Create</figcaption></figure><p><strong>5. Generate Access Keys</strong></p><ul><li>Click on your new user (serverless-deployer).</li><li>Go to the Security credentials tab.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bRia6fTFzlYng8rSNvNhjw.png" /><figcaption>IAM -&gt; Select user you created -&gt; Security Credentials</figcaption></figure><ul><li>Scroll to <strong>Access keys</strong>.</li><li>Click Create access key.</li><li>On the next screen, select <strong>Command Line Interface (CLI)</strong>.</li><li>Check the confirmation box.</li><li>Click Next.</li><li>Click Create access key.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*I5rNHCM5jkVOZA-wJvjV2Q.png" /><figcaption>Security Credentials -&gt; Access Keys -&gt; Create Access Key</figcaption></figure><ul><li>✅ You’ll see your <strong>Access Key ID</strong> and <strong>Secret Access Key</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FXhaCUkmNTCIZSzRdMM0FQ.png" /><figcaption>Click Next &amp; Create Access Key</figcaption></figure><ul><li>⚠️ This is the <strong>only time</strong> the Secret Access Key is shown.</li><li>Click <strong>“Download .csv file”</strong> to save it.</li></ul><blockquote>❌ <strong>Critical Security Rule — </strong>Never commit your AWS Access Key or Secret Key to a Git repository — even a private one. These keys give programmatic access to your AWS account. If they leak to GitHub, automated bots will find them within minutes and can spin up thousands of dollars of resources. If this ever happens, deactivate the key immediately from IAM → Security credentials.</blockquote><h4>Step 2: Install the AWS CLI</h4><p>The AWS CLI is a command-line tool that lets you interact with AWS services from your terminal. We’ll use it to store your credentials locally so the Serverless Framework can find them.</p><pre># macOS (using Homebrew)<br>brew install awscli<br><br># Windows — Download the installer from:<br># https://docs.aws.amazon.com/cli/latest/userguide/getting-started-install.html<br><br># Verify installation<br>aws --version<br># Expected output: aws-cli/2.x.x ...</pre><h4>Step 3: Configure Your Credentials</h4><p>Run aws configure and enter the keys from the CSV you downloaded:</p><pre>aws configure<br><br># AWS will ask you four questions:<br>AWS Access Key ID [None]: AKIAIOSFODNN7EXAMPLE      # ← your actual key<br>AWS Secret Access Key [None]: wJalrXUtnFEMI/EXAMPLE/KEY  # ← your actual secret<br>Default region name [None]: ap-south-1<br>Default output format [None]: json</pre><p>Your credentials are now stored in ~/.aws/credentials (on Mac/Linux) or C:\Users\YourName\.aws\credentials (on Windows). The Serverless Framework will automatically find them there.</p><h4>Step 4: Verify Everything Works</h4><pre>aws sts get-caller-identity<br><br># Expected output:<br>{<br>    &quot;UserId&quot;: &quot;AIDAIOSFODNN7EXAMPLE&quot;,<br>    &quot;Account&quot;: &quot;123456789012&quot;,<br>    &quot;Arn&quot;: &quot;arn:aws:iam::123456789012:user/serverless-deployer&quot;<br>}</pre><blockquote>💡<strong>If You See “Unable to locate credentials” — </strong>Run aws configure again and double-check that you pasted the full keys correctly. The Secret Access Key is long — make sure you copied the entire thing from the CSV file.</blockquote><h3>Hands-On 1: Install Serverless Framework v3</h3><h4>Prerequisites</h4><p>The Serverless Framework is installed via <strong>npm</strong>, the Node.js package manager. You’ll need Node.js on your machine first — even though our Lambda code is in Python, the Serverless Framework CLI itself is built in Node.js.</p><blockquote>ℹ️ <strong>Install Node.js First: </strong>Download Node.js from <a href="https://nodejs.org/">nodejs.org</a>. Get the LTS version (v18 or v20). npm comes bundled with it automatically. After installing, verify with: node --version and npm --version</blockquote><h4>Install the Serverless Framework</h4><pre># Install Serverless Framework v3 globally<br>npm install -g serverless@3<br><br># Verify the installation<br>serverless --version<br># Expected: Framework Core: 3.x.x<br><br># You can also use the shorthand alias<br>sls --version</pre><blockquote>💡<strong>On macOS: Permission Error? </strong>If you see <em>EACCES: permission denied</em>, prefix the command with sudo: sudo npm install -g serverless@3. Or better — fix npm&#39;s global directory permissions by following npm&#39;s official guide on this.</blockquote><p>That’s it. The Serverless Framework is now installed globally on your machine. You can run serverless or sls from any directory.</p><h3>Hands-On 2: Deploy Part 6’s Architecture as IaC</h3><p>Remember what we built in <a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-6-serverless-architecture-with-lambda-api-gateway-dynamodb-94c9a9a4868c">Part 6</a> by clicking through the AWS Console?</p><ul><li>A Lambda function that returns “Hello from Lambda!”</li><li>A Lambda function that writes visitor data to DynamoDB</li><li>An HTTP API Gateway to expose both functions as URLs</li><li>A DynamoDB table called Visitors</li><li>An IAM role with DynamoDB write permission</li></ul><p>We clicked through five separate AWS services, made dozens of configuration choices, and hoped we remembered everything correctly. Now we’re going to do <strong>all of that with one YAML file and one command</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1020/1*cQT3d32hHtBlRw_EMJyTaA.png" /></figure><h4>Project Structure</h4><p>Create a new folder for this project. Here’s what our structure will look like:</p><pre>visitor-api/<br>├── handler.py        # Lambda function code<br>└── serverless.yml    # Our entire infrastructure, declared</pre><p>That’s it. Just two files.</p><h4>Step 1: Create the Project Folder</h4><pre>mkdir visitor-api<br>cd visitor-api</pre><h4>Step 2: Create handler.py</h4><p>This is the same Lambda code from Part 6 — no changes needed. The IaC approach doesn’t change how you write your application code; it only changes how you <em>deploy</em> the surrounding infrastructure.</p><pre>import json<br>import boto3<br>import uuid<br>from datetime import datetime<br><br># ─── Function 1: Hello World ──────────────────────────────<br>def hello(event, context):<br>    return {<br>        &#39;statusCode&#39;: 200,<br>        &#39;headers&#39;: {&#39;Content-Type&#39;: &#39;application/json&#39;},<br>        &#39;body&#39;: json.dumps({<br>            &#39;message&#39;: &#39;Hello from Lambda - now deployed via IaC! 🚀&#39;<br>        })<br>    }<br><br># ─── Function 2: Add Visitor to DynamoDB ──────────────────<br>def add_visitor(event, context):<br>    dynamodb = boto3.resource(&#39;dynamodb&#39;)<br>    table = dynamodb.Table(&#39;Visitors-dev&#39;)<br><br>    visitor_id = str(uuid.uuid4())<br>    timestamp = datetime.utcnow().isoformat()<br><br>    table.put_item(<br>        Item={<br>            &#39;visitor_id&#39;: visitor_id,<br>            &#39;name&#39;:       &#39;Deepak&#39;,<br>            &#39;city&#39;:       &#39;Mangaluru&#39;,<br>            &#39;timestamp&#39;:  timestamp<br>        }<br>    )<br><br>    return {<br>        &#39;statusCode&#39;: 201,<br>        &#39;headers&#39;: {&#39;Content-Type&#39;: &#39;application/json&#39;},<br>        &#39;body&#39;: json.dumps({<br>            &#39;message&#39;: &#39;Visitor added!&#39;,<br>            &#39;visitor_id&#39;: visitor_id,<br>            &#39;timestamp&#39;: timestamp<br>        })<br>    }</pre><h4>Step 3: Create serverless.yml</h4><p>Now for the star of the show. Create a file called serverless.yml in the same folder. Read through the comments — every line is explained:</p><pre># ──────────────────────────────────────────────────────────<br># SERVICE: The name of this application<br># ──────────────────────────────────────────────────────────<br>service: visitor-api<br><br># Pin to v3 so behaviour is predictable<br>frameworkVersion: &#39;3&#39;<br><br># ──────────────────────────────────────────────────────────<br># PROVIDER: Cloud target + global Lambda settings<br># ──────────────────────────────────────────────────────────<br>provider:<br>  name: aws<br>  runtime: python3.12<br>  region: ap-south-1<br>  stage: dev          # deploy to &quot;dev&quot; stage by default<br>  timeout: 10          # seconds — applies to all functions<br>  memorySize: 128      # MB — the minimum, fine for our use case<br><br>  # IAM role permissions — what our Lambda functions are<br>  # allowed to do. Serverless Framework creates the IAM<br>  # role automatically and attaches these statements to it.<br>  iam:<br>    role:<br>      statements:<br>        - Effect: Allow<br>          Action:<br>            - dynamodb:PutItem<br>            - dynamodb:GetItem<br>            - dynamodb:Scan<br>          Resource:<br>            - !GetAtt VisitorsTable.Arn<br><br># ──────────────────────────────────────────────────────────<br># FUNCTIONS: Our Lambda functions + their HTTP triggers<br># ──────────────────────────────────────────────────────────<br>functions:<br><br>  # Function 1: Hello World<br>  # handler.hello means: handler.py file → hello() function<br>  helloWorld:<br>    handler: handler.hello<br>    description: Returns a hello message<br>    events:<br>      - httpApi:          # HTTP API Gateway (same type we used in Part 6)<br>          path: /hello<br>          method: GET<br><br>  # Function 2: Add Visitor<br>  addVisitor:<br>    handler: handler.add_visitor<br>    description: Records a visitor in DynamoDB<br>    events:<br>      - httpApi:<br>          path: /visitor<br>          method: POST<br><br># ──────────────────────────────────────────────────────────<br># RESOURCES: Raw CloudFormation for extra infrastructure<br># Serverless Framework handles Lambda + API GW automatically.<br># For DynamoDB, we drop down to raw CF syntax.<br># ──────────────────────────────────────────────────────────<br>resources:<br>  Resources:<br>    VisitorsTable:<br>      Type: AWS::DynamoDB::Table<br>      Properties:<br>        TableName: Visitors-dev   # -dev suffix keeps it separate from Part 6<br>        BillingMode: PAY_PER_REQUEST<br>        AttributeDefinitions:<br>          - AttributeName: visitor_id<br>            AttributeType: S<br>        KeySchema:<br>          - AttributeName: visitor_id<br>            KeyType: HASH</pre><blockquote>ℹ️<strong>Why is the DynamoDB table name </strong><strong>Visitors-dev? </strong>The Serverless Framework deploys to a<strong> stage </strong>(we used dev). Appending -dev To resource names is a common convention — it prevents the new table from conflicting with the one you created manually in Part 6. You can deploy the same file to a prod stage later, and it&#39;ll create a completely separate set of resources.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wkV-mSQLgnQN_Rpp0V7ZSA.png" /><figcaption>Project Structure</figcaption></figure><h4>Step 4: Deploy!</h4><pre># Run the below command in your terminal where AWS CLI Creds are configured<br>serverless deploy<br><br># You&#39;ll see output like this:<br>Deploying visitor-api to stage dev (ap-south-1)<br><br>✔ Service deployed to stack visitor-api-dev (45s)<br><br>endpoints:<br>  GET  - https://abc123.execute-api.ap-south-1.amazonaws.com/hello<br>  POST - https://abc123.execute-api.ap-south-1.amazonaws.com/visitor<br><br>functions:<br>  helloWorld:  visitor-api-dev-helloWorld<br>  addVisitor:  visitor-api-dev-addVisitor<br><br>Stack Outputs:<br>  HttpApiId: abc123<br>  ServerlessDeploymentBucketName: visitor-api-dev-serverlessdeploymentbucket-xxx</pre><p>During the deployment, you can go to AWS Console -&gt; CloudFormation Service in the deployed region, i.e., ap-south-1, and see the CloudFormation stack (we read earlier) being created automatically via Serverless Framework.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h3yIUJWPIik6CgqsvDNq3Q.png" /><figcaption>During Deployment -&gt; CloudFormation Stack Creation &amp; Updation</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BFX7bNgbQxajOKNV7FteJg.png" /><figcaption>Deployment Success in Terminal via Serverless Framework</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UNy5nUZ1Xm9y_YL-cUmF9w.png" /><figcaption>Deployment Complete in CloudFormation</figcaption></figure><p>That’s it. Your entire architecture is deployed. Notice those endpoint URLs — those are your live API Gateway URLs, ready to use.</p><h4>Step 5: Test Your Endpoints</h4><pre># Test the hello endpoint<br>curl https://abc123.execute-api.ap-south-1.amazonaws.com/hello<br><br># Expected response:<br>{&quot;message&quot;: &quot;Hello from Lambda — now deployed via IaC! 🚀&quot;}<br><br># Test the visitor endpoint<br>curl -X POST https://abc123.execute-api.ap-south-1.amazonaws.com/visitor<br><br># Expected response:<br>{<br>  &quot;message&quot;: &quot;Visitor added!&quot;,<br>  &quot;visitor_id&quot;: &quot;a3f7b2c1-...&quot;,<br>  &quot;timestamp&quot;: &quot;2025-01-15T10:30:00.000000&quot;<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zvMwti091H6L06qA8vWFfQ.png" /><figcaption>Testing the Endpoints via Terminal</figcaption></figure><blockquote>💡<strong>You Can Also Use Your Browser — </strong>For the GET endpoint (/hello) Just paste the URL directly into your browser. For the POST endpoint, you&#39;ll need curl, Postman, or a similar tool since browsers default to GET requests.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/811/1*EIg0_gC9riJCwjAgFBZIjQ.png" /><figcaption>Testing GET Endpoint via Browser</figcaption></figure><h4>Step 6: Cleanup</h4><p>One of the best parts of IaC — tearing down is just as easy as deploying. One command removes every single resource the framework created:</p><pre>serverless remove<br><br># Output:<br>Removing visitor-api from stage dev (ap-south-1)<br>✔ Service visitor-api has been successfully removed</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQuGICZc4l8bl4AOD3444g.png" /><figcaption>Deleting the Infra using sls remove / serverless remove</figcaption></figure><ul><li><strong>Lambda Functions</strong> — helloWorld and addVisitor deleted.</li><li><strong>HTTP API Gateway</strong> — API Gateway and all routes deleted.</li><li><strong>DynamoDB Table</strong> — Visitors-dev deleted.</li><li><strong>IAM Role &amp; Policies</strong> — Deleted.</li><li><strong>CloudFormation Stack</strong> — Deleted.</li><li><strong>S3 Deployment Bucket</strong> — Deleted.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rq5yKwhK98ic0k1ycuggTw.png" /><figcaption>CloudFormation Stack along with all resources is being deleted</figcaption></figure><blockquote>⚠️ <strong>DynamoDB Data is Gone Too — </strong>When serverless remove deletes the DynamoDB table, and all the visitor records in it are deleted as well. In a production app, you&#39;d configure DeletionPolicy: Retain on the table to prevent accidental data loss. For learning, this is fine — you know how to recreate it instantly.</blockquote><h3>What Just Happened Under the Hood?</h3><p>After you run serverless deploy, Go to the AWS Console and search for <strong>CloudFormation</strong>. Click on <strong>Stacks</strong>. You&#39;ll see a stack called visitor-api-dev. As shown in the above screenshots.</p><p>Click on it. You’ll see several tabs — the most interesting one is <strong>Resources</strong>. It lists every single AWS resource that was created: the Lambda functions, the API Gateway, the DynamoDB table, the IAM role, and the S3 deployment bucket. All of them are tracked and managed together as a single unit.</p><blockquote><strong>💡 The Key Insight</strong></blockquote><blockquote>Every click you used to do manually — creating the Lambda, configuring the trigger, setting up the IAM role, creating the DynamoDB table — is now represented in your serverless.yml. It&#39;s version-controlled. It&#39;s repeatable. It&#39;s shareable. And it takes 45 seconds to recreate from scratch on any AWS account, in any region.</blockquote><blockquote><em>This is the entire value proposition of Infrastructure as Code.</em></blockquote><h4>What the Serverless Framework Creates on Your Behalf</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*rdo56mZoaozFVGAKMg5N9g.png" /></figure><h3>A Quick Look at Other IaC Tools</h3><p>Now that you understand IaC through the lens of the Serverless Framework and CloudFormation, here’s a brief look at the other tools you’ll hear about as you grow in cloud engineering. You don’t need to learn these now — just know they exist and roughly what problem each one solves.</p><ul><li><a href="https://developer.hashicorp.com/terraform"><strong>Terraform</strong></a> — The multi-cloud IaC king. Write one configuration and deploy to AWS, Azure, and GCP using the same tool. An industry favourite for large engineering teams. Uses its own language: HCL.</li><li><a href="https://aws.amazon.com/cdk/"><strong>AWS CDK</strong></a> — Write your infrastructure in actual Python, TypeScript, or Java instead of YAML. CDK compiles your code into CloudFormation under the hood. Great for developers who prefer code over configuration files.</li><li><a href="https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/what-is-sam.html"><strong>AWS SAM CLI</strong></a> — AWS’s official serverless toolkit. The closest alternative to Serverless Framework, with built-in local Lambda emulation via Docker. More AWS-native but slightly more verbose.</li><li><a href="https://www.pulumi.com/"><strong>Pulumi</strong></a> — Similar to CDK, but multi-cloud. Write infrastructure in Python, TypeScript, Go, and other languages, then deploy to any cloud provider. Growing in popularity among teams that prefer real programming languages over YAML.</li></ul><blockquote>ℹ️ <strong>The Right Tool for the Right Job:</strong></blockquote><blockquote>For learning AWS serverless:<strong>Serverless Framework</strong>.</blockquote><blockquote>For large multi-service AWS apps:<strong>CDK or SAM</strong>.</blockquote><blockquote>For multi-cloud enterprise setups:<strong>Terraform</strong>.</blockquote><blockquote>For everything in between: your team’s preference. The underlying concepts — templates, stacks, declarative resources — are the same everywhere. Once you know one, picking up another takes days, not months.</blockquote><h3>Wrapping Up</h3><p>We started this blog with a fear — the fear of clicking, forgetting, and hoping Production looks like DEV. We end it with a YAML file, a single command, and the confidence that your infrastructure is documented, repeatable, and version-controlled. That’s a huge leap.</p><p>The console isn’t going away — it’s still the best place to explore and learn. But once you know what you’re building, IaC is how you build it reliably. You’ve made that transition today.</p><blockquote><em>“Any infrastructure you can’t recreate from a file is infrastructure you don’t fully own. Write the YAML, commit it to Git, and sleep better tonight.”</em></blockquote><h3>Bonus Resources</h3><ul><li><a href="https://www.serverless.com/framework/docs">Serverless Framework v3 Documentation</a> — Official documentation for everything in serverless.yml — functions, events, resources, plugins, and more.</li><li><a href="https://docs.aws.amazon.com/cloudformation/">AWS CloudFormation Documentation</a> — The full reference for every AWS resource type you can declare in CloudFormation templates. Your go-to resource when writing the resources section.</li><li><a href="https://docs.aws.amazon.com/IAM/latest/UserGuide/best-practices.html">AWS IAM Best Practices</a> — AWS’s official guide to IAM security, including least privilege, access key rotation, MFA, and more. Essential reading as you move toward production workloads.</li><li><a href="https://developer.hashicorp.com/terraform/tutorials/aws-get-started">Terraform AWS Tutorial </a>— HashiCorp’s official getting-started guide for deploying infrastructure on AWS with Terraform.</li><li><a href="https://calculator.aws/#/">AWS Pricing Calculator</a> — Estimate the cost of your AWS architecture before deployment. Useful when planning production-ready environments and scaling beyond learning projects.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=703681303496" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS for Beginners (Part 6): Serverless Architecture with Lambda, API Gateway & DynamoDB]]></title>
            <link>https://medium.com/@deepakcardoza/aws-for-beginners-part-6-serverless-architecture-with-lambda-api-gateway-dynamodb-94c9a9a4868c?source=rss-cbfe363f8f26------2</link>
            <guid isPermaLink="false">https://medium.com/p/94c9a9a4868c</guid>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[dynamodb]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Deepak Cardoza]]></dc:creator>
            <pubDate>Wed, 27 May 2026 08:54:04 GMT</pubDate>
            <atom:updated>2026-05-27T08:54:04.832Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS for Beginners (Part 6): Serverless &amp; Event-Driven Architecture with Lambda, API Gateway &amp; DynamoDB</h3><p>Build and deploy a real serverless backend — no servers to manage, no EC2 to babysit. Just code, events, and scale.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FXTcg7WnsqOrPRQRY0897A.png" /></figure><h3>Table of Contents</h3><p>· <a href="#e0b2">What is AWS Lambda?</a><br> ∘ <a href="#0aec">What makes Lambda “serverless”?</a><br> ∘ <a href="#8d89">What triggers a Lambda function?</a><br>· <a href="#f343">Lambda vs EC2 — When to use what</a><br>· <a href="#e8d6">API Gateway — Your front door to the internet</a><br> ∘ <a href="#f07c">What API Gateway actually does</a><br> ∘ <a href="#1fb3">HTTP Basics — Methods, status codes &amp; how it all works</a><br> ∘ <a href="#92cd">HTTP Methods — The verbs of the web</a><br> ∘ <a href="#2df6">HTTP Status Codes — The response signals</a><br> ∘ <a href="#82d9">What a Lambda response looks like</a><br>· <a href="#aa7b">What is DynamoDB?</a><br> ∘ <a href="#3b35">The core concepts</a><br> ∘ <a href="#4ebb">What DynamoDB data actually looks like</a><br> ∘ <a href="#1002">DynamoDB vs RDS — The right tool for the job</a><br>· <a href="#33b1">Hands-On Part 1: Hello World Lambda + API Gateway</a><br> ∘ <a href="#cb6e">Step 1 — Create the Lambda Function</a><br> ∘ <a href="#32a4">Step 2 — Attach API Gateway</a><br>· <a href="#af76">Hands-On Part 2: Create your DynamoDB Table</a><br>· <a href="#c24c">Hands-On Part 3: Lambda writes to DynamoDB</a><br> ∘ <a href="#180b">Step 1 — Permit Lambda to access DynamoDB</a><br> ∘ <a href="#f5b1">Step 2 — Update the Lambda code</a><br> ∘ <a href="#f710">Step 3 — Test It</a><br>· <a href="#0652">Clean up when you’re done</a><br>· <a href="#b4fb">The Series Roadmap</a><br>· <a href="#0b9f">Conclusion — You just went serverless</a><br>· <a href="#a8b5">Bonus Resources</a></p><blockquote>📚 <strong>New here?</strong> This is Part 6 of the AWS for Beginners series. You’ll get more out of this post if you’ve read <a href="https://medium.com/@deepakcardoza/list/aws-for-beginners-series-simple-explanations-with-hands-on-d2734f86262d">Parts 1–5</a> — especially Part 4 (VPC) and Part 5 (RDS), since we’ll compare what we build here against those concepts. Catch up, then come back. I’ll wait. ☕</blockquote><p><a href="https://medium.com/@deepakcardoza/list/aws-for-beginners-series-simple-explanations-with-hands-on-d2734f86262d">List: AWS for Beginners Series (Simple Explanations with Hands On) | Curated by Deepak Cardoza | Medium</a></p><h3>What is AWS Lambda?</h3><p>Imagine you hired a plumber. Normally, hiring a plumber means giving him a desk in your office, paying him a salary, providing him a computer, and keeping him around 24/7 — even on days when no pipes burst. That’s EC2. You rent a server, keep it running, and pay for it every hour, whether anyone uses it or not.</p><blockquote><strong>💡 Real-World Analogy:</strong> Lambda is like <strong>calling a plumber <em>on demand</em></strong>. A pipe bursts → you call → the plumber arrives, fixes it, leaves, and you pay only for that visit. No pipe problem? No cost. He isn’t sitting in your office waiting. That’s exactly how Lambda works: your code runs only when triggered, and you’re billed only for the milliseconds it actually executes.</blockquote><p>AWS Lambda is a <strong>serverless compute service</strong>. You write a function — just code, not a server setup — and AWS handles everything else: the hardware, the operating system, scaling, patching, and availability. You never touch a server.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/974/1*gtic2itYfbTnAyqaMmvYow.png" /><figcaption>Benefits of Lambda</figcaption></figure><h4>What makes Lambda “serverless”?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*esWKdphlFxLInFzV.jpeg" /><figcaption>Thats what we think initially</figcaption></figure><p>The word “serverless” is a bit misleading — <strong>of course, there’s a server somewhere</strong>. What it really means is: <strong>the server is not your problem</strong>. You don’t provision it, don’t SSH into it, don’t install packages on the OS, don’t worry about it going down. AWS spins up a fresh container to run your function, runs it, then tears it down. Each invocation is isolated, stateless, and fully managed.</p><h4>What triggers a Lambda function?</h4><p>Lambda doesn’t run on its own — it runs in response to <strong>events</strong>. This is what makes it “event-driven.” An event can be almost anything in AWS:</p><p><strong>1. API Gateway — </strong>HTTP request hits your endpoint → Lambda runs</p><p><strong>2. S3 — </strong>File uploaded to a bucket → Lambda processes it</p><p><strong>3. EventBridge — </strong>Scheduled cron → Lambda runs at a set time</p><p><strong>4. DynamoDB Streams — </strong>Table record changes → Lambda reacts</p><p><strong>5. SQS / SNS — </strong>Message in a queue → Lambda processes it</p><p><strong>6. Cognito — </strong>User signs up → Lambda customises the flow</p><p>In this post, we’ll use <strong>API Gateway</strong> as our trigger — meaning someone makes an HTTP request to a URL, and our Lambda function runs in response. That’s the most common pattern for building web APIs with Lambda.</p><blockquote><strong>ℹ️ Supported Languages: </strong>Lambda natively supports Python, Node.js, Java, Go, Ruby, .NET, and even custom runtimes. In this post, we’ll <strong>use Python 3.12</strong> — it’s clean, beginner-friendly, and the most popular choice for Lambda functions.</blockquote><h3>Lambda vs EC2 — When to use what</h3><p>You’ve already launched EC2 instances and even hosted a web server on one (<a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-3-deep-dive-into-ec2-launch-an-amazon-linux-server-as-the-cloud-developer-338ebb00b58c">Part 3</a>, remember nginx?). So why would you ever use Lambda instead? Let’s be honest about both sides.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/888/1*oJwsXKDRN8tkM3vpG5-aCw.png" /><figcaption>EC2 Vs Lambda</figcaption></figure><blockquote><strong>💡 The mental model: </strong>Use EC2 when your app needs to <em>always be running</em> — a traditional web server, a database, a game backend. Use Lambda when something needs to <em>happen in response to an event</em> — a user submits a form, a file is uploaded, a schedule fires. If it’s “do this when X happens,” Lambda is almost always the right call.</blockquote><p><strong>💡 Real-World Analogy</strong></p><p>EC2 is like owning a restaurant — you pay for the building, staff, electricity, and equipment every single day, whether 10 customers come in or 1,000. Lambda is like being a food truck chef who’s on-call: a customer orders → you cook exactly that meal → you’re paid for that one meal. Quiet day? No cost. Festival weekend? You spin up automatically. The restaurant is better for a consistent high-volume crowd; the food truck is better for unpredictable or event-driven demand.</p><h3>API Gateway — Your front door to the internet</h3><p>Here’s a thought experiment. Your Lambda function exists inside AWS. By default, it has no public URL or web address. How does the outside world — your browser, a mobile app, or a third-party webhook — actually call it?</p><p>While AWS now allows you to generate a direct Lambda Function URL for simple HTTP setups, managing complex production traffic is a different story. That is exactly where <strong>Amazon API Gateway</strong> comes in.</p><blockquote>💡 Real-World Analogy</blockquote><blockquote>When you type www.google.com into your browser and press Enter, your browser sends an HTTP GET request to Google&#39;s servers. Google&#39;s servers receive it, run some logic, and send back an HTML page. That &quot;front door&quot; that receives your request and routes it to the right internal service? That&#39;s exactly what API Gateway does for your Lambda functions.</blockquote><blockquote>API Gateway gives your Lambda function a public HTTPS URL. When someone visits that URL (or calls it from code), API Gateway receives the request, passes it to your Lambda, gets the response back, and returns it to the caller. Your Lambda never needs a public IP — API Gateway handles all of that.</blockquote><h4>What API Gateway actually does</h4><ol><li><strong>Publishes a URL — </strong>Gives your Lambda function a real HTTPS endpoint that the internet can reach.</li></ol><p><strong>2. Routes Requests — </strong>Maps different paths &amp; methods (GET /users, POST /orders) to different Lambda functions.</p><p><strong>3. Auth &amp; Throttling — </strong>Can require API keys, JWT tokens, or IAM auth — and limit request rates.</p><p><strong>4. Passes the Event — </strong>Sends request body, headers, query params to Lambda as a structured event object.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/877/1*PQWqYqkmXLsNnCSoOyyhTA.png" /><figcaption>Request Flow — API Gateway &amp; Lambda</figcaption></figure><h4>HTTP Basics — Methods, status codes &amp; how it all works</h4><p>Every time you use the internet — loading a page, submitting a form, liking a post — your browser is speaking HTTP (HyperText Transfer Protocol). It’s the language of the web. And since API Gateway is an HTTP endpoint, your Lambda function will be on the receiving end of HTTP requests. So let’s demystify the basics quickly.</p><h4>HTTP Methods — The verbs of the web</h4><p>Every HTTP request has a <strong>method</strong> that describes what the caller wants to do. Think of them as actions:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*HizP_5M816axp8d81OcMTg.png" /><figcaption>HTTP Methods</figcaption></figure><blockquote><strong>🔍 Think of it like a filing cabinet: </strong>GET = open the drawer and look at a file. POST = put a new file in. PUT = replace an existing file entirely. PATCH = change one page inside the file. DELETE = throw the file away.</blockquote><h4>HTTP Status Codes — The response signals</h4><p>When a server responds to a request, it always includes a <strong>status code</strong> — a 3-digit number telling the caller what happened. You’ve definitely seen some of these before:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/881/1*qPCb0k9yKClN6VnF7uFL0g.png" /><figcaption>HTTP Status Codes</figcaption></figure><blockquote><strong>💡 Real-World Analogy</strong></blockquote><blockquote>Status codes are like knocking on a door and getting a response. <strong>200</strong> = “Come in!” <strong>404</strong> = “No one named that lives here.” <strong>403</strong> = “I know who you are, but you’re not allowed in.” <strong>500</strong> = “Something exploded in the kitchen, sorry.” The numbers are grouped: 2xx = success, 3xx = redirect, 4xx = your fault, 5xx = server’s fault.</blockquote><h4>What a Lambda response looks like</h4><p>When API Gateway calls your Lambda, it expects a specific JSON structure back. Your function must return a statusCode, optional headers, and a body. Like this:</p><pre>return {<br>    &quot;statusCode&quot;: 200,<br>    &quot;headers&quot;: {<br>        &quot;Content-Type&quot;: &quot;application/json&quot;<br>    },<br>    &quot;body&quot;: json.dumps({ &quot;message&quot;: &quot;Hello, World!&quot; })<br>}</pre><blockquote><strong>⚠️ Don’t forget json.dumps(): </strong>The body field must be a<strong> string</strong>, not a Python dict. Always wrap your response dict in json.dumps(). Forgetting this is the most common beginner mistake with Lambda + API Gateway.</blockquote><h3>What is DynamoDB?</h3><p>You’ve already built a MySQL database with RDS in <a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-5-aws-rds-launch-connect-your-first-mysql-database-2132c0699208">Part 5</a>. Tables, rows, SQL queries — the classic relational model. DynamoDB is a completely different animal. It’s AWS’s fully managed <strong>NoSQL database</strong>, and it’s built for scale, speed, and simplicity over structure.</p><p>💡 Real-World Analogy</p><p>RDS (MySQL) is like a perfectly organised spreadsheet with fixed columns — every row must have the same columns, and you query it with precise SQL. <strong>DynamoDB is like a stack of sticky notes</strong>. Every note (item) must have a name label (partition key), but beyond that, each note can have completely different content. One note might have 3 fields, the next might have 12. There’s no fixed schema — you decide what to put on each note.</p><h4>The core concepts</h4><p><strong>1. Table: </strong>Like a database table in RDS — but with no fixed columns. Just a collection of items.</p><p><strong>2. Item: </strong>A single record — like a row in SQL. But each item can have a completely different set of attributes.</p><p><strong>3. Partition Key: </strong>The unique ID for each item — required on every item. DynamoDB uses this to find records fast.</p><p><strong>4. Attribute: </strong>Any field on an item — like a column, but optional per item. Can be string, number, list, map, etc.</p><h4>What DynamoDB data actually looks like</h4><p>Forget SQL columns. Here’s a DynamoDB table called Users with a few items — notice how each item can have different fields:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*Ud7EN_zkFDW3gY0RMBVqYg.png" /><figcaption>DynamoDB Data</figcaption></figure><p>See how user_001 has no phone, user_002 has no plan, and user_003 has no email? In MySQL, those would all be NULL columns you still have to define. In DynamoDB, you simply don&#39;t add attributes you don&#39;t have — each item carries only what it needs.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/869/1*F13yKt1paipVAsKNSuHc-Q.png" /><figcaption>Benefits of DynamoDB</figcaption></figure><h4>DynamoDB vs RDS — The right tool for the job</h4><p>Now that you’ve used RDS (Part 5), this comparison will make a lot more sense. Neither is “better” — they solve different problems. Here’s an honest breakdown:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/868/1*oFx3-BosMrGCNu5uCCaaPA.png" /><figcaption>RDS (MySQL) Vs DynamoDB</figcaption></figure><blockquote><strong>💡 The golden rule: </strong>If your data has<strong> complex relationships </strong>between entities (orders have line items, users have roles, products have categories) → RDS is usually better. If your data <strong>is flat, high-volume, and needs single-digit millisecond access</strong>→ DynamoDB wins. Many real applications use <em>both</em> — RDS for the structured business data, DynamoDB for the high-speed operational data.</blockquote><p><strong>⚠️ Don’t Panic: </strong>DynamoDB’s “no joins” constraint sounds scary if you come from SQL. It just means you think about your data differently — you design your table around how you’ll query it, not around normalisation. For the hands-on in this post, it’s dead simple — don’t worry about it.</p><h3>Hands-On Part 1: Hello World Lambda + API Gateway</h3><p>Enough theory. Let’s build something. We’ll start simple: create a Lambda function, write a Hello World response, attach an API Gateway, and hit the live URL from your browser. The whole thing takes about 5 minutes.</p><blockquote><strong>ℹ️ Credit Activity Alert 🎉</strong>Creating a Lambda function is one of the 5 credit activities for new AWS accounts — you’ll earn<strong>+$20 in credits </strong>when you complete this step. See Part 2 for the full free tier overview.</blockquote><h4>Step 1 — Create the Lambda Function</h4><p><strong>1. Open Lambda in the Console</strong></p><ul><li>Log in to the AWS Console. In the top search bar, type Lambda and click the service. Make sure you&#39;re in ap-south-1 (Mumbai) — same region we&#39;ve used throughout this series.</li><li>If you see &quot;Functions&quot; in the left panel, you&#39;re in the right place.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3L_aM26bDFpBXIz09wsSPg.png" /><figcaption>AWS Console -&gt; Lambda -&gt; Functions Tab</figcaption></figure><p><strong>2. Click “Create function”</strong></p><ul><li>Hit the orange Create function button in the top right. Choose Author from scratch the first option.</li></ul><p><strong>3. Fill in the Basic Settings</strong></p><ul><li>Set the following:</li></ul><pre>Lambda Configuration<br>Function name:  hello-world-function<br>Runtime:         Python 3.14<br>Architecture:    x86_64 (default)<br>Permissions:     Create a new role with basic Lambda permissions (default)</pre><ul><li>Leave everything else as default. Click Create function.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*29ADD73whttdKaMVDWZx5w.png" /><figcaption>Fill Details and click Create Function</figcaption></figure><p><strong>4. Write the Hello World Code</strong></p><ul><li>Once the function is created, scroll down to the Code source section. You&#39;ll see a file called lambda_function.py already open. Replace everything in it with this:</li></ul><pre>import json<br>def lambda_handler(event, context):<br>    # Every Lambda function starts with lambda_handler<br>    # &#39;event&#39; contains the incoming request data<br>    # &#39;context&#39; has runtime info (function name, timeout, etc.)<br>    return {<br>        &quot;statusCode&quot;: 200,<br>        &quot;headers&quot;: {<br>            &quot;Content-Type&quot;: &quot;application/json&quot;<br>        },<br>        &quot;body&quot;: json.dumps({<br>            &quot;message&quot;: &quot;Hello from Lambda! 🚀&quot;,<br>            &quot;status&quot;: &quot;success&quot;<br>        })<br>    }</pre><ul><li>After pasting, click Deploy (the button above the code editor). You&#39;ll see &quot;Changes deployed&quot; — your code is now live.</li><li>⚠️ Don’t forget to click Deploy after every code change — otherwise, Lambda is still running the old version.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HqkFqRBXRG7KYDzCvHh4gw.png" /><figcaption>Fill the code and click Deploy</figcaption></figure><p><strong>5. Test It Directly in the Console</strong></p><ul><li>Click the Test tab. Click Create new event. Name ittest-event, leave the JSON body as the default{}, and click Save. Then hit the Test button.</li><li>You should see a green &quot;Execution result: succeeded&quot; box with this in the response:</li></ul><pre>{<br>  &quot;statusCode&quot;: 200,<br>  &quot;headers&quot;: {<br>    &quot;Content-Type&quot;: &quot;application/json&quot;<br>  },<br>  &quot;body&quot;: &quot;{\&quot;message\&quot;: \&quot;Hello from Lambda! 🚀\&quot;, \&quot;status\&quot;: \&quot;success\&quot;}&quot;<br>}</pre><ul><li>Your Lambda function works! But it has no public URL yet — that’s what API Gateway adds.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*c4qP82YNPYcc0hQ-VK1Uew.png" /><figcaption>Test Lambda Function</figcaption></figure><h4>Step 2 — Attach API Gateway</h4><p><strong>1. Add a Trigger</strong></p><ul><li>In the Lambda function page, click the Configuration tab, then Triggers In the left menu, or a Button named “Add Trigger” in the UI of Function Overview. Click Add trigger.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ynGqOTOiZBy8bnuKzAoG1w.png" /></figure><ul><li>In the trigger configuration:</li></ul><pre>API Gateway Trigger Settings<br><br>Trigger source:   API Gateway<br>API type:         HTTP API<br>Security:         Open (no auth - fine for learning)<br>CORS:             Enable</pre><ul><li>Click Add.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NWg8h8-V-SB40WkkDATbtQ.png" /><figcaption>Adding an API Gateway Trigger to Lambda Function</figcaption></figure><ul><li>AWS will create the API Gateway, link it to your Lambda, and generate a public URL — all automatically. You can verify this as shown below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VowEbpjTNEz25-hQrQLuOg.png" /><figcaption>Trigger Added</figcaption></figure><p><strong>2. Copy Your Live API URL</strong></p><ul><li>After adding the trigger, go to Configuration → Triggers. You&#39;ll see the API Gateway listed with an API endpoint URL — something like:</li></ul><pre>https://abc123xyz.execute-api.ap-south-1.amazonaws.com/default/hello-world-function</pre><ul><li>Copy that URL and paste it into your browser. Press Enter.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*p4t_RQxHl9mlKQa5NUxENg.png" /><figcaption>API Gateway Result</figcaption></figure><ul><li>You should see the JSON response right in your browser:</li></ul><pre>{<br>  &quot;message&quot;: &quot;Hello from Lambda! 🚀&quot;,<br>  &quot;status&quot;: &quot;success&quot;<br>}</pre><blockquote><strong>💡 What just happened? — </strong>You typed a URL in your browser → your browser sent a GET request → API Gateway received it → triggered your Lambda → Lambda ran your Python code → returned JSON → API Gateway forwarded it back → your browser displayed it. A complete serverless request cycle in milliseconds. No EC2, no SSH, no nginx — just your code and AWS.</blockquote><h3>Hands-On Part 2: Create your DynamoDB Table</h3><p>Now let’s create the DynamoDB table that our Lambda will write to. We’ll call it Visitors — it&#39;ll store a visitor record every time someone hits our API.</p><p><strong>1. Open DynamoDB in the Console</strong></p><ul><li>Search for DynamoDB in the top bar. Click the service. In the left menu, click Tables.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S0XtSAgAd7Ge3xzbWcFqJw.png" /><figcaption>DynamoDB -&gt; Tables</figcaption></figure><p><strong>2. Create a Table</strong></p><ul><li>Click Create table. Fill in:</li></ul><pre>DynamoDB Table Settings<br>Table name:          Visitors<br>Partition key:       visitor_id   (Type: String)<br>Sort key:            Leave blank - not needed<br>Table settings:      Default settings<br>                     (uses On-demand capacity - pay per request)</pre><ul><li>Click Create table. It&#39;ll take about 30 seconds to become Active.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e30gRBvBuS5A_RZZOpnsBA.png" /><figcaption>Fill these and click Create Table</figcaption></figure><ul><li>When the Status shows &quot;Active&quot; with a green badge, your table is ready.</li><li>⚠️ On-demand capacity means you’re billed per read/write operation — not per hour. For our low-volume testing, this costs essentially nothing and requires no capacity planning.</li></ul><h3>Hands-On Part 3: Lambda writes to DynamoDB</h3><p>Now the exciting part. We’ll give our Lambda function permission to write to DynamoDB, then update the code to insert a record every time the API is called. Hit the URL → a new item appears in the table. Let’s wire it up.</p><h4>Step 1 — Permit Lambda to access DynamoDB</h4><p>By default, your Lambda function has no permission to touch DynamoDB. AWS uses <strong>IAM roles</strong> to control what services can access what. Your Lambda already has a role (created automatically when you made the function). We just need to attach a DynamoDB policy to it.</p><p><strong>1. Open the Lambda IAM Role</strong></p><ul><li>Go back to your Lambda function. Click the Configuration tab → Permissions in the left menu. UnderExecution role, click the role name link — it&#39;ll look like hello-world-function-role-xxxxxxxx. This opens IAM in a new tab.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_SsI-ijL6-fT4rZzGg-moA.png" /><figcaption>Lambda Function -&gt; Configuration -&gt; Permissions -&gt; Click on IAM Role hyperlink</figcaption></figure><p><strong>2. Add a DynamoDB Policy</strong></p><ul><li>In IAM, click Add permissions → Attach policies. In the search box, type AmazonDynamoDBFullAccess. Check the box next to it and click Add permissions.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5mD-LC58Wmdt6IHY8PPtzg.png" /><figcaption>Opens up IAM Role -&gt; Add Permissions -&gt; Attach Policies</figcaption></figure><ul><li>Your Lambda can now read and write to any DynamoDB table in this account.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7pv0Bc7vlcxnGZY4-hnhRA.png" /><figcaption>Select AmazonDynamoDBFullAccess</figcaption></figure><ul><li>⚠️ FullAccess is fine for learning — in production, you’d scope this down to just the specific table and only the operations needed (PutItem, GetItem, etc.). But for this tutorial, FullAccess keeps things simple.</li></ul><h4>Step 2 — Update the Lambda code</h4><p><strong>1. Replace the Function Code</strong></p><ul><li>Go back to your Lambda function. Click the Code tab. Replace everything in lambda_function.py with this:</li></ul><pre>import json<br>import boto3<br>import uuid<br>from datetime import datetime<br><br># boto3 is the AWS SDK for Python - it&#39;s pre-installed in Lambda<br># It lets us talk to any AWS service (DynamoDB, S3, SES, etc.) from code<br># Create a DynamoDB resource - this is our connection to the service<br><br>dynamodb = boto3.resource(&#39;dynamodb&#39;)<br><br># Point to our specific table<br>table = dynamodb.Table(&#39;Visitors&#39;)<br><br># Lambda Handler<br>def lambda_handler(event, context):<br>    # Generate a unique ID for this visitor using UUID<br>    visitor_id = str(uuid.uuid4())<br><br>    # Get the current timestamp<br>    timestamp = datetime.utcnow().isoformat()<br><br>    # The item we want to insert into DynamoDB<br>    # This is hardcoded for now - we&#39;ll make it dynamic in the final project<br>    item = {<br>        &#39;visitor_id&#39;: visitor_id,       # Partition key - must match table config<br>        &#39;name&#39;:       &#39;Deepak&#39;,         # Hardcoded for now<br>        &#39;city&#39;:       &#39;Mangaluru&#39;,      # Hardcoded for now<br>        &#39;visited_at&#39;: timestamp         # Auto-generated timestamp<br>    }<br><br>    # PutItem inserts (or replaces) an item in DynamoDB<br>    table.put_item(Item=item)<br><br>    # Return a success response to API Gateway<br>    return {<br>        &#39;statusCode&#39;: 201,             # 201 = Created<br>        &#39;headers&#39;: {<br>            &#39;Content-Type&#39;: &#39;application/json&#39;<br>        },<br>        &#39;body&#39;: json.dumps({<br>            &#39;message&#39;: &#39;Visitor recorded!&#39;,<br>            &#39;visitor_id&#39;: visitor_id,<br>            &#39;timestamp&#39;: timestamp<br>        })<br>    }</pre><ul><li>Click Deploy to save and publish the new version.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_n6JaeAMedbZrxZfP7Q9g.png" /><figcaption>Paste the code and click Deploy</figcaption></figure><h4>Step 3 — Test It</h4><p><strong>4. Hit the API URL in Your Browser</strong></p><ul><li>Go back to your API Gateway URL (from <a href="#32a4">this section</a> in Part 1 of the hands-on). Paste it in the browser and hit Enter. You should see:</li></ul><pre>{<br>  &quot;message&quot;: &quot;Visitor recorded! ✅&quot;,<br>  &quot;visitor_id&quot;: &quot;f47ac10b-58cc-4372-a567-0e02b2c3d479&quot;,<br>  &quot;timestamp&quot;: &quot;2025-08-15T10:23:41.123456&quot;<br>}</pre><ul><li>Every time you refresh the page, a new visitor_id is generated, and a new record is inserted into DynamoDB.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/999/1*Nd_DahwsdkOKra9HN76uZw.png" /><figcaption>API Gateway Visitor Capture Output</figcaption></figure><p><strong>5. View the Data in DynamoDB Console</strong></p><ul><li>Go to the DynamoDB console → Tables → Visitors. Click Explore table items in the top right. You&#39;ll see all the records your Lambda inserted — one for every time you hit the URL.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zp9xOiLA4dRK4ATPBAlxCw.png" /><figcaption>DynamoDB -&gt; Tables -&gt; Visitors Table -&gt; Explore Table Items</figcaption></figure><ul><li>Hit the API URL a few times from different browser tabs, then refresh the DynamoDB view — you’ll see multiple items, each with a unique visitor_id and a timestamp. That&#39;s your serverless backend recording data, live.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6IlvPO2ZIOMql9ugbBUVfQ.png" /><figcaption>View the table data here</figcaption></figure><blockquote><strong>💡 What you just built — </strong>A real serverless backend. Browser hits URL → API Gateway receives the HTTP request → triggers Lambda → Python code runs → boto3 writes to DynamoDB → JSON response returns to browser. No EC2, no RDS, no SSH, no nginx. The entire stack is serverless and event-driven — and it scales to millions of requests automatically with zero changes.</blockquote><h3>Clean up when you’re done</h3><p>Lambda itself is free for the first 1 million requests per month (always free), and the DynamoDB free tier always covers 25 GB. But it’s still good practice to clean up after learning:</p><ol><li><strong>Delete the Lambda function:</strong> Lambda → Functions → hello-world-function → Actions → Delete</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zZa8mBJv9O8VDozprXqMbg.png" /><figcaption>Deleting Lambda Function</figcaption></figure><p><strong>2. Delete the API Gateway:</strong> API Gateway → APIs → your-api → Actions → Delete</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SY7RQBfD-7I3IFvjEqT24w.png" /><figcaption>Delete API Gateway API</figcaption></figure><p><strong>3. Delete the DynamoDB table:</strong> DynamoDB → Tables → Visitors → Delete table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ob6mC0JjUxUQ9cpL1txZnQ.png" /><figcaption>Deleting DynamoDB Table</figcaption></figure><p><strong>4. Clean up the IAM role:</strong> Lambda created IAM → Roles → search “hello-world-function-role” → Delete</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yoRC-SAXkV63Guh0obdQ_g.png" /><figcaption>Deleting IAM Role</figcaption></figure><h3>The Series Roadmap</h3><p>You’ve now completed the core building blocks of AWS. Here’s where we stand:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*2pcNQ-PUWsRLuyXjotmZDQ.png" /><figcaption>The Roadmap</figcaption></figure><p><strong>ℹ️ Coming up in Part 7 — </strong>We’ve been clicking around the console — and that’s perfect for learning what each service does. But real cloud deployments use,</p><p><strong>Infrastructure as Code (IaC)</strong>: defining your entire stack in code files that can be versioned, repeated, and automated. In Part 7, we’ll cover CloudFormation, the Serverless Framework, and deploy a mini stack entirely from the command line — no console clicks needed.</p><h3>Conclusion — You just went serverless</h3><p>You now understand event-driven architecture — not just as a buzzword, but as a pattern you’ve actually built. A browser makes a request, an event fires, code runs, and data is stored. No servers babysitting, no EC2 instances idling at ₹3 per hour doing nothing, no SSH sessions to maintain.</p><p>Lambda, API Gateway, and DynamoDB are the three pillars of serverless on AWS. Each one is independently powerful — together, they’re the fastest way to ship a working backend that scales on its own.</p><blockquote><em>“The best server is the one you don’t have to think about. Write the function, describe the event, and let AWS worry about the rest — your only job is the logic that matters.”</em></blockquote><h3><strong>Bonus Resources</strong></h3><ul><li><a href="https://docs.aws.amazon.com/lambda/latest/dg/welcome.html?utm_source=chatgpt.com">AWS Lambda Developer Guide</a> — Official docs covering handler patterns, layers, environment variables, and deployment packages.</li><li><a href="https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Introduction.html?utm_source=chatgpt.com">DynamoDB Developer Guide</a> — Core concepts, data modelling best practices, Global Secondary Indexes, and DynamoDB Streams.</li><li><a href="https://boto3.amazonaws.com/v1/documentation/api/latest/index.html?utm_source=chatgpt.com">boto3 Documentation</a> — Full reference for the AWS Python SDK — every service, every method, with examples.</li><li><a href="https://serverlessland.com/?utm_source=chatgpt.com">AWS Serverless Land</a> — AWS’s own collection of serverless patterns, reference architectures, and workshop labs.</li><li><a href="https://www.alexdebrie.com/posts/dynamodb-filter-expressions/?utm_source=chatgpt.com">DynamoDB — The 17 Ways to Query</a> — Alex DeBrie’s famous guide on DynamoDB data modelling — essential reading before you go beyond basics.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=94c9a9a4868c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS for Beginners (Part 5): AWS RDS — Launch & Connect Your First MySQL Database]]></title>
            <link>https://medium.com/@deepakcardoza/aws-for-beginners-part-5-aws-rds-launch-connect-your-first-mysql-database-2132c0699208?source=rss-cbfe363f8f26------2</link>
            <guid isPermaLink="false">https://medium.com/p/2132c0699208</guid>
            <category><![CDATA[aws-rds]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Deepak Cardoza]]></dc:creator>
            <pubDate>Tue, 19 May 2026 07:38:27 GMT</pubDate>
            <atom:updated>2026-05-19T07:38:27.097Z</atom:updated>
            <content:encoded><![CDATA[<p>Stop managing databases yourself. Let AWS handle the backups, patches, and availability — while you focus on running real queries on a live cloud database.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GMO-z16HosFlInXOYxewWA.jpeg" /></figure><p>In <a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-4-vpc-networking-your-private-corner-of-the-cloud-%EF%B8%8F-2044182b9755">Part 4</a>, we built our own VPC with a public and a private subnet. We talked about how databases should always live in a private subnet — shielded from the internet — while only your app servers sit in the public zone. Today, we make that real.</p><p>We’re launching a <strong>MySQL database on Amazon RDS</strong> — AWS’s fully managed relational database service. We’ll put it in the private subnet from our VPC, connect to it from an EC2 instance, and run actual SQL queries on it. By the end, you’ll have a live cloud database responding to your commands.</p><p>No installing MySQL. No configuring storage. No worrying about backups. AWS handles all of that. Your job is just to design the schema and write the queries. Let’s go. 🚀</p><h3>Table of Contents</h3><p>· <a href="#83d3">What is Amazon RDS?</a><br>· <a href="#cebf">RDS vs Installing MySQL on EC2 — Why Managed Wins</a><br>· <a href="#8d12">Key Settings Before You Launch</a><br> ∘ <a href="#be6a">DB Instance Class — Your Database’s Power</a><br> ∘ <a href="#34d4">Storage Type — gp2 vs gp3</a><br> ∘ <a href="#f11e">Multi-AZ Deployment</a><br> ∘ <a href="#241c">Public Access</a><br> ∘ <a href="#f93d">Automated Backups</a><br>· <a href="#63c9">Free Tier — What’s Covered</a><br>· <a href="#afa0">The Architecture — Where RDS Sits</a><br>· <a href="#6fe7">Launch Your MySQL RDS Instance</a><br>· <a href="#d03c">Connect to RDS from Your EC2 Instance</a><br>· <a href="#ffc7">Run Real SQL Queries 📝</a><br>· <a href="#88db">MySQL Workbench — A GUI Alternative</a><br>· <a href="#6754">Delete Your RDS Instance — Do It Properly</a><br>· <a href="#6478">What’s Next? 🗺️</a><br>· <a href="#975c">Conclusion</a><br>· <a href="#f213">Bonus Resources</a></p><h3>What is Amazon RDS?</h3><p>RDS stands for <strong>Relational Database Service</strong>. It’s AWS’s managed service for running SQL databases in the cloud. You tell AWS what database engine you want, how big the instance should be, and how much storage, and AWS spins it up, configures it, patches it, backs it up, and monitors it automatically.</p><blockquote><strong>💡 Real-World Analogy</strong></blockquote><blockquote>Imagine you need a professional kitchen to run your restaurant. You could rent a building, buy all the equipment, install it, maintain it, fix it when it breaks, and deep-clean it every week — that’s self-managed MySQL on EC2. Or you could rent a fully equipped, professionally maintained commercial kitchen where everything is already set up, serviced, and ready to cook in — that’s RDS. The same food comes out either way, but one option means you can focus entirely on cooking.</blockquote><p>RDS supports several database engines — you’re not locked to just one:</p><ul><li><strong>MySQL</strong><br>The world’s most popular open-source database. What we’re using today. Great for web apps, beginner-friendly, huge community.</li><li><strong>PostgreSQL</strong><br>More powerful and standards-compliant than MySQL. Popular with developers for complex data types and advanced queries.</li><li><strong>MariaDB</strong><br>A MySQL-compatible open-source fork. Drop-in replacement for MySQL with some extra features.</li><li><strong>SQL Server / Oracle</strong><br>Enterprise-grade options for organizations already using Microsoft or Oracle. Paid licensing applies.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*b5g51zOBy2QVq4KrSED-tA.png" /></figure><blockquote><strong>🆓 RDS &amp; the New AWS Free Tier (July 2025 onwards): </strong>RDS has moved to the same credit-based model as all other AWS services for new accounts. If you created your account <strong>after July 15, 2025</strong>, you <strong>get $100 in credits on sign-up </strong>and can earn up to <strong>$100 more </strong>by completing 5 onboarding activities — one of which is launching an RDS database (worth +$20). Your credits cover RDS usage on db.t3.micro or db.t4g.micro for MySQL, PostgreSQL, MariaDB, and SQL Server Express. Credits are valid for<strong> 6 months </strong>or until exhausted. For accounts <strong>created before July 15, 2025</strong>, the legacy 12-month free tier still applies: 750 hours/month db.t3.micro at no charge.</blockquote><h3>RDS vs Installing MySQL on EC2 — Why Managed Wins</h3><p>A common beginner question is: “Why not just install MySQL on an EC2 instance? I know how to do that.” It’s a fair question. The answer is all about what you want to spend your time on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/971/1*tKHgr8hV3Oe3vY_mj9JXvw.png" /><figcaption>RDS vs Installing MySQL on EC2 — Why Managed Wins</figcaption></figure><blockquote><strong>💡 When Would You Install MySQL on EC2? </strong>The only real reason to self-manage MySQL on EC2 is if you need deep OS-level control — custom storage configurations, specific kernel settings, or a MySQL plugin that RDS doesn’t support. For 99% of applications, RDS is the right choice. It lets you focus on your application instead of database infrastructure.</blockquote><h3>Key Settings Before You Launch</h3><p>The RDS launch wizard has a lot of options. Most of them have sensible defaults — but a few are important to understand before you click through them blindly. Let’s walk through the ones that matter for a beginner.</p><h4>DB Instance Class — Your Database’s Power</h4><p>Just like EC2 instance types, RDS has instance classes that define CPU and RAM. For free tier and learning, always choose db.t3.micro — 2 vCPU, 1 GB RAM, and free tier eligible.</p><h4>Storage Type — gp2 vs gp3</h4><p>RDS uses EBS storage underneath. You’ll see two options: gp2 (older, simple) and gp3 (newer, faster, cheaper). Choose <strong>gp2</strong> for the free tier — it&#39;s explicitly listed in the free tier terms. Set storage to <strong>20 GB,</strong> which is the free tier maximum.</p><h4>Multi-AZ Deployment</h4><p>Multi-AZ creates a standby replica of your database in a different Availability Zone. If your primary database fails, AWS automatically fails over to the standby — zero downtime. This is essential for production, but <strong>doubles the cost</strong>. For learning, always keep this <strong>disabled</strong>.</p><h4>Public Access</h4><p>This setting determines whether your RDS instance gets a public IP. For our setup, we’re putting RDS in a private subnet — so we’ll set this to <strong>No</strong>. The only way to reach it is from inside the VPC (via our EC2 instance). This is exactly how it should be in real production.</p><h4>Automated Backups</h4><p>RDS can automatically back up your database every day and keep the snapshots for a configurable number of days (1–35). The default is 7 days. For the free tier, the backup storage is free as long as it doesn’t exceed your database size. Leave this enabled — it’s a core RDS benefit.</p><p>Here’s a summary of all the key settings we’ll use in the hands-on:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*c0QlN6N3gmDPuqJKYQ_5Dg.png" /><figcaption>Summary of Key Settings on RDS</figcaption></figure><h3>Free Tier — What’s Covered</h3><p>RDS is covered by the new AWS credit-based model for accounts created after July 15, 2025. Here’s exactly what that means in practice — what you get, what earns you credits, and what to watch out for.</p><ul><li><strong>$100 Credit on Sign-Up</strong><br>Every new account (post July 2025) gets $100 in credits automatically. These cover RDS usage, EC2, S3 — any eligible service — from day one.</li><li><strong>+$20 for Launching RDS</strong><br>Configuring and launching an RDS database is one of the 5 onboarding activities. Complete it and +$20 lands in your credits balance within ~10 minutes.</li><li><strong>db.t3.micro &amp; db.t4g.micro</strong><br>RDS on Free Plan supports micro instances for MySQL, PostgreSQL, MariaDB, and SQL Server Express. These are the cheapest instances, and your credits cover them comfortably.</li><li><strong>20 GB gp2 Storage</strong><br>Up to 20 GB of General Purpose SSD storage. We’ll use exactly this in our setup — well within what your credits can cover.</li><li><strong>Credits Last 6 Months</strong><br>Unlike the old 12-month model, credits expire after 6 months or when exhausted. Running RDS 24/7 alongside EC2 burns credits faster — terminate when not in use.</li><li><strong>Multi-AZ Doubles Cost</strong><br>Multi-AZ creates a standby replica — useful in production, but doubles your RDS cost immediately. Always disable this for learning. Never enable it accidentally.</li><li><strong>Storage Auto-Scaling</strong><br>If you leave storage autoscaling on and somehow exceed 20 GB, AWS expands silently and charges ~$0.115/GB/month beyond the limit. Disable it.</li><li><strong>Legacy Accounts (Pre-July 2025)</strong><br>If your account was created before July 15, 2025, you’re on the old model: 750 hours/month of db.t3.micro free for 12 months from account creation. Nothing changed for you.</li><li><strong>Data Transfer — Same AZ is Free</strong><br>Data transfer between RDS and EC2 in the same Availability Zone is free. Across AZ costs $0.01/GB. Always place your EC2 and RDS in the same AZ while learning.</li></ul><blockquote><strong>💡 Pro Tip — Disable Storage Auto-Scaling: </strong>When launching RDS, you’ll see an option for “Enable storage autoscaling” — it expands your storage automatically if you start running out. While useful in production, leave this<strong> disabled </strong>for learning. If your test data somehow fills 20 GB (it won’t), you want to be in control of that decision, not have AWS silently expand it and start consuming your credits.</blockquote><h3>The Architecture — Where RDS Sits</h3><p>Before we start clicking, let’s understand the full picture of what we’re building. This is where everything from Parts 2, 3, and 4 comes together for the first time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*CZeLo4SWKSEhsaroxiM6kA.png" /><figcaption>The Architecture</figcaption></figure><p>Notice that your laptop never talks to RDS directly. You SSH into the EC2 instance first — that’s your <strong>jump box</strong> (or bastion host, in professional terms). From inside EC2, you then connect to RDS on its private IP over port 3306. The database never needs a public IP, and nobody on the internet can reach it directly. This is the correct, secure pattern for every production database.</p><blockquote><strong>💡What’s a Jump Box / Bastion Host? </strong>A bastion host is a server that sits in your public subnet and acts as the single, hardened entry point into your private network. You connect to the bastion (your EC2) over SSH, and from there you can reach private resources like RDS. It’s a standard security pattern — expose only one door to the internet, and everything else stays hidden behind it.</blockquote><h3>Launch Your MySQL RDS Instance</h3><p>Before we start, make sure you have the VPC from Part 4 ready — with a public and a private subnet. If you don’t have it yet, go back to <a href="#">Part 4</a> and create it first. It takes about 5 minutes.</p><h4>Step 1 — Create a DB Subnet Group</h4><p>RDS needs to know which subnets it can use. A <strong>DB Subnet Group</strong> is a collection of subnets across <strong>at least 2 Availability Zones</strong> that RDS can place your database instance in. AWS enforces this as a hard requirement — even on a single-AZ setup — because RDS needs the option to restore or recover your database in another AZ if needed. We need to create this before launching the database.</p><blockquote><em>💡 </em><strong><em>Using the Default VPC instead?</em></strong><em> If you skipped Part 4 and haven’t created a custom VPC, you can use the </em><strong><em>default VPC</em></strong><em> here instead of </em><em>my-first-vpc. The default VPC already has subnets in all Availability Zones, so you can skip the subnet creation step below and go straight to creating the subnet group — just select the default VPC and pick any 2 of its subnets.</em></blockquote><p>1. Add a Second Private Subnet in ap-south-1b (Custom VPC users only)</p><blockquote><em>📌 </em><strong><em>Why this step exists — a note from Part 4 — </em></strong><em>In Part 4, when we created </em><em>my-first-vpc using the VPC Wizard, we set the number of Availability Zones to </em><strong><em>1</em></strong><em> to keep things simple. That means our VPC only has subnets in </em><strong><em>ap-south-1a</em></strong><em> — nothing was created in ap-south-1b. RDS requires subnets in at least 2 AZs, so we need to add one more private subnet now before creating the subnet group.</em></blockquote><ul><li>In the AWS Console, go to <strong>VPC → Subnets → Create subnet</strong></li><li>Fill in the following:</li><li><strong>VPC:</strong> my-first-vpc</li><li><strong>Subnet name:</strong> my-first-vpc-subnet-private2-ap-south-1b</li><li><strong>Availability Zone:</strong> ap-south-1b</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q5Jee_RatA89kCZUCuWH0w.png" /><figcaption>Creating Private Subnet in Custom VPC</figcaption></figure><ul><li><strong>IPv4 CIDR block:</strong> 10.0.192.0/20 <em>(This range doesn&#39;t overlap your existing subnets)</em></li><li>Click <strong>Create subnet</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yApyDUi1qiQXokiHXSUoag.png" /><figcaption>Subnet Settings</figcaption></figure><blockquote><em>✅ You now have a private subnet in both ap-south-1a and ap-south-1b. You can verify this in VPC Resource Map Section. Your VPC is now ready for the subnet group requirement.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jUurmIX8fdACKrTzUHU9dA.png" /><figcaption>VPC Resource Map</figcaption></figure><p>2. Go to the RDS Console</p><ul><li>In the AWS Console, search for <strong>RDS</strong> and click it. You’ll land on the RDS Dashboard.</li></ul><p>3. Create the DB Subnet Group</p><ul><li>In the RDS left sidebar, click <strong>“Subnet groups”</strong> → <strong>“Create DB subnet group”</strong></li><li>Fill in:</li><li><strong>Name:</strong> my-db-subnet-group</li><li><strong>Description:</strong> Private subnets for RDS</li><li><strong>VPC:</strong> my-first-vpc <em>(or &quot;default&quot; if you&#39;re using the default VPC)</em></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l8hFa9sL24D9MRkF6JBLPA.png" /><figcaption>Creating RDS DB Subnet Group</figcaption></figure><ul><li>Under <strong>“Add subnets”</strong>:</li><li>Select <strong>both</strong> ap-south-1a and ap-south-1b as your Availability Zones</li><li>For each AZ, select the <strong>private subnet</strong> (names starting with private — not the public ones)</li><li>You should see both private subnets listed in the table below before clicking Create</li><li>Click <strong>“Create”</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CBCqdUrUJZ1Rs4lRA_W91Q.png" /><figcaption>Subnet Configurations for Subnet Group</figcaption></figure><blockquote><em>✅ You’ll see your new subnet group listed. RDS will use this to decide where to place your database instance.</em></blockquote><h4>Step 2 — Create the RDS Security Group</h4><p>We need a Security Group for our RDS instance that allows MySQL traffic (port 3306) — but <em>only</em> from our EC2 instance, not from anywhere else. In case you don&#39;t have your EC2 or you have terminated it, launch an EC2 quickly. Refer to the blog below for more details.</p><p><a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-3-deep-dive-into-ec2-launch-an-amazon-linux-server-as-the-cloud-developer-338ebb00b58c">AWS for Beginners (Part 3): Deep Dive into EC2—Launch an Amazon Linux Server as the Cloud Developer</a></p><p>If you are using a Custom VPC, then make sure to launch an EC2 Instance in that specific custom VPC itself, as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VT-5UaqXGl6RgUBr2QuntQ.png" /><figcaption>Network Settings when launching EC2 inside Custom VPC</figcaption></figure><p><strong>3. Go to EC2 → Security Groups</strong></p><ul><li>In the AWS Console, go to EC2 → Security Groups (in the left sidebar under Network &amp; Security). Click “Create security group”.</li></ul><p><strong>4. Configure the RDS Security Group</strong></p><ul><li>Name: rds-mysql-sg</li><li>Description: Allow MySQL access from EC2 only</li><li>VPC: my-first-vpc</li><li>Under Inbound rules, click “Add rule”:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/906/1*tox-AruwEtS9J2x1VupIOw.png" /><figcaption>RDS Security Group Rule</figcaption></figure><blockquote>💡 For “Source”, instead of typing an IP, select the <strong>Security Group ID of your EC2 instance</strong>. This means only resources in that security group can connect — not even other VPC resources, let alone the internet.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Kc3qZ5lsMsYavAHTSHXZpg.png" /><figcaption>Security Group for RDS MySQL DB</figcaption></figure><p><strong>5. Go to RDS → Create Database</strong></p><ul><li>Back in the RDS console, click the orange “Create database” and then the “Full Configuration” button on the dashboard.</li></ul><p><strong>6. Choose Standard Create + MySQL</strong></p><ul><li>Under “Choose a database creation method,” select <strong>Standard create</strong>. Under “Engine options,” select <strong>MySQL</strong>. For the version, leave the default — it’ll be MySQL 8.x.</li><li>Do NOT choose “Easy Create” — it hides the VPC and subnet settings we need to configure.</li></ul><p><strong>7. Select the Free Tier Template</strong></p><ul><li>Under “Templates”, select <strong>Sandbox</strong> or <strong>Free tier</strong>. This automatically greys out Multi-AZ and adjusts settings to stay within free tier limits. Very helpful.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2kwEHY209Um-VliVwVtq0Q.png" /><figcaption>Create RDS DB</figcaption></figure><p><strong>8. Set DB Instance Identifier &amp; Credentials</strong></p><ul><li>DB instance identifier: my-mysql-db</li><li>Master username: admin</li><li>Master password: Choose something strong — at least 12 characters with mixed case, numbers, and symbols. Write it down somewhere safe.</li><li>⚠️ This is the root-level admin password for your database. AWS will not email it to you or let you recover it if lost. Store it securely — in a password manager, ideally.</li><li>To make it easier, you can choose the “Auto-Generate Password” option too.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8qyW_V2Q8YbZ7Ufjnge09g.png" /><figcaption>DB Configurations</figcaption></figure><p><strong>9. Instance Configuration</strong></p><ul><li>Under “DB instance class” — make sure it says db.t3.micro (or db.t2.micro). Both are free-tier eligible.</li></ul><p><strong>10. Storage Settings</strong></p><ul><li>Storage type: gp2</li><li>Allocated storage: 20 GB</li><li>Enable storage autoscaling: Uncheck this</li><li>Unchecking storage autoscaling keeps you in full control and prevents unexpected charges.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZL6voduJEHL-L5FMKGqkaA.png" /><figcaption>DB Configurations</figcaption></figure><p><strong>11. Connectivity Settings</strong></p><ul><li>VPC: my-first-vpc</li><li>DB Subnet group: my-db-subnet-group</li><li>Public access: No</li><li>VPC security group: Remove the default, add rds-mysql-sg</li><li>💡 “Public access: No” means RDS won’t get a public IP. It can only be reached from within the VPC — exactly what we want.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PvGKg6HguqBBVVH5MXzeIQ.png" /><figcaption>DB Configurations</figcaption></figure><p><strong>12. Additional Configuration — Set Initial DB Name</strong></p><ul><li>Scroll down to “Additional configuration” and expand it. Under “Initial database name”, type appdb. This creates a default database inside MySQL, so you don&#39;t have to run CREATE DATABASE manually first.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CDTJgeSyxa9q-9EHU_2x-w.png" /><figcaption>DB Configurations</figcaption></figure><p><strong>13. Create Database!</strong></p><ul><li>Scroll to the bottom and click the orange “Create database” button. RDS will start provisioning — this takes 5–10 minutes. You’ll see the status as “Creating”, then “Backing up”, then finally “Available”.</li><li>⚠️ Go make a cup of tea. Seriously — RDS takes 5–10 minutes. Don’t refresh aggressively, just wait.</li></ul><p><strong>14. Copy the Endpoint</strong></p><ul><li>Once the status shows Available, click your database name. Under the “Connectivity &amp; security” tab, you’ll see the Endpoint — it looks like my-mysql-db.xxxxxxxxxx.ap-south-1.rds.amazonaws.com. Copy this. You&#39;ll need it to connect. Make sure to copy “Master Password” too if ypu have selected the option to Auto-Generate the password.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2wD5k_8iQ5ul4GE4sx7nKA.png" /><figcaption>Copy Matser Password</figcaption></figure><ul><li>✅ This endpoint is your database’s permanent address inside the VPC. It never changes, even if the underlying instance is replaced.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uQRVomV6O0rIp-9k67SWxA.png" /><figcaption>Endpoint and other DB Details</figcaption></figure><h3>Connect to RDS from Your EC2 Instance</h3><p>Your RDS database is live but has no public IP — it’s sitting quietly in the private subnet, waiting for a connection from inside the VPC. Our EC2 instance in the public subnet is going to bridge that gap.</p><p><strong>No EC2 Yet? Launch One First. </strong>If you don’t have an EC2 instance running in the public subnetmy-first-vpc, go back to <a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-3-deep-dive-into-ec2-launch-an-amazon-linux-server-as-the-cloud-developer-338ebb00b58c">Part 3</a> and launch an Amazon Linux instance — but this time, choose my-first-vpc as the VPC and your<strong> public subnet </strong>as the subnet. Make sure SSH (port 22) is open in its security group. Once it&#39;s running, come back here.</p><h4>Step 1 — SSH into Your EC2 Instance</h4><p><strong>On Mac or Linux (Terminal):</strong></p><pre># Step 1: Fix the key file permissions (only need to do this once)<br>chmod 400 ~/Downloads/linux-key.pem<br><br># Step 2: SSH into your instance<br># Replace &lt;YOUR-PUBLIC-IP&gt; with the Public IPv4 from your EC2 console<br>ssh -i ~/Downloads/linux-key.pem ec2-user@&lt;YOUR-PUBLIC-IP&gt;<br><br># Example:<br>ssh -i ~/Downloads/linux-key.pem ec2-user@54.123.45.67</pre><p><strong>On Windows (PowerShell):</strong></p><pre># No extra software needed — Windows 10/11 ships with a built-in SSH client<br><br>ssh -i &quot;C:\Users\YourName\Downloads\Linux Key Pair.pem&quot; ec2-user@&lt;YOUR-PUBLIC-IP&gt;<br><br># Example:<br>ssh -i &quot;C:\Users\Deepak\Downloads\Linux Key Pair.pem&quot; ec2-user@54.123.45.67</pre><h4>Step 2 — Install the MySQL Client</h4><p>Your EC2 instance doesn’t have the MySQL client installed by default. We just need the <em>client</em> — not the full server — to connect to RDS. One command:</p><pre># Install the MySQL client package<br><br>sudo dnf install -y mysql<br><br># Verify it installed correctly<br><br>mysql --version<br><br># Should print:<br># mysql Ver 8.x.x ...</pre><h4>Step 3 — Connect to Your RDS Instance</h4><p>Now use the MySQL client to connect. Replace &lt;YOUR-RDS-ENDPOINT&gt; with the endpoint you copied from the RDS console, and admin with your master username:</p><pre>mysql -h &lt;YOUR-RDS-ENDPOINT&gt; -u admin -p<br><br># Example:<br># mysql -h my-mysql-db.xxxxxxxxxx.ap-south-1.rds.amazonaws.com -u admin -p<br><br># You&#39;ll be prompted for your password — type it and press Enter<br># (the password won&#39;t show as you type — that&#39;s normal)</pre><p>If the connection is successful, you’ll see the MySQL prompt:</p><pre>Welcome to the MySQL monitor. Commands end with ; or \g.<br><br>Your MySQL connection id is 21<br>Server version: 8.0.35 Source distribution<br><br>Copyright (c) 2000, 2024, Oracle and/or its affiliates.<br><br>Type &#39;help;&#39; or &#39;\h&#39; for help.<br>Type &#39;\c&#39; to clear the current input statement.<br><br>mysql&gt;</pre><p>That mysql&gt; prompt means you are now connected to a fully managed MySQL database running in the AWS cloud, inside your private subnet, from a terminal inside your EC2 instance. That&#39;s a properly architected cloud database connection. 🎉</p><blockquote><strong>🤔 Connection Timed Out? Don’t Panic! </strong>If the connection hangs and times out, the most common cause is <strong>the Security Group</strong>. Check: (1) The RDS security group allows port 3306 from the EC2 security group — not just “My IP”. (2) Your EC2 instance is in the same VPC as RDS. (3) You’re using the RDS <em>endpoint</em> (the long hostname), not the IP address directly.</blockquote><h3>Run Real SQL Queries 📝</h3><p>You’re connected. Now let’s actually use this database. We’ll create a database, build a table, insert some data, and run queries — all the fundamental SQL operations you’d use in a real application.</p><h4>Explore What’s Already There</h4><pre>-- See all databases on this RDS instance<br><br>SHOW DATABASES;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*JdWQCBB3LCEPVFiz0xv9tQ.png" /></figure><p>You can see appdb — That&#39;s the initial database we asked AWS to create during setup. The others (information_schema, mysql, performance_schema) are MySQL system databases — don&#39;t touch those.</p><h4>Switch to Your Database and Create a Table</h4><pre>-- Switch into our app database<br><br>USE appdb;<br><br>-- Create a users table<br><br>CREATE TABLE users (<br>    id INT AUTO_INCREMENT PRIMARY KEY,<br>    name VARCHAR(100) NOT NULL,<br>    email VARCHAR(150) NOT NULL UNIQUE,<br>    city VARCHAR(100),<br>    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP<br>);<br><br>-- Verify the table was created<br><br>SHOW TABLES;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*8WIKHfihnFNymt6l0IFJBg.png" /></figure><h4>Insert Some Data</h4><pre>-- Insert a few users<br><br>INSERT INTO users (name, email, city)<br>VALUES<br>    (&#39;Deepak Cardoza&#39;, &#39;deepak@example.com&#39;, &#39;Mangaluru&#39;),<br>    (&#39;Priya Sharma&#39;, &#39;priya@example.com&#39;, &#39;Bangalore&#39;),<br>    (&#39;Arjun Mehta&#39;, &#39;arjun@example.com&#39;, &#39;Mumbai&#39;),<br>    (&#39;Sara Thomas&#39;, &#39;sara@example.com&#39;, &#39;Kochi&#39;),<br>    (&#39;Rahul Nair&#39;, &#39;rahul@example.com&#39;, &#39;Chennai&#39;);<br><br>-- Confirm how many rows were added<br><br>Query OK, 5 rows affected (0.02 sec)</pre><h4>Query Your Data</h4><pre>-- Get all users<br><br>SELECT * FROM users;<br><br>-- Get only name and city<br><br>SELECT name, city FROM users;<br><br>-- Filter — users from a specific city<br><br>SELECT * FROM users<br>WHERE city = &#39;Bangalore&#39;;<br><br>-- Count total users<br><br>SELECT COUNT(*) AS total_users<br>FROM users;<br><br>-- Order by name alphabetically<br><br>SELECT * FROM users<br>ORDER BY name ASC;</pre><p>Here’s what the full SELECT * result looks like:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*i_V7YK67n7hoW8UAVjWw5Q.png" /></figure><h4>Update and Delete</h4><pre>-- Update a user&#39;s city<br><br>UPDATE users<br>SET city = &#39;Delhi&#39;<br>WHERE email = &#39;rahul@example.com&#39;;<br><br>-- Verify the update<br><br>SELECT name, city<br>FROM users<br>WHERE email = &#39;rahul@example.com&#39;;<br><br>-- Delete a user<br><br>DELETE FROM users<br>WHERE email = &#39;sara@example.com&#39;;<br><br>-- Confirm remaining count<br><br>SELECT COUNT(*) AS remaining<br>FROM users;<br><br>-- Look at your table structure<br><br>DESCRIBE users;<br><br>-- Exit MySQL when done<br><br>EXIT;</pre><blockquote><strong>⚠️ Always Use WHERE with UPDATE and DELETE</strong></blockquote><blockquote>Running UPDATE users SET city = &#39;Delhi&#39; without a WHERE clause updates <em>every single row</em>. Same with DELETE — without WHERE, you lose all your data. Always double-check your WHERE condition before running these commands. A good habit is to run the equivalent SELECT first: SELECT * FROM users WHERE email = &#39;rahul@example.com&#39; — Confirm you see the right row, then run the UPDATE or DELETE.</blockquote><h3>MySQL Workbench — A GUI Alternative</h3><p>Not a fan of the terminal? <strong>MySQL Workbench</strong> is a free, official GUI tool from MySQL that lets you connect to, browse, and query your database with a visual interface — tables, diagrams, query editor, and all.</p><p>Since our RDS has no public IP, Workbench can’t connect to it directly from your laptop. Instead, you set up an <strong>SSH tunnel</strong> — Workbench connects to your EC2 over SSH first, then tunnels the MySQL connection through it. This is safe, and Workbench supports it natively.</p><blockquote><strong>💡How to Set Up the SSH Tunnel in MySQL Workbench:</strong></blockquote><blockquote>In Workbench: New Connection → Connection Method: <strong>Standard TCP/IP over SSH</strong>. Then fill in: SSH Hostname = your EC2 public IP, SSH Username = ec2-user, SSH Key File = your .pem file. MySQL Hostname = your RDS endpoint, MySQL Port = 3306, Username = admin. Click OK → Test Connection. Workbench handles the tunnel automatically.</blockquote><blockquote><strong>💡 Download MySQL Workbench:</strong></blockquote><blockquote>Available free for Windows, Mac, and Linux at <a href="https://dev.mysql.com/downloads/workbench/">dev.mysql.com/downloads/workbench</a>. No account required — just click “No thanks, just start my download.”</blockquote><h3>Delete Your RDS Instance — Do It Properly</h3><p>Unlike VPCs and subnets, <strong>RDS instances cost money while they’re running</strong> — even when idle. Once you’re done exploring, delete it. But RDS has a specific deletion process you need to follow correctly.</p><p><strong>1. Go to RDS → Databases</strong></p><ul><li>In the RDS console, click <strong>Databases</strong> in the left sidebar. Select your instance my-mysql-db.</li></ul><p><strong>2. Click Actions → Delete</strong></p><ul><li>Click the <strong>Actions</strong> dropdown and select <strong>Delete</strong>. A confirmation dialog will appear.</li></ul><p><strong>3. Final Snapshot — Your Choice</strong></p><ul><li>AWS will ask: “Create final snapshot?” A final snapshot is a backup of your database at deletion time. For learning purposes, you can uncheck this — there’s no real data to preserve. If this were a production database, you’d always take a final snapshot.</li><li>⚠️ Final snapshots do cost storage. For a learning database with test data, skip it. Just type &quot;delete me&quot; in the confirmation box and click <strong>Delete</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/516/1*Euz6JaHcRwz02vMEsxA7iQ.png" /><figcaption>Deleting RDS DB</figcaption></figure><p><strong>4. Wait for Deletion</strong></p><ul><li>The status will change to &quot;Deleting&quot; — this takes 3–5 minutes. Once gone, the instance disappears from the list. Billing stops immediately.</li><li>✅ Also remember to terminate your EC2 jump box instance if you’re done with it — EC2 charges by the hour, too.</li><li>✅ You can optionally delete the Custom VPC, any security groups, or subnet groups created by us (DO NOT DELETE the default ones).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIGNDdFQJGkyR1UmicxNZg.png" /><figcaption>Cleanup Security Groups</figcaption></figure><blockquote><strong>💡 Automated Backups Are Deleted Too:</strong></blockquote><blockquote>When you delete an RDS instance without a final snapshot, AWS also deletes all automated backups associated with it. They won’t continue to exist and charge you. Only manual snapshots (if you created any) remain and need to be deleted separately from the Snapshots section.</blockquote><h3>What’s Next? 🗺️</h3><p>Look at how far you’ve come. You’ve gone from a static S3 website to a properly architected, VPC-isolated, cloud-hosted database with real SQL queries running on it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*QF1ZOD2ssnY9UUcp7-90Ng.png" /></figure><p>In <strong>Part 6</strong>, we move into serverless territory with <strong>AWS Lambda</strong>. No servers to manage, no EC2 to keep running — you write a function, AWS runs it on demand, and you pay only for the exact milliseconds it executes. We’ll build a Lambda function that queries your RDS database, triggered by an API call. The pieces are starting to connect into a real application.</p><h3>Conclusion</h3><p>You just did what most beginners skip — you didn’t just spin up a database and call it done. You built it the right way: private subnet, security group scoped to only your EC2, connected through a proper jump box, and ran real queries against it. That’s production-grade thinking, even at the learning stage.</p><p>RDS removes an entire category of complexity from your plate — patching, backups, replication — so you can focus on what actually matters for your application. And now you know not just how to use it, but why it’s set up the way it is.</p><p>See you in Part 6, where we go serverless and let AWS run our code without any servers at all.</p><blockquote><em>“A database in the cloud isn’t just storage — it’s the memory of your application. Set it up securely once, and everything you build on top of it inherits that trust.”</em></blockquote><h3>Bonus Resources</h3><p>Want to go deeper on RDS and MySQL? These are the places to bookmark:</p><p><a href="https://aws.amazon.com/rds/">Amazon RDS Official Page</a> — Overview of all RDS features, supported engines, and pricing from AWS.</p><p><a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/Welcome.html">RDS User Guide</a> — The complete AWS documentation for RDS — launching, connecting, monitoring, and more.</p><p><a href="https://aws.amazon.com/rds/free/">RDS Free Tier Details</a> — Exactly what’s included in the RDS free tier — so you know what’s safe to leave running.</p><p><a href="https://dev.mysql.com/doc/refman/8.0/en/">MySQL 8.0 Reference Manual</a> — The official MySQL documentation — every SQL command, data type, and function explained.</p><p><a href="https://dev.mysql.com/downloads/workbench/">MySQL Workbench Download</a> — Free GUI tool for MySQL — schema design, query editor, and visual table browser.</p><p><a href="https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_VPC.WorkingWithRDSInstanceinaVPC.html">RDS in a VPC — AWS Docs</a> — Official guide on running RDS inside a VPC — subnets, security groups, and connectivity.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2132c0699208" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS for Beginners (Part 4): VPC & Networking — Your Private Corner of the Cloud ️]]></title>
            <link>https://medium.com/@deepakcardoza/aws-for-beginners-part-4-vpc-networking-your-private-corner-of-the-cloud-%EF%B8%8F-2044182b9755?source=rss-cbfe363f8f26------2</link>
            <guid isPermaLink="false">https://medium.com/p/2044182b9755</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[aws-vpc]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Deepak Cardoza]]></dc:creator>
            <pubDate>Tue, 05 May 2026 11:35:57 GMT</pubDate>
            <atom:updated>2026-05-05T11:35:57.404Z</atom:updated>
            <content:encoded><![CDATA[<p>Before your EC2 servers talk to each other or the internet, they need a home. That home is a VPC — and understanding it changes everything.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rAhJ2RUn_rylKEHKM6JOzQ.jpeg" /></figure><p>In <a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-2-launching-your-first-amazon-ec2-virtual-server-%EF%B8%8F-da6c210d9a72">Part 2</a> and <a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-3-deep-dive-into-ec2-launch-an-amazon-linux-server-as-the-cloud-developer-338ebb00b58c">Part 3</a> of this series, we launched EC2 instances — a Windows cloud machine and an Amazon Linux server that served a live webpage using User Data. But did you notice that every time we launched an instance, AWS quietly asked: <em>“Which VPC and subnet should this go in?”</em> We ignored it and used the default.</p><p>That default VPC is your safety net when you’re learning. But once you start building real applications — with separate databases, backend servers, and public-facing web layers — you need to understand what’s actually happening under the hood. That’s what this post is all about.</p><p>VPC is one of those topics that sounds intimidating (Virtual Private Cloud, subnets, CIDR blocks, route tables…) but makes complete sense the moment you have the right analogy. Let’s build that picture first, then get hands-on.</p><h3>Table of Contents</h3><p>· <a href="#2b87">What is a VPC?</a><br>· <a href="#3bd8">VPC Structure — What’s Inside?</a><br> ∘ <a href="#6072">CIDR Block — Your Address Range</a><br> ∘ <a href="#ef92">Subnets — Public and Private</a><br> ∘ <a href="#df28">Public Subnet</a><br> ∘ <a href="#8b20">Private Subnet</a><br>· <a href="#21c0">The Full Picture</a><br>· <a href="#1191">Internet Gateway — The Main Security Gate</a><br>· <a href="#6b48">Security Groups vs NACLs — Your Two-Layer Shield</a><br> ∘ <a href="#8897">Security Groups — The Building Security Desk</a><br> ∘ <a href="#4bf0">NACLs — The Community-Wide Rules Board</a><br>· <a href="#1a55">Route Tables — Road Signs Inside Your VPC</a><br>· <a href="#9825">NAT Gateway — The Private Postman</a><br>· <a href="#fb54">Where is VPC Used? Real-World Context</a><br>· <a href="#4073">The Default VPC — AWS’s Gift to Beginners</a><br>· <a href="#339a">Create Your Own VPC — Using the Visual Map</a><br>· <a href="#1bb9">What’s Next?</a><br>· <a href="#d758">Conclusion</a><br>· <a href="#9e0b">Bonus Resources</a></p><h3>What is a VPC?</h3><p>VPC stands for <strong>Virtual Private Cloud</strong>. In simple terms, it’s your own <em>private, isolated network</em> inside AWS. Every resource you create — EC2 instances, databases, Lambda functions — lives somewhere inside a VPC. Think of it as the plot of land your house (or entire neighbourhood) sits on.</p><p>Without a VPC, your servers would just float loosely in AWS’s massive shared environment with no clear boundaries, no private space, and no control over who can talk to what. A VPC gives you all of that — a defined network that <em>you</em> control.</p><h4><strong>🏘️ The Gated Community Analogy — This is Your Mental Model</strong></h4><p>Imagine a <strong>gated residential community</strong>. The entire community sits behind a boundary wall — that’s your <strong>VPC</strong>. Inside, there are different blocks: some face the main road and are open to visitors (your <strong>public subnets</strong>), while others are deeper inside with no direct outside access — only residents go there (your <strong>private subnets</strong>). The community has a single main security gate where the guard checks who enters and exits — that’s your <strong>Internet Gateway</strong>. Every building has its own security desk that decides who’s allowed in — those are your <strong>Security Groups</strong>. And the community’s management has a board of rules that applies to entire blocks at once — that’s your <strong>Network ACL</strong>. When private residents need to send a letter outside, they use a postman who goes out on their behalf — that’s your <strong>NAT Gateway</strong>. Nobody knows the private resident’s home address. The postman just brings the reply back.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*9KXDwIC6bNB7p3EJBgv0Kw.png" /></figure><blockquote><strong>💡 Good News — VPC Itself is Free — </strong>Creating a VPC, subnets, route tables, and an Internet Gateway costs absolutely nothing. You only pay for the resources you place <em>inside</em> the VPC — like EC2 instances or databases. This means you can design and create your network structure without any cost concerns.</blockquote><h3>VPC Structure — What’s Inside?</h3><p>Let’s break down the building blocks of a VPC from the outside in.</p><h4>CIDR Block — Your Address Range</h4><p>When you create a VPC, you define a <strong>CIDR block</strong> — essentially an address range for all the private IPs inside your network. A typical choice for beginners is 10.0.0.0/16.</p><blockquote><strong>💡 Analogy — </strong>Think of a CIDR block like a postcode area. If your postcode covers an entire city, 10.0.0.0/16 means your VPC gets 65,536 possible IP addresses — plenty of room for all your servers and subnets. When you create subnets, you carve smaller pieces out of this range, like individual streets within the city.</blockquote><h4>Subnets — Public and Private</h4><p>A subnet is a <strong>smaller segment of your VPC’s IP range</strong>, tied to one Availability Zone. You’ll create at least two kinds:</p><h4>Public Subnet</h4><p>Has a route to the Internet Gateway. Resources here can be reached from the internet, like your web server or a load balancer. This is where your EC2 from Part 3 would live.</p><h4>Private Subnet</h4><p>No direct route to the internet. Databases, backend servers, and sensitive resources go here. They can still reach the internet to download updates — but only through a NAT Gateway.</p><blockquote><strong>💡Subnets Live in One AZ — </strong>Each subnet is locked to one Availability Zone. For a resilient setup, you’d create a public and private subnet in each AZ — for example, one pair in ap-south-1a and another in ap-south-1b. This way, if one data centre has an issue, your app keeps running in the other AZ. The VPC Wizard we use in the hands-on section handles this automatically.</blockquote><h3>The Full Picture</h3><p>Here’s how everything fits together visually:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*xu_My3vUAeqASlXMjQGPVw.png" /><figcaption>VPC Architecture</figcaption></figure><h3>Internet Gateway — The Main Security Gate</h3><p>An <strong>Internet Gateway (IGW)</strong> is a component you attach to your VPC that allows communication between resources in your VPC and the internet. Without one, your VPC is completely sealed — nothing gets in or out.</p><blockquote><strong>💡Community Analogy — </strong>The Internet Gateway is the <strong>main security gate of your gated community</strong>. It’s the only official entrance and exit point to the outside world. When a visitor from the internet wants to reach your web server, they go through this gate. And when your server needs to send data out to the internet, it also goes through this gate. No gate = no outside access at all, in either direction.</blockquote><p>Key things to know about Internet Gateways:</p><ul><li><strong>One per VPC</strong> — Each VPC has at most one Internet Gateway attached</li><li><strong>Horizontally scaled</strong> — AWS manages it fully; no bandwidth limits or availability concerns for you to worry about</li><li><strong>Free</strong> — There’s no cost to create or attach an Internet Gateway</li><li><strong>Only works for public subnets</strong> — A subnet is only “public” if its route table has a route pointing to an Internet Gateway (IGW)</li></ul><p><strong>⚠️ IGW Alone Isn’t Enough — </strong>Attaching an IGW to your VPC doesn’t automatically make everything reachable. You also need <strong>a route table entry </strong>that says “send internet-bound traffic (0.0.0.0/0) to the IGW.” And the resource still needs a public IP address. All three pieces need to be in place: IGW + route table + public IP.</p><h3>Security Groups vs NACLs — Your Two-Layer Shield</h3><p>AWS gives you <strong>two separate layers of network security</strong> inside your VPC. They work at different levels, and understanding the difference is key to building a properly secured network.</p><h4>Security Groups — The Building Security Desk</h4><p>Remember back in <a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-2-launching-your-first-amazon-ec2-virtual-server-%EF%B8%8F-da6c210d9a72">Part 2</a> when we launched our Windows EC2 instance? We opened the port 3389 for RDP. Then in <a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-3-deep-dive-into-ec2-launch-an-amazon-linux-server-as-the-cloud-developer-338ebb00b58c">Part 3</a>, we opened a port 22 for SSH and a port 80 for HTTP. Those rules we set — that was a <strong>Security Group</strong> in action.</p><p>A Security Group is attached to <em>individual resources</em> — each EC2 instance, each RDS database, each load balancer has its own security group. It decides what traffic is allowed to enter (inbound) and leave (outbound) that specific resource.</p><blockquote><strong>💡Community Analogy — </strong>The Security Group is the <strong>security desk at the entrance of each individual building</strong>. You walk into the community (past the IGW gate), and now you’re inside — but to enter a specific office building, you have to check in at that building’s desk. The desk has a list: “Visitors with an appointment for floor 22 (port 22) — allowed. Visitors for floor 80 (port 80) — allowed. Everyone else — sorry, not today.”</blockquote><p>The rules we set in our EC2 launches, mapped to the analogy:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*bxkCUAMcMJmGJ6p4LNf-TA.png" /></figure><blockquote><strong>💡 Security Groups are Stateful</strong> — Stateful means: if you allow traffic <em>in</em>, the reply is automatically allowed <em>out</em> — even without a separate outbound rule. You sent an HTTP request in? The response comes back automatically. This makes Security Groups simpler to manage for most use cases.</blockquote><h4>NACLs — The Community-Wide Rules Board</h4><p>A <strong>Network Access Control List (NACL)</strong> operates at the <em>subnet level</em> — not per resource, but for the entire subnet. Every packet entering or leaving a subnet passes through the NACL.</p><blockquote><strong>💡Community Analogy — </strong>The NACL is the <strong>community management board of rules</strong> posted at the entrance to each residential block. “No commercial vehicles allowed on Block A.” “No entry after 10 pm on Block B.” These rules apply to everyone entering that entire block — regardless of which building they’re heading to. Even if a building’s own security desk says “come on in,” if the block rules say “no,” you don’t get past the block entrance.</blockquote><p>Here’s a clean side-by-side comparison:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/978/1*lpEvOm_nCSKJUfuyxCQafg.png" /></figure><blockquote><strong>💡For Beginners — Focus on Security Groups. </strong>As a beginner, Security Groups are what you’ll configure for every EC2, database, and load balancer you create. NACLs are an additional layer for advanced scenarios — like blocking a known malicious IP range at the network level. The default NACL that comes with every subnet allows all traffic, so you don’t need to touch it right now.</blockquote><h3>Route Tables — Road Signs Inside Your VPC</h3><p>Inside your VPC, traffic doesn’t just flow freely wherever it wants. A <strong>route table</strong> is a set of rules — called routes — that tells network traffic where to go based on its destination IP address.</p><blockquote><strong>💡Community Analogy — </strong>Route tables are the <strong>road signs inside your community</strong>. “Deliveries for Block A — go left.” “Traffic heading to the main road (internet) — exit via the main gate.” Each block (subnet) follows its own set of road signs. Public blocks have a sign pointing to the main gate for internet traffic. Private blocks don’t have that sign — their traffic only flows internally, or via the postman (NAT Gateway) if they need to reach outside.</blockquote><p>A typical public subnet route table looks like this:</p><pre># Destination        Target<br><br>10.0.0.0/16          local<br># All internal VPC traffic stays local<br><br>0.0.0.0/0            igw-xxxxxxxx<br># Everything else goes to the Internet Gateway</pre><p>And a private subnet route table looks like this:</p><pre># Destination        Target<br><br>10.0.0.0/16          local<br># Internal VPC traffic only<br><br># No 0.0.0.0/0 route = no direct internet access<br><br># (With NAT Gateway:)<br># 0.0.0.0/0          nat-xxxxxxxx</pre><blockquote><strong>💡 This is What Makes a Subnet “Public” or “Private” — </strong>There’s no magic setting that labels a subnet as “public” or “private.” The difference is purely in the route table. A subnet whose route table has a 0.0.0.0/0 → IGW route is public. A subnet without that route is private. That&#39;s the entire distinction.</blockquote><h3>NAT Gateway — The Private Postman</h3><p>Private subnets have no direct access to the internet. But sometimes, a resource in a private subnet still needs to <em>reach out</em> — to download a software update, call an external API, or pull a Docker image. That’s where a <strong>NAT Gateway</strong> comes in.</p><blockquote>💡<strong>Community Analogy </strong>— Private residents can’t leave the community themselves — it’s the rule. But they can hand their letters to the <strong>community postman (NAT Gateway)</strong>, who lives in the public block near the main gate. The postman goes out, delivers the letter, gets the reply, and brings it back. The outside world only ever sees the postman’s address — never the private resident’s. It’s outbound only: the internet can’t initiate contact with a private subnet resource through NAT.</blockquote><p>NAT Gateway is a fully managed service — AWS handles availability, scaling, and maintenance. You just create it in your public subnet and update your private subnet’s route table to point outbound traffic through it.</p><h4>⚠️ NAT Gateway Has No Free Tier — Real Costs Apply</h4><p>This is the part we need to be honest about. NAT Gateway is <strong>not free</strong> — and it’s one of the most common sources of unexpected AWS bills for beginners.</p><p>This is exactly why our hands-on section below <strong>does not include a NAT Gateway</strong>. For learning purposes, your EC2 instance will live in a public subnet anyway (directly internet-accessible) — you don’t need NAT. Save NAT Gateway for when you’re building production architecture with real private subnets that need outbound access.</p><blockquote><strong>💡 Learning Without NAT — Totally Fine: </strong>For everything in this beginner series, your EC2 lives in a public subnet and talks to the internet directly through the IGW. You only need a NAT Gateway when you have resources in <em>private</em> subnets that need to reach the internet. Understanding the concept now is what matters — you can create one when you actually need it.</blockquote><h3>Where is VPC Used? Real-World Context</h3><p>Almost everything you’ll ever build on AWS lives inside a VPC. Here’s how VPC connects to the other services in this series — and why it’s the invisible foundation of every cloud application.</p><ul><li><strong>EC2 — Always Inside a VPC</strong><br>Every EC2 instance lives in a specific subnet inside a VPC. The subnet determines whether it’s publicly reachable or private. In Parts 2 &amp; 3, our instances used the default VPC’s public subnet automatically.</li><li><strong>RDS Databases</strong><br>Databases should always go in a private subnet — no direct internet access. Your EC2 app server (in the public subnet) talks to the RDS instance (in the private subnet) using its private IP. This is the classic 3-tier architecture.</li></ul><blockquote>Databases in private subnets don’t require a NAT Gateway for application access — your EC2 services communicate with them internally using private IPs. A NAT Gateway is only needed if the database requires outbound internet access (for updates or external services), not for normal application communication.</blockquote><ul><li><strong>Lambda Functions</strong><br>By default, Lambda runs outside any VPC. But if your Lambda needs to connect to an RDS database or private EC2 resource, you deploy it inside your VPC. Then it follows your VPC’s routing and security rules. We will learn more about AWS Lambda in the upcoming posts.</li><li><strong>S3 — Via VPC Endpoints</strong><br>S3 is a public AWS service, but you can create a VPC Gateway Endpoint for S3 — free of charge — so traffic from your private subnet to S3 never leaves the AWS network. Faster, cheaper, and more secure than going through a NAT Gateway.</li><li><strong>Load Balancers</strong><br>An Application Load Balancer sits in your public subnet, receives traffic from the internet, and distributes it to EC2 instances in your private subnet. VPC routing makes this possible — the ALB is the only public-facing component.</li><li><strong>Security Isolation</strong><br>VPCs are completely isolated from each other by default. If you have a production environment and a development environment, putting them in separate VPCs means a misconfiguration in dev can never accidentally affect prod.</li></ul><blockquote><strong>💡The Classic 3-Tier Architecture Pattern:</strong></blockquote><blockquote>Most real-world web apps on AWS follow this pattern:</blockquote><blockquote><strong>Load Balancer</strong>(public subnet) → <strong>EC2 App Server</strong>(private subnet) → <strong>RDS Database</strong>(private subnet, different AZ).</blockquote><blockquote>The only thing the internet sees is the load balancer. Everything behind it is shielded inside the VPC. Understanding VPC is what makes this architecture possible to build.</blockquote><h3>The Default VPC — AWS’s Gift to Beginners</h3><p>When you create an AWS account, AWS automatically creates a <strong>Default VPC</strong> in every region — pre-configured and ready to use. This is what we’ve been using silently in Parts 2 and 3 every time we launched an EC2 instance without worrying about networking.</p><p>Here’s what comes pre-built in your default VPC:</p><ul><li><strong>One VPC per Region</strong><br> CIDR 172.31.0.0/16. Automatically created. Already has an Internet Gateway attached.</li><li><strong>One Public Subnet per AZ</strong><br> Each Availability Zone in the region gets its own subnet. All are public — route table already points to the Internet Gateway.</li><li><strong>Route Table Ready</strong><br> Pre-configured with a 0.0.0.0/0 → IGW route. All subnets are already public and internet-reachable.</li><li><strong>Default NACL + Security Group</strong><br> A default Security Group (allow all outbound, deny all inbound) and default NACL (allow all) are created automatically.</li></ul><blockquote><strong>⚠️ Don’t Delete Your Default VPC — </strong>The default VPC is your safety net and is used by many AWS services when you don’t specify otherwise. If you accidentally delete it, you can recreate it through the VPC console — but it’s a hassle. Leave it alone and create your own custom VPCs for your projects.</blockquote><p><strong>Default VPC Has No Private Subnets — </strong>Everything in the default VPC is public by design — it’s meant to get you started quickly. For real production apps where databases and app servers should be private, you’ll build your own VPC with a proper public/private split. That’s exactly what we’re doing in the hands-on below.</p><h3>Create Your Own VPC — Using the Visual Map</h3><p>AWS has a <strong>VPC Resource Map</strong> — a visual drag-and-drop tool in the console that lets you see and configure your entire VPC architecture before creating anything. It’s perfect for beginners because you can see exactly what’s being created as you configure it.</p><p>We’ll create a VPC with one public subnet and one private subnet. We’ll attach an Internet Gateway. We will <strong>skip the NAT Gateway</strong> intentionally — see <a href="#406b">This Section</a> for exactly why. This setup is enough to understand VPC architecture completely, and it costs you nothing.</p><blockquote><strong>💡 What We’re Building: </strong>VPC (10.0.0.0/16) → Public Subnet (10.0.1.0/24) + Private Subnet (10.0.2.0/24) → Internet Gateway → Route Tables. Total cost: <strong>$0.00</strong></blockquote><p><strong>1. Open the VPC Console</strong></p><ul><li>Log in to the AWS Console. In the top search bar, type VPC and click on it. You’ll land on the VPC Dashboard. Click the orange “Create VPC” button.</li></ul><p><strong>2. Choose “VPC and more”</strong></p><ul><li>At the top of the Create VPC page, you’ll see two radio options: “VPC only” and “VPC and more”. Select “VPC and more”. This activates the visual Resource Map — you’ll see a live diagram update as you fill in each setting. This is the option we want.</li><li>The Resource Map is your best friend here. Watch it update in real time as you change settings below.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YzzPdUB0aNlO3zEI7E4Pgg.png" /><figcaption>Create VPC -&gt; VPC and More</figcaption></figure><p><strong>3. Name Your VPC</strong></p><ul><li>In the “Name tag auto-generation” field, type a prefix like my-first-vpc. AWS will use this to auto-name all the resources it creates — subnets, route tables, etc. — with this prefix. Keeps things organised.</li></ul><p><strong>4. Set the IPv4 CIDR Block</strong></p><ul><li>Leave this as the default 10.0.0.0/16. This gives your VPC 65,536 IP addresses — way more than enough. You&#39;ll see the diagram update to show your VPC boundary.</li></ul><p><strong>5. Set Number of Availability Zones</strong></p><ul><li>For simplicity, set this to 1. This means we’ll create subnets in just one AZ. For a real production setup, you’d choose 2 or 3 for redundancy — but for learning, 1 is perfect and keeps the diagram simple.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-Y_eCOJkgjBTlVAGK-JmNA.png" /><figcaption>Set AZ to 1 &amp; Set Public &amp; Private Subnets to 1</figcaption></figure><p><strong>6. Set Public and Private Subnets</strong></p><ul><li>Set “Number of public subnets” to 1 and “Number of private subnets” to 1. You’ll see both subnets appear in the Resource Map — the public one connected to the Internet Gateway, the private one isolated.</li><li>Watch the diagram — you can literally see the public subnet connecting to the IGW and the private subnet sitting isolated. This is the entire VPC architecture visualised.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Qu7F-y-y_0LHNNKvaa0pYA.png" /><figcaption>Set Public &amp; Private Subnets to 1</figcaption></figure><p><strong>7. NAT Gateways — Set to None</strong></p><ul><li>Under “NAT gateways ($)”, select “None”. As we <a href="#406b">covered earlier</a>, NAT Gateway costs ~$32/month with no free tier. We don’t need it for this learning exercise.</li><li>⚠️ If you accidentally leave this as “1 per AZ” or “1 in 1 AZ”, you will be charged $0.045/hour from the moment the VPC is created. Make sure it says <strong>None</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J-G6qZz-VLFX4Ke-ocmBdA.png" /><figcaption>NAT Gateway — None</figcaption></figure><p><strong>8. VPC Endpoints — Keep as None</strong></p><ul><li>Leave this as None for now. VPC Endpoints are useful for connecting to S3 and DynamoDB without going through the internet — but that’s a more advanced topic. We’ll skip it here.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/474/1*LIz9M0waYYiqrq_H5pvTWw.png" /><figcaption>VPC Endpoints — None</figcaption></figure><p><strong>9. Review the Resource Map</strong></p><ul><li>Before clicking Create, take a moment to look at the Resource Map diagram on the right side of the screen. You should see: your VPC box → containing a public subnet (connected to an Internet Gateway) and a private subnet (isolated) → each with its own route tables. This is your entire VPC architecture laid out visually. If it looks right, continue.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HXMOERajbfSgTiAN99pV7w.png" /></figure><p><strong>10. Click “Create VPC”</strong></p><ul><li>Hit the orange “Create VPC” button. AWS will create everything in order: the VPC itself, the subnets, the Internet Gateway, the route tables, and the NACL. You’ll see a progress screen with each resource being created and checked off. It takes about 30–60 seconds.</li><li>🎉 When everything shows a green ✅, your VPC is live! Click “View VPC” to see it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AqypHxsugmUrgof5bGvSUA.png" /><figcaption>VPC Creation Complete</figcaption></figure><p><strong>11. Explore What Was Created</strong></p><ul><li>In the left sidebar of the VPC console, explore: Subnets (see your public and private ones), Internet Gateways (see it attached to your VPC), Route Tables (see the two different tables — the public one has0.0.0.0/0 → igw, the private one doesn&#39;t). This is how you verify everything is wired correctly.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oJUHRipLx4yrHc57idlO_w.png" /></figure><p><strong>12. Launch an EC2 in Your New VPC (Bonus!)</strong></p><ul><li>Want to see it in action? Go to EC2 → Launch Instance. Under “Network settings”, click Edit. Change the VPC dropdown from the default VPC to my-first-vpc. Then select your public subnet. Enable &quot;Auto-assign public IP&quot;. Everything else is the same as Part 3. Your EC2 now lives inside your custom VPC!</li><li>This is the moment everything connects — EC2 from Part 3, inside your own VPC from today.</li></ul><blockquote><strong>⚠️ Clean Up When Done: </strong>VPCs themselves are free, but if you launched an EC2 inside it, remember to terminate the instance when you’re done. The VPC, subnets, route tables, and IGW can stay without any cost — only compute resources are charged by the hour.</blockquote><h3>What’s Next?</h3><p>Here’s where you stand in the AWS beginner series. Networking is now demystified — you understand the invisible infrastructure that all your future AWS services will sit on.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/977/1*puInKkcOWlKND1x27dz0Ug.png" /></figure><p>In <strong>Part 5</strong>, we’ll launch our first managed database using <strong>Amazon RDS</strong>. We’ll deploy it inside the private subnet of the VPC you just created, connect to it from an EC2 instance in the public subnet, and understand why databases should never be exposed directly to the internet.</p><h3>Conclusion</h3><p>VPC is one of those topics that people avoid for too long because the terminology sounds complex. But once you have the gated community picture in your head — boundary wall, main gate, security desks, private blocks, postman — the AWS terms just become labels for things you already understand.</p><p>You now know what a VPC is, what lives inside it, how traffic flows through it, and how Security Groups and NACLs protect it. You’ve built one from scratch using the visual map and connected it to everything you learned in Parts 2 and 3. This is the networking foundation that every serious AWS architecture is built on.</p><p>In Part 5, we put the VPC to use — by launching a real database inside the private subnet you just created. See you there.</p><blockquote><em>“A VPC isn’t a configuration detail — it’s the blueprint of your cloud. Get the network right, and everything you build on top of it inherits that security for free”</em></blockquote><h3>Bonus Resources</h3><p>Want to go deeper on VPC and AWS networking? These are the best places to start:</p><p><a href="https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html">AWS VPC User Guide</a> — The complete official reference for VPC — subnets, route tables, gateways, and everything else.</p><p><a href="https://aws.amazon.com/vpc/pricing/">VPC Pricing</a> — What’s free and what costs money inside a VPC — including NAT Gateway and VPC endpoints.</p><p><a href="https://docs.aws.amazon.com/vpc/latest/userguide/VPC_SecurityGroups.html">Security Groups Reference</a> — Full docs on Security Groups — rules, limits, and how they interact with NACLs.</p><p><a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-network-acls.html">Network ACLs Docs</a> — Deep dive into NACLs — rule numbering, stateless behaviour, and use cases.</p><p><a href="https://docs.aws.amazon.com/vpc/latest/userguide/vpc-nat-gateway.html">NAT Gateway Guide</a> — When you’re ready to use NAT — official docs on setup, pricing, and alternatives.</p><p><a href="https://aws.amazon.com/architecture/reference-architecture-diagrams/?solutions-all.sort-by=item.additionalFields.sortDate&amp;solutions-all.sort-order=desc&amp;awsf.category=categories%23networking">AWS Architecture Diagrams</a> — Official AWS reference architectures — see how real applications use VPC in production.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2044182b9755" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS for Beginners (Part 3): Deep Dive into EC2—Launch an Amazon Linux Server as the Cloud Developer]]></title>
            <link>https://medium.com/@deepakcardoza/aws-for-beginners-part-3-deep-dive-into-ec2-launch-an-amazon-linux-server-as-the-cloud-developer-338ebb00b58c?source=rss-cbfe363f8f26------2</link>
            <guid isPermaLink="false">https://medium.com/p/338ebb00b58c</guid>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[amazon-linux-2023]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <dc:creator><![CDATA[Deepak Cardoza]]></dc:creator>
            <pubDate>Tue, 28 Apr 2026 04:50:19 GMT</pubDate>
            <atom:updated>2026-04-28T04:50:19.698Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS for Beginners (Part 3): Deep Dive into EC2 — Launch an Amazon Linux Server the Cloud Developer Way</h3><p>Amazon Linux, SSH, key pairs, User Data — and watching your own server serve a live webpage the moment it boots, without a single manual step.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O0rPwEJlHD4n-Lp27524VQ.jpeg" /></figure><p>In <a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-2-launching-your-first-amazon-ec2-virtual-server-%EF%B8%8F-da6c210d9a72">Part 2 of this series</a>, we launched a Windows cloud machine via Remote Desktop and saw a real desktop appear on screen. That was a great first confidence builder — now it’s time to go deeper. Check out Part 2 blog if you haven’t read it yet.</p><p><a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-2-launching-your-first-amazon-ec2-virtual-server-%EF%B8%8F-da6c210d9a72">AWS for Beginners (Part 2): Launching Your First Amazon EC2 Virtual Server ☁️</a></p><p>In the real world, most cloud servers don’t run Windows. They run <strong>Linux</strong> — it’s faster, lighter, free to run, and nearly every tutorial, framework, and DevOps tool in existence is built with Linux in mind. So in this post, we’re switching gears.</p><p>We’ll launch an <strong>Amazon Linux</strong> instance, understand what makes it special, connect to it via SSH, and use a powerful EC2 feature called <strong>User Data</strong> to automatically set up and serve a live webpage — all without logging in and running a single command manually. Let’s go. 🐧</p><h3>Table of Contents</h3><p>· <a href="#495d">What is Amazon Linux — and Why Does It Exist?</a><br>· <a href="#7c4a">Which OS Should You Choose?</a><br>· <a href="#818f">Key Pairs — The Lock &amp; Key of AWS</a><br>· <a href="#e3fe">Launching Your Amazon Linux Instance</a><br>· <a href="#87b7">User Data — Let the Server Set Itself Up</a><br>· <a href="#cb78">Open Your Browser — Your Server is Already Live!</a><br>· <a href="#72b3">Connecting via SSH</a><br>· <a href="#0b44">Verify nginx from Inside the Server (Optional)</a><br>· <a href="#4d1b">What’s Next?</a><br>· <a href="#f4d3">Conclusion</a><br>· <a href="#f769">Bonus Resources</a></p><h3>What is Amazon Linux — and Why Does It Exist?</h3><p>If you’ve heard of Linux before, you’ve probably heard of Ubuntu, Debian, or Fedora. These are popular Linux “distributions” (distros) — essentially different versions of Linux, each with its own flavor, tools, and package manager.</p><p><strong>Amazon Linux is AWS’s own Linux distribution</strong> — built from scratch specifically to run on EC2. AWS created it, maintains it, and optimizes it for its cloud environment. It comes pre-installed with AWS-specific tools, runs extremely efficiently on EC2 hardware, and receives security patches directly from Amazon.</p><blockquote><strong>💡 Amazon Linux Is Not a General-Purpose OS: </strong>You won’t find Amazon Linux on your home PC or laptop — it’s designed purely for cloud servers. Most AWS tutorials and official documentation default to Amazon Linux, which means when you learn on it, you’re learning the “AWS native” way. That’s a real advantage when following along with AWS docs or courses.</blockquote><p>Amazon Linux 2023 (AL2023) is a major update over the older Amazon Linux 2, with a modern package manager, better security defaults, and long-term support from AWS. This version is scheduled to reach its End of Life (EOL) on June 30, 2028.</p><p>In short, End of Life means the date when AWS will stop providing security patches, bug fixes, and technical assistance for this specific version. It is also important to note that AWS is likely to launch a newer major version (such as AL2025) in the near future to stay current with the latest software ecosystems.</p><h3>Which OS Should You Choose?</h3><p>When launching an EC2 instance, you’ll see a long list of AMI options. It can feel overwhelming. Here’s a simple breakdown of the most common ones and when each makes sense:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*VJGuV0iQYNfq6aLU49sWCg.png" /><figcaption>Choosing a right OS for EC2</figcaption></figure><p>For this tutorial and for most of your AWS learning journey, <strong>Amazon Linux 2023 is your best friend</strong>. It’s free, fast, and AWS assumes you’re using it in most of their documentation.</p><blockquote><strong>💡 Amazon Linux 2023 Uses dnf, Not apt: </strong>If you’ve ever used Ubuntu, you’re used to apt install. Amazon Linux 2023 uses dnf as its package manager (older AL2 used yum). They do the same job — just a different name. Don&#39;t let it trip you up when following other tutorials. sudo dnf install nginx -y is the AL2023 equivalent of sudo apt install nginx -y.</blockquote><h3>Key Pairs — The Lock &amp; Key of AWS</h3><p>When you SSH into a Linux server, you don’t use a username and password like you do on a website. Instead, AWS uses a <strong>cryptographic key pair</strong> — two mathematically linked files that work together like a lock and key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*3YromECPRGqaF79nK5v5tw.png" /><figcaption>Key Visuals</figcaption></figure><blockquote><strong>💡 Analogy: </strong>Think of it like a padlock. The public key is the open padlock mounted on your server’s door. The private key is the only key in the world that opens it — and only you have it. When you try to SSH in, your computer presents the private key, it matches the padlock, and the door opens. Someone with the wrong key (or no key at all) simply cannot get in.</blockquote><p>When creating a key pair in AWS, you’ll see two format options:</p><ul><li><strong>.pem</strong> — Works natively on Mac and Linux. Also works on Windows 10 and 11 with the built-in SSH client in PowerShell.</li><li><strong>.ppk</strong> — Used by <a href="https://putty.org/index.html">PuTTY</a>, an older SSH client for Windows. You can convert a .pem to .ppk using <a href="https://puttygen.com/">PuTTYgen</a> if needed — but most modern setups don’t require this.</li></ul><blockquote><strong>💡 Just Use .pem for Everything: </strong>If you’re on Windows 10 or 11, use<strong>.pem</strong>. Modern Windows ships with a built-in SSH client in PowerShell — no extra software needed. The only reason to use .ppk is if you’re on a very old Windows machine or specifically want PuTTY.</blockquote><blockquote><strong>⚠️ You Can Only Download the Key Once: </strong>AWS shows you the private key file exactly once — at the moment of creation. If you close the window without downloading, or lose the file later, you cannot retrieve it. Treat it like a physical house key. Store it somewhere safe: a dedicated ~/.ssh/ folder is a good habit.</blockquote><h3>Launching Your Amazon Linux Instance</h3><p>The process is very similar to the Windows launch in Part 2. The key differences are the AMI choice, the security group rules, and one extra step at the end — <strong>User Data</strong> — which is where the magic happens.</p><p><strong>1. Go to EC2 → Launch Instance</strong></p><ul><li>Log in to the <a href="https://console.aws.amazon.com/">AWS Console</a>. Search for EC2 in the top bar. Click it. Then click the big orange “Launch Instance” button.</li></ul><p><strong>2. Name Your Instance</strong></p><ul><li>Something like my-first-linux-server. Just a label — it helps you find it in the console later.</li></ul><p><strong>3. Choose Amazon Linux 2023 AMI</strong></p><ul><li>It’s the very first option on the Quick Start list — “Amazon Linux 2023 AMI”. It should show a Free tier eligible badge. Click Select.</li><li>✅ If you see “Amazon Linux 2” as well, ignore it. AL2 is older and being phased out. Always go with AL2023.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A9gBF8_rTUUHmDTAfZLLWQ.png" /><figcaption>EC2 -&gt; Launch Instance -&gt; Give Name &amp; Select AMI</figcaption></figure><p><strong>4. Instance Type: t2.micro or t3.micro</strong></p><ul><li>1 vCPU, 1 GB RAM — free, and more than enough for what we’re doing. This is the default.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oMII8nd7qbVgcCaH5foBqA.png" /><figcaption>Choose instance type t2 or t3 micro (Free Tier Eligible)</figcaption></figure><p><strong>5. Create a Key Pair</strong></p><ul><li>Click “Create new key pair”. Name it something like linux-key. Choose the RSA type and .pem format. Click Create. A file will download automatically — save it somewhere you&#39;ll remember, like your Downloads folder or a dedicated ~/.ssh/ directory.</li><li>🔑 You’ll need this file to SSH in later. Don’t lose it — it can’t be recovered.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1_hqsKlusV7NFJrywOiuPA.png" /><figcaption>Creating a Key Pair for SSH</figcaption></figure><p><strong>6. Security Group — Allow SSH + HTTP</strong></p><ul><li>Under “Network settings”, check the SSH and HTTP rules. AWS automatically adds an SSH rule. Set its source to <strong>My IP or Anywhere (It&#39;s easier)</strong>. Both the SSH and HTTP rules will be added.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*w4UFNxIfTnn_5vvdkBs-sA.png" /><figcaption>Security Group Rules</figcaption></figure><ul><li>💡 SSH (port 22) is your back door — only your IP needs it. HTTP (port 80) is the web door — we’re opening it to everyone, so anyone can visit your webpage via your public IP.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hy9tEN4aTZ1nLCKjSzoUEg.png" /><figcaption>Check the checkbox for SSH and HTTP</figcaption></figure><p><strong>7. Storage — Keep Default (8 GB)</strong></p><ul><li>For a Linux instance, 8 GB is fine for learning. Well within your free credit allowance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZefT2gtAOx5ZaKD0PsnQIQ.png" /><figcaption>Keep Default Settings</figcaption></figure><p><strong>8. User Data — The Magic Script ✨</strong></p><ul><li>Scroll all the way down and expand “Advanced details”. At the very bottom, find the “User data” text box. Paste the script from the <a href="#4c5c"><strong>next section below</strong></a> into this field. This script will run automatically the moment your instance boots — installing a web server, fetching your instance metadata, and writing a live HTML page, all before you even connect.</li><li>⚠️ Don’t click Launch yet — read <a href="#4c5c"><strong>Next Section</strong></a><strong> </strong>below first to understand what you’re pasting and why.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NtmZD-k3x-lODjE5Ck36QQ.png" /><figcaption>Paste User Data Code from <a href="#4c5c">Section Below</a></figcaption></figure><p><strong>9. Launch Instance!</strong></p><ul><li>Click the big orange “Launch Instance” button. Head to <em>View Instances</em> and wait for the status to show <strong>Running</strong> with a ✅ status check. Usually takes 60–90 seconds.</li></ul><h3>User Data — Let the Server Set Itself Up</h3><p>Before we look at the script, let’s understand what User Data actually is — because it’s one of the most useful and powerful EC2 features you’ll keep coming back to throughout your cloud career.</p><blockquote><strong>💡 Analogy: </strong>Imagine you hired someone to set up a new office computer. Instead of sitting next to them and telling them what to do step by step, you leave a printed instruction sheet on the desk: “When you first switch this on — install Chrome, connect to the Wi-Fi, and set the wallpaper.” User Data is exactly that note. Your server reads it the moment it wakes up for the first time and follows every instruction automatically.</blockquote><p>User Data is a shell script you attach to an EC2 instance <em>before launch</em>. AWS runs it automatically at first boot, as the root user. You can use it to:</p><ul><li>Install software — nginx, Node.js, Python, Docker, anything</li><li>Write configuration files or custom HTML pages</li><li>Start services so they’re ready before anyone connects</li><li>Pull your app’s latest code from GitHub automatically</li><li>Register the server with a monitoring tool or load balancer</li><li>Configure services to auto-restart every time the instance reboots</li></ul><blockquote><strong>💡User Data Runs Once — At First Boot Only: </strong>By default, User Data runs exactly once — when the instance first launches. If you stop and restart the instance later, it does <em>not</em> run again. However, because our script uses systemctl enable nginx, nginx will automatically restart on every future reboot — so your webpage stays live even if the server is restarted.</blockquote><h4>The User Data Script — Paste This</h4><p>Go back to the launch wizard, scroll to <strong>Advanced details → User data</strong>, and paste the entire script below:</p><pre>#!/bin/bash<br><br># This script runs automatically at first boot — no SSH needed<br><br># Step 1: Update all system packages<br>dnf update -y<br><br># Step 2: Install nginx (a lightweight, fast web server)<br>dnf install -y nginx<br><br># Step 3: Enable nginx — auto-starts on every future reboot<br>systemctl enable nginx<br><br># Step 4: Start nginx right now<br>systemctl start nginx<br><br># Step 5: Fetch this instance&#39;s live details from the EC2 Metadata Service<br># 169.254.169.254 is a special AWS-internal IP — only reachable from inside EC2<br># The TOKEN step is required by IMDSv2 (AWS&#39;s secure metadata API)<br><br>TOKEN=$(curl -s -X PUT &quot;http://169.254.169.254/latest/api/token&quot; \<br>  -H &quot;X-aws-ec2-metadata-token-ttl-seconds: 21600&quot;)<br><br>INSTANCE_ID=$(curl -s -H &quot;X-aws-ec2-metadata-token: $TOKEN&quot; \<br>  http://169.254.169.254/latest/meta-data/instance-id)<br><br>AZ=$(curl -s -H &quot;X-aws-ec2-metadata-token: $TOKEN&quot; \<br>  http://169.254.169.254/latest/meta-data/placement/availability-zone)<br><br>REGION=$(curl -s -H &quot;X-aws-ec2-metadata-token: $TOKEN&quot; \<br>  http://169.254.169.254/latest/meta-data/placement/region)<br><br>PUBLIC_IP=$(curl -s -H &quot;X-aws-ec2-metadata-token: $TOKEN&quot; \<br>  http://169.254.169.254/latest/meta-data/public-ipv4)<br><br># Step 6: Write a custom HTML page using the live instance details<br><br>cat &gt; /usr/share/nginx/html/index.html &lt;&lt; HTMLEOF<br>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot; /&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot; /&gt;<br>  &lt;title&gt;Hello from EC2!&lt;/title&gt;<br>  &lt;link href=&quot;https://fonts.googleapis.com/css2?family=Sora:wght@400;700;800&amp;display=swap&quot; rel=&quot;stylesheet&quot; /&gt;<br>  &lt;style&gt;<br>    * {<br>      box-sizing: border-box;<br>      margin: 0;<br>      padding: 0;<br>    }<br><br>    body {<br>      background: #0b0f1a;<br>      color: #e2e8f0;<br>      font-family: &#39;Sora&#39;, sans-serif;<br>      min-height: 100vh;<br>      display: flex;<br>      align-items: center;<br>      justify-content: center;<br>    }<br><br>    .card {<br>      background: #111827;<br>      border: 1px solid #1f2f4a;<br>      border-top: 4px solid #34d399;<br>      border-radius: 16px;<br>      padding: 48px 40px;<br>      max-width: 560px;<br>      width: 90%;<br>      text-align: center;<br>    }<br><br>    .emoji {<br>      font-size: 3rem;<br>      margin-bottom: 16px;<br>    }<br><br>    h1 {<br>      font-size: 2rem;<br>      font-weight: 800;<br>      color: #34d399;<br>      margin-bottom: 8px;<br>    }<br><br>    .sub {<br>      color: #7c8fa6;<br>      font-size: 15px;<br>      margin-bottom: 32px;<br>    }<br><br>    .info-grid {<br>      display: grid;<br>      grid-template-columns: 1fr 1fr;<br>      gap: 12px;<br>      margin-bottom: 28px;<br>    }<br><br>    .info-box {<br>      background: #1a2235;<br>      border: 1px solid #1f2f4a;<br>      border-radius: 10px;<br>      padding: 14px 10px;<br>    }<br><br>    .info-box .lbl {<br>      font-size: 11px;<br>      color: #7c8fa6;<br>      text-transform: uppercase;<br>      letter-spacing: 0.1em;<br>      margin-bottom: 4px;<br>    }<br><br>    .info-box .val {<br>      font-size: 14px;<br>      font-weight: 700;<br>      color: #38bdf8;<br>      word-break: break-all;<br>    }<br><br>    .footer-msg {<br>      font-size: 13px;<br>      color: #34d399;<br>      border-top: 1px solid #1f2f4a;<br>      padding-top: 20px;<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;card&quot;&gt;<br>    &lt;div class=&quot;emoji&quot;&gt;🎉&lt;/div&gt;<br>    &lt;h1&gt;Hello from EC2!&lt;/h1&gt;<br>    &lt;p class=&quot;sub&quot;&gt;You just served a real webpage from a cloud server you own.&lt;/p&gt;<br><br>    &lt;div class=&quot;info-grid&quot;&gt;<br>      &lt;div class=&quot;info-box&quot;&gt;<br>        &lt;div class=&quot;lbl&quot;&gt;Instance ID&lt;/div&gt;<br>        &lt;div class=&quot;val&quot;&gt;${INSTANCE_ID}&lt;/div&gt;<br>      &lt;/div&gt;<br>      &lt;div class=&quot;info-box&quot;&gt;<br>        &lt;div class=&quot;lbl&quot;&gt;Region&lt;/div&gt;<br>        &lt;div class=&quot;val&quot;&gt;${REGION}&lt;/div&gt;<br>      &lt;/div&gt;<br>      &lt;div class=&quot;info-box&quot;&gt;<br>        &lt;div class=&quot;lbl&quot;&gt;Availability Zone&lt;/div&gt;<br>        &lt;div class=&quot;val&quot;&gt;${AZ}&lt;/div&gt;<br>      &lt;/div&gt;<br>      &lt;div class=&quot;info-box&quot;&gt;<br>        &lt;div class=&quot;lbl&quot;&gt;Public IP&lt;/div&gt;<br>        &lt;div class=&quot;val&quot;&gt;${PUBLIC_IP}&lt;/div&gt;<br>      &lt;/div&gt;<br>    &lt;/div&gt;<br><br>    &lt;p class=&quot;footer-msg&quot;&gt;✅ Served by nginx · Auto-configured via EC2 User Data&lt;/p&gt;<br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br>HTMLEOF</pre><blockquote><strong>💡What is 169.254.169.254?: </strong>That’s the<strong>EC2 Instance Metadata Service (IMDS)</strong> — a special internal IP address that exists only inside AWS. It’s not on the internet and nobody outside your instance can ever reach it. When your server calls this address, AWS responds with that instance’s own details: its ID, region, IP address, and more. The TOKEN step (called IMDSv2) is a security measure AWS introduced to prevent other software on your server from reading your metadata without explicit permission.</blockquote><h3>Open Your Browser — Your Server is Already Live!</h3><p>Here’s the satisfying part. While you were reading this post and SSH-ing around, your User Data script was already running in the background at first boot — installing nginx, calling the metadata service, and writing your custom HTML page. You don’t need to do a single thing manually. The server is already serving.</p><p><strong>1. Copy Your Public IPv4 Address</strong></p><ul><li>Go to EC2 → Instances → click your instance. In the details panel, find “Public IPv4 address” and copy it. It’ll look something like <a href="http://35.154.103.211/">http://35.154.103.211</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3qh4AABqZ2svfcJ4xwFifg.png" /></figure><p><strong>2. Open It in Your Browser</strong></p><ul><li>Open a new browser tab and navigate to http://&lt;YOUR-PUBLIC-IP&gt;. Make sure it&#39;s <strong>http://</strong> and not <a href="https://./"><strong>https://</strong>.</a></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/653/1*MeUrStHdROHS2zI2cFopGw.png" /></figure><ul><li>⚠️ Your browser may try to redirect to https:// automatically — if that happens, manually type the full http:// address in the address bar and press Enter. We haven&#39;t set up SSL yet, so https won&#39;t work.</li></ul><p><strong>3. 🎉 See Your Page!</strong></p><ul><li>You’ll see the custom dark-themed page — showing your real Instance ID, Region, Availability Zone, and Public IP — all fetched live from the EC2 metadata service at boot time. That data is unique to your instance. Nobody else in the world has that exact page.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_6dxJCUobGz_UVSdbP7ZXg.png" /></figure><blockquote><strong>🤔 Page Not Loading? Don’t Panic!: </strong>If you open the browser immediately after the instance shows “Running”, the User Data script might still be finishing up — it can take<strong>60–90 seconds</strong>after the instance is marked running. Wait a moment and refresh. If it still doesn’t load after 2–3 minutes, double-check that your security group has port 80 open with source set to Anywhere (0.0.0.0/0).</blockquote><blockquote><strong>💡 Why Does the Page Survive a Restart? </strong>Because the User Data script included <em>systemctl enable nginx</em>. The <em>enable</em> command registers nginx as a system service that starts automatically on every boot — not just the first time. So even if you stop and restart your instance, open the browser with the new public IP and the page will be right there, served immediately. This is exactly how real production servers are configured to auto-recover.</blockquote><h3>Connecting via SSH</h3><p>Now, since our website on EC2 is running, let&#39;s get inside the EC2 machine via SSH. SSH stands for <strong>Secure Shell</strong>. It opens a secure, encrypted terminal session into your Linux server — like plugging a keyboard directly into the machine, except you’re doing it over the internet from your laptop.</p><p>Before connecting, we need to <strong>fix the permissions on your .pem key file</strong>. SSH requires that the private key file is readable only by you — it refuses to use it if anyone else could theoretically read it. This is a security measure, not a bug.</p><p><strong>On Mac or Linux (Terminal):</strong></p><pre># Step 1: Fix the key file permissions (only need to do this once)<br>chmod 400 ~/Downloads/linux-key.pem<br><br># Step 2: SSH into your instance<br># Replace &lt;YOUR-PUBLIC-IP&gt; with the Public IPv4 from your EC2 console<br>ssh -i ~/Downloads/linux-key.pem ec2-user@&lt;YOUR-PUBLIC-IP&gt;<br><br># Example:<br>ssh -i ~/Downloads/linux-key.pem ec2-user@54.123.45.67</pre><p><strong>On Windows (PowerShell):</strong></p><pre># No extra software needed — Windows 10/11 ships with a built-in SSH client<br><br>ssh -i &quot;C:\Users\YourName\Downloads\Linux Key Pair.pem&quot; ec2-user@&lt;YOUR-PUBLIC-IP&gt;<br><br># Example:<br>ssh -i &quot;C:\Users\Deepak\Downloads\Linux Key Pair.pem&quot; ec2-user@54.123.45.67</pre><blockquote><strong>💡 Where to Find Your Public IP: </strong>Go to EC2 → Instances → click your instance. In the details panel at the bottom, look for “<strong>Public IPv4 address”</strong>. Copy that value. <strong>Note:</strong> if you stop and restart an instance, the public IP changes (Because we did not assign an <a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/elastic-ip-addresses-eip.html">Elastic IP</a>) — you’ll need to copy the new one each time.</blockquote><blockquote><strong>🤔 “Are you sure you want to continue connecting?” — Don’t Panic! </strong>The first time you SSH into any new server, you’ll see a fingerprint warning. This is completely normal. Type<strong>yes</strong>and press Enter. SSH stores the server’s fingerprint locally so it won’t ask again for the same server.</blockquote><p>If everything works, you’ll see the Amazon Linux welcome banner:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mMpRmRovABLtVpW9RGO2wA.png" /><figcaption>Connecting to EC2 via SSH in Windows Powershell</figcaption></figure><p>⚠️Important Note: SSH Connection Timeout?</p><p>If you’re getting a <strong>connection timeout error while using SSH</strong>, even after setting everything correctly in AWS (security group, key pair, public IP), the issue might not be AWS at all.</p><p>When I tried connecting using my Wi-Fi provider (Deenet), I faced this exact issue (as you can see in the screenshot above) — the connection kept timing out.</p><p>Some <strong>network providers block port 22 (SSH)</strong> for security reasons.</p><p>💡 <strong>Quick Fix:</strong></p><ul><li>Try switching to a <strong>mobile hotspot or a different network</strong></li></ul><p>If it works on another network, your setup is correct — it’s just a network restriction.</p><p>That prompt — [ec2-user@ip-172-31-45-12 ~]$ — means you are now <em>inside your cloud server</em>. You&#39;re controlling a real computer running in an AWS data centre, from your terminal. That feeling never gets old. Now you can run any Linux commands (ls, pwd, mkdir, etc.) on your local Amazon Linux Computer (EC2).</p><h3>Verify nginx from Inside the Server (Optional)</h3><p>Since you’re already in, here are a few commands to verify your User Data script ran correctly:</p><pre># Check if nginx is running<br>sudo systemctl status nginx<br># Look for: Active: active (running) ✅ = If you&#39;re able to see Website on browser, It&#39;s running<br><br># Check the HTML file that User Data wrote<br>cat /usr/share/nginx/html/index.html<br># You&#39;ll see your custom HTML with the real instance values baked in<br><br># Check the User Data script execution log<br>sudo cat /var/log/cloud-init-output.log<br># This shows everything that ran at boot — great for debugging if something went wrong<br><br># Done? Exit the SSH session<br>exit</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hyO7Wa3q3YIXVE_8lRTRsA.png" /><figcaption>Running Status Check Commands on EC2</figcaption></figure><p><strong>⚠️ Don’t Forget to Terminate! </strong>Once you’re done, go back to the EC2 dashboard and terminate your instance to avoid any charges. EC2 → Instances → Select → Instance State →<strong>Terminate</strong></p><h3>What’s Next?</h3><p>You’ve now gone deep into EC2 — you understand Amazon Linux, key pairs, SSH, and User Data. Here’s where you stand in the series:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/987/1*Lx5u7AjYLW9cU3E9IsR8RQ.png" /></figure><p>In <strong>Part 4</strong>, we go deep on <strong>VPC (Virtual Private Cloud)</strong> — the networking backbone that everything in AWS sits inside. You’ll learn how to build your own private network from scratch: public and private subnets, internet gateways, route tables, and NAT gateways. It’s where EC2 and AWS networking finally click together.</p><h3>Conclusion</h3><p>You just did something most people take weeks to get to. You launched a Linux server in the cloud, connected to it over SSH, and watched your own webpage load in a browser — served by a machine you configured with a script, without a single manual step after clicking Launch.</p><p>That’s not just a tutorial exercise. That’s exactly how real servers get deployed in production. User Data, nginx, systemctl enable — these are the building blocks of every cloud-deployed application you’ve ever visited. Now you understand how they work from the inside.</p><p>See you in Part 4, where we build the network that makes all of this work properly.</p><blockquote><em>“A server in the cloud is just a computer waiting for you to tell it what to do. The terminal doesn’t care who you are — only that you showed up and typed the right thing”</em></blockquote><h3>Bonus Resources</h3><p>Want to go further? Here are some official resources to bookmark:</p><p><a href="https://aws.amazon.com/linux/amazon-linux-2023/">Amazon Linux 2023</a> — Official page for AL2023 — features, support timeline, and migration from AL2.</p><p><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/user-data.html">EC2 User Data Docs</a> — AWS’s official guide to User Data — scripts, cloud-init, and advanced usage.</p><p><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-instance-metadata.html">Instance Metadata Service</a> — Full reference for the EC2 metadata endpoint — everything your instance can learn about itself.</p><p><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html">EC2 Key Pairs</a> — Creating, managing, and recovering key pairs in AWS — the complete reference.</p><p><a href="https://www.ssh.com/academy/ssh">SSH Explained</a> — A gentle deep-dive into how SSH works, public/private keys, and secure connections.</p><p><a href="https://nginx.org/en/docs/beginners_guide.html">nginx Beginner’s Guide</a> — The official nginx intro — configuration, serving files, and basic setup.</p><ul><li><a href="https://medium.com/@deepakcardoza/aws-for-beginners-from-zero-to-your-first-cloud-website-fc1726ba8b2b">AWS for Beginners: From Zero to Your First Cloud Website 🚀</a></li><li><a href="https://medium.com/@deepakcardoza/aws-for-beginners-part-2-launching-your-first-amazon-ec2-virtual-server-%EF%B8%8F-da6c210d9a72">AWS for Beginners (Part 2): Launching Your First Amazon EC2 Virtual Server ☁️</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=338ebb00b58c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS for Beginners (Part 2): Launching Your First Amazon EC2 Virtual Server ☁️]]></title>
            <link>https://medium.com/@deepakcardoza/aws-for-beginners-part-2-launching-your-first-amazon-ec2-virtual-server-%EF%B8%8F-da6c210d9a72?source=rss-cbfe363f8f26------2</link>
            <guid isPermaLink="false">https://medium.com/p/da6c210d9a72</guid>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[windows]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Deepak Cardoza]]></dc:creator>
            <pubDate>Tue, 21 Apr 2026 05:34:08 GMT</pubDate>
            <atom:updated>2026-04-21T05:34:48.009Z</atom:updated>
            <content:encoded><![CDATA[<p>Rent a real computer in the cloud, control it from your laptop, and actually run things on it — no hardware required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q93DkG3mpkA3sTETq029Yg.png" /></figure><p>In Part 1 of this series, we explored what AWS is, toured the console, and even launched a static website on S3 — all without touching a single server. Pretty cool, right?</p><blockquote>“If you’re a complete beginner and want to get the basics down first, <strong>check out Part 1 here</strong>. We covered the AWS fundamentals and launched an S3 website — it’s the perfect place to start!</blockquote><p><a href="https://medium.com/@deepakcardoza/aws-for-beginners-from-zero-to-your-first-cloud-website-fc1726ba8b2b">AWS for Beginners: From Zero to Your First Cloud Website 🚀</a></p><blockquote>Already got the basics down and just want to dive straight into EC2? You’re in the right place — keep reading below.</blockquote><blockquote><strong>P.S.</strong> If you ran into any issues or have questions about the S3 setup, feel free to drop a comment on my <a href="https://www.linkedin.com/posts/deepak-cardoza-b544961aa_aws-for-beginners-from-zero-to-your-first-activity-7449442807460597760-93vU?utm_source=share&amp;utm_medium=member_desktop&amp;rcm=ACoAADDWV_ABc-JxgN6E2hA2S6IkVYNiQeFub7E"><strong>LinkedIn post here</strong></a>. I’m happy to help you troubleshoot!”</blockquote><p>At some point, you’re going to want more than a simple website. A static HTML page is great, but what if you need to run a real application — a Node.js backend, a Python script, a WordPress site, or even a full Windows desktop in the cloud? That’s where <strong>Amazon EC2</strong> comes in.</p><p>EC2 stands for <strong>Elastic Compute Cloud</strong>. Don’t let the name intimidate you — it’s just a fancy way of saying: <em>a computer you can rent in the cloud, start in minutes, and access from anywhere in the world.</em></p><p>By the end of this post, you’ll have launched your very own cloud machine — and you’ll actually see a Windows desktop appear on your screen, running entirely on AWS. Let’s go. 🚀</p><h3>Table of Contents</h3><p>· <a href="#f2b9">What Exactly is EC2?</a><br>· <a href="#c8ed">Key Components — What You Need to Know</a><br>· <a href="#52dd">Let’s Launch a Windows Cloud Machine! </a><br>· <a href="#47b0">What’s Next?</a><br>· <a href="#28a1">Conclusion</a><br>· <a href="#6101">Bonus Resources</a></p><h3>What Exactly is EC2?</h3><p>Think about your laptop. It has a processor (CPU), memory (RAM), storage (the hard drive), and runs an operating system like Windows or macOS. You use it to run apps, browse the web, and get work done.</p><p>An EC2 instance is <strong>exactly that</strong> — a computer. Instead of sitting on your desk, it’s running inside one of Amazon’s massive data centres somewhere in the world. And instead of buying it, you <em>rent</em> it — by the hour, or even by the second.</p><blockquote><strong>💡 Real-World Analogy</strong></blockquote><blockquote>Buying a server yourself is like buying a house — a huge upfront cost, you own it forever, and if you don’t need it anymore, it just sits there costing you money. EC2 is like renting an apartment. You pay only for the time you’re using it, you can upgrade to a bigger one whenever you want, and you can move out (terminate the instance) the moment you’re done.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/975/1*X0JrDeahb_labL5HBMmzTA.png" /></figure><blockquote>💡<strong>New AWS Free Tier (July 2025 onwards)</strong></blockquote><blockquote>AWS completely revamped its free tier. If you created your <strong>account after July 15, 2025</strong>, you <strong>get $100 in credits immediately on sign-up</strong> — and you can earn <strong>another $100 by completing 5 short activities </strong>(like launching an EC2 instance!), for a total <strong>of $200 in free credits</strong>.</blockquote><blockquote>Credits are valid for 6 months or until used up. On a Free plan, you won’t be charged at all until you upgrade. On older accounts (created before July 15, 2025), the original 12-month free tier still applies.</blockquote><h3>Key Components — What You Need to Know</h3><p>When you launch an EC2 instance, AWS will ask you to make a few choices. Most beginners click through these without understanding what they mean — and then things break and they don’t know why. Let’s fix that right now.</p><p>Think of launching an EC2 instance like ordering a custom-built PC. You have to choose the operating system, how much RAM and storage you want, what ports are open, and where it lives on the network. Each of these has a name in AWS. Here they are:</p><h4>AMI — Amazon Machine Image</h4><p>An AMI is basically a <strong>pre-packaged snapshot of an operating system</strong>. When you launch an EC2 instance, you pick an AMI and AWS uses it to set up your machine — pre-installed with an OS and sometimes extra software.</p><blockquote><strong>💡 </strong>An AMI is like a bootable USB drive that already has Windows or Linux installed. Instead of installing the OS yourself, you just pick the AMI and your machine comes pre-loaded and ready to go.</blockquote><p>Some popular AMIs you’ll see:</p><ul><li><strong>Amazon Linux 2023</strong> — AWS’s own Linux OS, fast, free, and optimized for the cloud. Great for servers and backend work.</li><li><strong>Ubuntu</strong> — A very popular Linux distro, widely used by developers. Tons of tutorials are available online.</li><li><strong>Windows Server 2025</strong> — Full Windows environment. Connect to it using Remote Desktop — just like your home PC.</li><li><strong>Red Hat / SUSE</strong> — Enterprise Linux options for organizations. Usually paid.</li></ul><blockquote><strong>💡 Good to know: </strong>You can also create your own custom AMI — for example, you set up your server exactly how you want it, install all your software, then save it as an AMI. Now you can launch 10 identical copies of that server in seconds. This is how companies scale their apps.</blockquote><h4>Instance Type — Choose Your Machine’s Power</h4><p>An instance type defines how much CPU and RAM your machine gets. AWS has hundreds of options, but as a beginner, you really only need to know a few.</p><blockquote>💡Choosing an instance type is like choosing a phone model. A t2.micro is like a basic entry-level phone — gets the job done for simple tasks. A c6i.8xlarge is like the latest Pro Max — blazing fast, lots of power, and costs accordingly.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/892/1*LXDY6rp-hQn-GuSjnUv1OQ.png" /></figure><p>For everything we’re doing in this blog, <strong>t2.micro or t3.micro</strong> is perfect. The cost is tiny and well within your free credits — more than enough to get started.</p><h4>Storage — EBS (Elastic Block Store)</h4><p>Every EC2 instance needs a hard drive — a place to store the OS, your files, and your apps. In AWS, this is called an <strong>EBS volume</strong>.</p><p>When you launch an instance, you’ll be asked how much storage you want (in GB). The default is usually 8 GB for Linux or 30 GB for Windows. Storage costs are small and well covered by your free credits.</p><blockquote><strong>⚠️ Important: </strong>Even when you <em>stop</em> your EC2 instance (like shutting down your PC), the EBS storage remains and keeps accumulating a small charge. To completely avoid storage charges, you need to <em>terminate</em> the instance — which deletes everything. Always terminate instances you no longer need.</blockquote><h4>Security Groups — Your Cloud Firewall</h4><p>A security group is like a <strong>bouncer at the door of your server</strong>. It controls what traffic is allowed in (inbound) and what’s allowed out (outbound). You define rules like: “only allow connections on port 22 (SSH)” or “allow web traffic on port 80.”</p><blockquote>💡 Imagine your house has multiple doors — a front door (port 80 for web), a service entrance (port 22 for SSH), and a side window (port 3389 for Remote Desktop). A security group is the list of which doors are unlocked, and who’s allowed to use them. Everything else is locked by default.</blockquote><p>Common ports you’ll use:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/903/1*sTI6dY1gYiC3DmP2eFKk6A.png" /></figure><h4>VPC — Virtual Private Cloud</h4><p>When you launch an EC2 instance, it has to live <em>somewhere</em> — a private, isolated network in the cloud. That’s your <strong>VPC</strong>, or Virtual Private Cloud. Think of it as your own private neighbourhood in the AWS world, where your servers talk to each other.</p><p>By default, AWS creates a “default VPC” for you in each region, and your EC2 instances automatically go there. <strong>You don’t need to do anything about VPC for now</strong> — just know that it exists and that we’ll explore it in detail in the next post in this series.</p><blockquote><strong>🔜 Coming Next — VPC Deep Dive — </strong>In the next series, we’ll build a proper VPC from scratch — with public and private subnets, route tables, and internet gateways. For now, the default VPC is your friend.</blockquote><h4>Key Pairs — Your Password, But Better</h4><p>For Linux instances, instead of a traditional username + password login, AWS uses <strong>key pairs</strong>. This is a much more secure way to authenticate. You get two parts: a <strong>public key</strong> (which AWS keeps on your server) and a <strong>private key</strong> (which you download and keep on your laptop).</p><p>When you try to connect via SSH, your laptop uses the private key to prove its identity — no password needed. We’ll go deeper into this in Section 4 when we set up Amazon Linux.</p><blockquote><strong>⚠️ Never Lose Your Private Key. </strong>You can only download the private key <em>once</em>, at the time of creation. If you lose it, you cannot SSH into your instance. Treat it like a house key — keep it safe.</blockquote><h3>Let’s Launch a Windows Cloud Machine!</h3><p>Before we go deep, let’s have some fun. We’re going to launch a Windows machine in the cloud and actually see a full Windows desktop appear on your screen — within minutes. This is one of those moments that makes you go <em>“wait, this is real?”</em></p><blockquote><strong>💰 Bonus — This Section Earns You $20 in Credits! — </strong>Under the new AWS Free Tier (July 2025), one of the five credit-earning activities is: <em>“Launch an EC2 instance and terminate it.”</em> Completing the hands-on steps below automatically unlocks <strong>+$20 in AWS credits </strong>added to your account. So you’re not just learning — you’re literally earning credits while doing it. Make sure to terminate the instance at the end of this section to complete the activity and claim your reward!</blockquote><p><strong>1. Go to EC2 in the Console</strong></p><ul><li>Log in to the AWS Console. In the search bar at the top, type EC2 and click on it. You’re now in the EC2 Dashboard. Click the big orange “Launch Instance” button.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*idl4Jdv_OROj_dk6RWLiCw.png" /><figcaption>EC2 Dashboard</figcaption></figure><p><strong>2. Give Your Instance a Name</strong></p><ul><li>Under “Name and Tags”, type something like my-windows-cloud-pc. This is just a label so you can find it easily later.</li></ul><p><strong>3. Choose the Windows Server 2025 AMI</strong></p><ul><li>Under “Application and OS Images (Amazon Machine Image)”, click <em>Browse more AMIs</em>. In the search box, type <em>Windows Server 2025</em>. Select the one that says <strong>“Microsoft Windows Server 2025 Base”</strong>. Click <em>Select</em>.</li><li>Make sure it says <strong>“Free tier eligible”</strong> if you want to avoid charges — though note Windows instances are usually not free tier for compute.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*890ruv_eKIgxPbeH-x7r3A.png" /><figcaption>Creating an EC2 Instance with Instance name and AMI</figcaption></figure><p><strong>4. Choose Instance Type</strong></p><ul><li>Leave this as t2.micro or t3.micro. It&#39;s lightweight but enough to see the desktop and play around.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NQ25mL53TBrnWgY2KfDEJA.png" /><figcaption>Choosing Default Instance Type (t3.micro)</figcaption></figure><p><strong>5. Create a Key Pair</strong></p><ul><li>Click <em>“Create new key pair”</em>. Give it a name like windows-key. Leave the type as RSA and format as .pem. Click <em>Create key pair</em>. A file will download to your computer — keep this safe!</li><li>You’ll need this key file to retrieve your Windows password in a few minutes.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VDTdiCGASKyuJfWhSPOZ-g.png" /><figcaption>Creating a .pem Key Pair for Windows Instance</figcaption></figure><p><strong>6. Configure the Security Group</strong></p><ul><li>Under “Network settings”, check if you can see that the RDP Rule is enabled by default.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nba77aDcyCWIYkZG8xLqLA.png" /><figcaption>Configuring Default RDP Security Groups</figcaption></figure><ul><li>If not click <em>Edit</em>. You’ll see a default SSH rule. We need to add an RDP rule so we can connect via Remote Desktop. Click <em>“Add security group rule”:</em></li></ul><pre>Type   | Protocol | Port | Source<br>RDP    | TCP      | 3389 | Your IP Address or Select Anywhere for ease</pre><ul><li>⚠️ Choosing <strong>“My IP”</strong> restricts access to only your IP address — much safer than “Anywhere”.</li></ul><p><strong>7. Configure Storage</strong></p><ul><li>Leave the default storage as-is (usually 30 GB for Windows). This is covered under the free tier storage allowance.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Na9VIfH5hJ0FUA2GOW4FEw.png" /><figcaption>Configuring Storage (Default 30 GB EBS Volume)</figcaption></figure><p><strong>8. Launch!</strong></p><ul><li>Scroll down and click the big orange <em>“Launch Instance”</em> button. AWS will show you a success screen. Click <em>“View Instances”</em> to go back to your dashboard. You’ll see your instance with the status <strong>“Initializing”</strong> — give it 2–3 minutes to fully boot up.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-HMSF4y8_B-reNLV2QsC3g.png" /><figcaption>Successfully launched an EC2 Instance</figcaption></figure><p><strong>9. Get Your Windows Password</strong></p><ul><li>Once the instance shows <strong>“Running”</strong> and the status check shows, you will have to wait around 5 mins to generate the password, select your instance, click <em>Actions → Security → Get Windows Password</em>. Upload your .pem key file and click <em>Decrypt Password</em>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XVuhz6Le_1K2fZVXam82lQ.png" /><figcaption>Getting Windows Password using Private Key</figcaption></figure><ul><li>AWS will show you a username (<strong>Administrator</strong>) and a long password. Copy both.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EqG_dLWaaM2RMGermVhYQw.png" /><figcaption>Username and Password for RDP</figcaption></figure><p><strong>10. Connect via Remote Desktop (RDP)</strong></p><ul><li>Back on the instance page, click <em>Connect → RDP Client</em>. Click <em>“Download remote desktop file”</em> — a .rdp file will download. Open it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F19pQEAPG-6RLBX0Gg9iQA.png" /><figcaption>Downloading RDP Connection File</figcaption></figure><ul><li>When prompted for credentials, enter <strong>Administrator</strong> and the password you just decrypted. Hit <em>Connect</em>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3LTNaF7RsihIHVved_X1ig.png" /><figcaption>Connecting to RDP</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WfNA23nGZHhQzoalhIHEzQ.png" /><figcaption>Windows Cloud Machine Launched</figcaption></figure><p>🎉 A full Windows desktop will appear on your screen — running in the cloud!</p><blockquote><strong>Don’t Panic — Certificate Warning: </strong>When connecting via RDP, you might see a security certificate warning that says “The identity of the remote computer cannot be verified.” This is completely normal for EC2 instances. Just click <strong>Yes / Connect Anyway</strong>. The connection is still encrypted and safe.</blockquote><blockquote><strong>⚠️ Remember to Stop or Terminate — and Claim Your Credit! — </strong>Windows instances cost more than Linux ones. Once you’re done exploring, go back to the EC2 dashboard, select your instance, and click <strong>Instance State → Terminate</strong>. This also <strong>completes the EC2 credit activity</strong> — AWS requires you to both launch AND terminate the instance to unlock your +$20 credit. Check your Credits page in the Billing console after a few minutes to confirm it appeared.</blockquote><p>You just ran a Windows computer — in the cloud — without owning any hardware. That’s EC2 in action</p><h3>What’s Next?</h3><p>You’ve made real progress — you understand what EC2 is, you know the key components, and you’ve actually launched a cloud machine. Here’s where you stand in the series:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/984/1*Eyx34mq_nm5oYNaWrKZKXw.png" /><figcaption>Roadmap for AWS for Beginners Series</figcaption></figure><p>In <strong>Part 3</strong>, we go deeper into EC2 — switching to Amazon Linux, understanding how Linux differs from Windows in the cloud, setting up SSH, and using a powerful feature called <strong>User Data</strong> to automatically serve a webpage the moment your instance boots. No manual steps. Just launch and it’s live.</p><h3>Conclusion</h3><p>EC2 is the backbone of AWS — almost everything else in the cloud eventually runs on or connects to a compute instance like this. And now you’ve done it: you rented a computer in the cloud, connected to it, and saw a real Windows desktop appear on your screen.</p><p>That first launch is always the most satisfying. The intimidating part was just the idea of it — the reality is a few clicks and a minute of waiting. See you in Part 3, where we get into the real developer setup.</p><blockquote>“<em>The cloud isn’t magic — it’s just someone else’s computer. The magic is that you can have one running in 60 seconds, from anywhere in the world, without owning a single piece of hardware.</em>”</blockquote><h3>Bonus Resources</h3><p>Want to go further? Here are some official resources to bookmark:</p><p><a href="https://aws.amazon.com/ec2/">EC2 Official Page </a>— Overview of all EC2 features, pricing, and instance types from AWS.</p><p><a href="https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/concepts.html">EC2 User Guide</a> — AWS’s official documentation — the complete reference for EC2.</p><p><a href="https://aws.amazon.com/ec2/instance-types/">EC2 Instance Types</a> — Full list of every instance type, their specs, and use cases.</p><p><a href="https://aws.amazon.com/free/">AWS Free Tier Details</a> — Official page listing all always-free, 12-month, and credit-based free offers.</p><p><a href="https://aws.amazon.com/ec2/pricing/">EC2 Pricing</a> — On-demand, reserved, and spot pricing explained. Know before you launch.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da6c210d9a72" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS for Beginners: From Zero to Your First Cloud Website ]]></title>
            <link>https://medium.com/@deepakcardoza/aws-for-beginners-from-zero-to-your-first-cloud-website-fc1726ba8b2b?source=rss-cbfe363f8f26------2</link>
            <guid isPermaLink="false">https://medium.com/p/fc1726ba8b2b</guid>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[amazon-web-services]]></category>
            <category><![CDATA[beginners-guide]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[Deepak Cardoza]]></dc:creator>
            <pubDate>Mon, 13 Apr 2026 12:56:01 GMT</pubDate>
            <atom:updated>2026-04-20T07:17:39.685Z</atom:updated>
            <content:encoded><![CDATA[<p>No jargon. No overwhelm. Just clear explanations, real examples, and a hands-on project to get you started today.</p><p><strong>☁️Cloud Concepts · ⚙️Core AWS Services · 🔐Security Basics · 🌐Hands-On Project</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/863/1*bcW5QcHxux5TjY8XXrJjNg.jpeg" /><figcaption>Cloud Computing</figcaption></figure><h3>Table of Contents</h3><p>· <a href="#9363">What is the Cloud? ☁️</a><br>· <a href="#ddcb">What is AWS? 🏗️</a><br>· <a href="#0203">AWS Global Infrastructure 🌍</a><br>· <a href="#05aa">Key AWS Services — Beginner Map 🗺️</a><br>· <a href="#1f83">Creating Your AWS Account 🛠️</a><br>· <a href="#6a53">Navigating the AWS Console 🖥️</a><br>· <a href="#377f">IAM — Don’t Use Root for Everything! 🔐</a><br>· <a href="#3746">Billing — Don’t Panic 💸</a><a href="#9f60"> </a><br>· <a href="#4c59">Now Let’s Get You Started 🎉Launch Your First Website on AWS S3</a><br>· <a href="#31f2">What’s Next? Your Learning Roadmap 🗺️</a><br>· <a href="#0f39">Conclusion — You’ve Just Taken Your First Step into the Cloud ☁️</a><br>· <a href="#d922">Bonus Resources 🎁</a></p><h3>What is the Cloud? ☁️</h3><p>Let’s skip the textbook definition for a second. Here’s the simplest way to think about it:</p><blockquote><em>💡 </em>The cloud is just someone else’s powerful computer, that you can rent and access from anywhere in the world.</blockquote><p>Instead of buying your own server (a big, expensive machine), you pay for only what you use — storage, computing power, databases, all managed by a cloud provider. You access it over the internet, from any device, anywhere.</p><p>Here are two real examples you probably use every day without thinking about it:</p><p><strong>📁 Google Drive</strong><br>You don’t own physical storage, yet your photos and files are stored securely and accessible from your phone, laptop, or even a friend’s computer. That’s cloud storage in action.</p><p><strong>▶️ YouTube</strong><br> A video loads fast whether you’re in Mangaluru or New York. YouTube stores videos on servers around the world, and the one closest to you serves the video. This is what AWS calls <strong>Edge Locations, </strong>more on this soon!</p><p><strong>📧 Gmail</strong><br> Thousands of emails, attachments, and 15 GB of storage, none of it lives on your device. It’s in Google’s data centers (their version of the cloud). AWS does the same for businesses and developers.</p><p>👉 So when developers say they’re “moving to the cloud” or “deploying on AWS,” they simply mean: <em>instead of running their app on a computer in a room, they’re running it on rented computers managed by AWS.</em></p><h3>What is AWS? 🏗️</h3><p>Amazon Web Services (AWS) is the world’s most widely used cloud platform, launched by Amazon back in 2006. Today, it powers everything from tiny startups to Netflix, NASA, and even parts of the US government.</p><p>Think of AWS as a giant menu of cloud services, you pick what you need, pay for what you use, and AWS takes care of all the underlying hardware. No buying servers. No maintenance. No 3 AM panic calls when a hard drive fails.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/742/1*L3T3wgPjUSgD4nTaqCAQgw.jpeg" /><figcaption>Cloud Computing on AWS</figcaption></figure><p><strong>Current Global Footprint (April 2026):</strong></p><ul><li><strong>240+ Cloud Services</strong> (Fully featured services, though some counts exceed 500 when including sub-features).</li><li><strong>39 Regions</strong> (Now including recently launched regions like Malaysia and the Mexico Central region).</li><li><strong>123 Availability Zones</strong> (Every region now consists of a minimum of three isolated and physically separate AZs).</li><li><strong>750+ Edge Locations</strong> (Supported by 13 Regional Edge Caches across 100+ cities in 50+ countries).</li></ul><blockquote><strong>🙋 Don’t Panic:</strong> 240+ services sounds overwhelming, but here’s the truth: most developers only use 10–15 services regularly. You’ll learn them one at a time. Today, we’ll start with just one.</blockquote><h3>AWS Global Infrastructure 🌍</h3><p>One of the first things beginners find confusing is AWS’s global infrastructure. Let’s break it down once, clearly:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/912/1*HrE9Jse6Qr5UT_fgQQXoRg.png" /><figcaption>AWS Global Infrastructure</figcaption></figure><h4>How AWS is Structured</h4><p>Region → Availability Zone → Data Center → Edge Location</p><h4>Region</h4><p>A Region is a specific geographic area, like Mumbai, Virginia, or Singapore, where AWS operates a cluster of data centers. Each region is completely isolated from the others. You choose which region to deploy your app in, usually the one closest to your users. For India-based users, <em>ap-south-1 (Mumbai)</em> is the natural choice.</p><ul><li>39+ Regions worldwide</li><li>New regions continue to launch (like Malaysia &amp; Mexico)</li></ul><h4>Availability Zone (AZ)</h4><p>Within each Region, there are multiple Availability Zones; think of them as separate buildings a few kilometers apart. They’re connected by high-speed private fiber, but physically isolated so that if a flood or power outage hits one building, others stay up. Each AZ has one or more actual data centers inside it.</p><ul><li>123 Availability Zones globally</li></ul><h4>Data Center</h4><p>This is the actual physical building, filled with thousands of servers, cooling systems, power backups, and security. AWS owns and operates these. You never go here. You just use what’s inside.</p><h4>Edge Locations (CloudFront)</h4><p>Remember the YouTube example? Edge Locations are smaller AWS outposts in 700+ cities worldwide. They don’t run your app, but they <em>cache</em> (temporarily store) your content close to users. This is used by Amazon CloudFront (AWS’s CDN) so that a user in Bengaluru can access your content from a nearby edge location, rather than from a server in the US. Faster experience. Every time.</p><ul><li>750+ Edge Locations (Points of Presence)</li><li>13 Regional Edge Caches</li></ul><blockquote>💡 AWS offers one of the <strong>most extensive global cloud infrastructures</strong>, with <strong>240+ fully featured services</strong> (and even more if you include sub-features).</blockquote><h3>Key AWS Services — Beginner Map 🗺️</h3><p>You don’t need to know all 240+ services. Here are the essential ones that form the backbone of almost every AWS project:</p><h4>AWS IAM (Security)</h4><p>Identity and Access Management. <strong>Controls who can access what</strong> in your AWS account. You’ll use this on Day 1. More details in the next section.</p><h4>Amazon EC2 (Compute)</h4><p>Elastic Compute Cloud. A <strong>virtual computer </strong>in the cloud. You choose the CPU, RAM, OS, and run any app on it. It’s like renting a computer by the hour.</p><h4>Amazon S3 (Storage)</h4><p>Simple Storage Service. <strong>Store any file</strong> — images, videos, backups, websites. Practically unlimited storage. Think of it as Google Drive for your applications.</p><h4>Amazon RDS / Aurora (Database)</h4><p>Managed <strong>relational databases</strong> (MySQL, PostgreSQL). RDS is standard, Aurora is AWS’s supercharged version, faster and more scalable.</p><h4>Amazon DynamoDB (NoSQL)</h4><p>A <strong>NoSQL database</strong> built for scale. No fixed schema. Perfect for apps that need extremely fast reads/writes, think gaming leaderboards or shopping carts.</p><h4>AWS Lambda (Serverless)</h4><p><strong>Run code without managing servers</strong>. Upload a function, define a trigger (an API call, a file upload, a timer), and AWS runs it automatically. You pay per execution, not per hour.</p><h4>A Word on Serverless</h4><p>“<strong>Serverless</strong>” doesn’t mean there’s no server — it means <em>you</em> don’t manage one. With AWS Lambda, you write your function (in Python, Node.js, Java, etc.), upload it, and AWS handles everything else: scaling, patching, and uptime. A simple example: every time someone uploads a profile photo to S3, a Lambda function automatically resizes it. No server running 24/7. Pure magic.</p><blockquote><em>💡 </em>Serverless doesn’t mean there are <strong>no servers</strong> — it means there are no servers for <strong>you</strong> to manage.</blockquote><h3>Creating Your AWS Account 🛠️</h3><p>Ready to get your hands on AWS? Creating an account is straightforward. Here’s the quick overview:</p><p><strong>1. Go to aws.amazon.com and click “Create an AWS Account”</strong></p><ul><li>You’ll need a valid email address. This becomes your root account, the master key. Treat it carefully.</li></ul><p><strong>2. Choose your account plan — Free Plan or Paid Plan</strong></p><ul><li>For beginners, the Free Plan is perfect. No charges until you upgrade. More on credits below.</li></ul><p><strong>3. Enter contact info and a credit/debit card</strong></p><ul><li>AWS requires a card for verification. Don’t worry, you won’t be charged if you stay within free tier limits. We’ll set up budget alerts for this.</li></ul><p><strong>4. Verify your identity via phone / OTP</strong></p><ul><li>A quick automated call or SMS to verify your number.</li></ul><p><strong>5. Choose Support Plan → Select “Basic (Free)”</strong></p><ul><li>The free plan is enough to get started. You can always upgrade later.</li></ul><p><a href="https://docs.aws.amazon.com/accounts/latest/reference/manage-acct-creating.html">Create an AWS account</a></p><h3>Navigating the AWS Console 🖥️</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YrZeolzF2KCo2o4QdEDvEg.png" /><figcaption>AWS Console (Logged in as an IAM User)</figcaption></figure><p>Once you sign up, you’ll land on the AWS Management Console, a web-based dashboard where you can use and manage all AWS services. It looks busy at first, but here’s what you actually need to know:</p><ul><li><strong>Search Bar (Top Center)</strong> → The most important thing on the page. Type any service name “S3”, “EC2”, “Lambda” — and jump straight to it. Don’t memorize menus, just search.</li><li><strong>Region Switcher (Top Right)</strong> → Shows your current region (e.g. “Asia Pacific, Mumbai”). Always double-check this. Resources you create in one region won’t appear in another. Many beginners get confused here!</li><li><strong>Services Menu (Top Left)</strong> → Grouped by category: Compute, Storage, Database, Security, etc. Good for exploring, but the search bar is faster for daily use.</li><li><strong>Account Menu (Top Right, your name)</strong> → Access billing, your account settings, security credentials, and switch roles. Keep an eye on the Billing Dashboard here — especially when you’re just getting started.</li></ul><blockquote><em>💡</em>Bookmark the <a href="http://console.aws.amazon.com/">AWS Console URL</a>. And always check the region switcher before you start working — it’s the #1 reason beginners say “I can’t find my resources!”</blockquote><h3>IAM — Don’t Use Root for Everything! 🔐</h3><p>This is one of the most important things you’ll learn on Day 1. When you create your AWS account, you become the root user. Think of root as the CEO of your AWS account — it has unlimited access to everything, including deleting the entire account.</p><blockquote><strong>⚠️ Important Rule</strong></blockquote><blockquote>Never use your root account for day-to-day work. It’s like using your master password for every login. If it’s compromised, everything is gone. AWS itself recommends this.</blockquote><h4>So what is IAM?</h4><p>AWS IAM (Identity and Access Management) is the service that lets you create users, groups, and roles — and precisely control what each one can access. For example, you can create an IAM user that can only read from S3 but can’t delete anything. Or a role that allows your Lambda function to write to a database — nothing more.</p><h4>The Principle of Least Privilege</h4><p>This is a fundamental security concept: <em>give users and services only the minimum permissions they need to do their job — nothing more.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9N0_eSKzWHRho8Ym" /><figcaption>Photo by <a href="https://unsplash.com/@davelowephoto?utm_source=medium&amp;utm_medium=referral">Dave Lowe</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Real-world analogy: A hotel housekeeper gets a master key to enter guest rooms and clean them — but not the key to the safe, the accounting room, or the server room. They have exactly what they need, nothing extra. That’s least privilege.</p><h4>Best Practices from Day 1</h4><p><strong>✓ Enable MFA on your root account immediately</strong></p><ul><li>Multi-Factor Authentication adds a second layer — even if your password leaks, no one can log in without your phone. Go to IAM → Security Recommendations to set it up.</li></ul><p><strong>✓ Create an IAM user for daily work</strong></p><ul><li>Give it admin access to start with, then tighten permissions as you learn more. Use this user — not root — for everything from here on.</li></ul><p><strong>✓ Never share your root credentials</strong></p><ul><li>And never embed them in code. Use IAM roles and environment variables instead.</li></ul><p><strong>✓ Lock away the root account</strong></p><ul><li>Use root only for account-level tasks like changing billing info or closing the account. That’s it.</li></ul><h3>Billing — Don’t Panic 💸</h3><p>The number one fear for AWS beginners: <em>“What if I get a surprise bill?”</em> Totally valid concern. Here’s the good news:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/926/1*AI7bbdB7ICWno8I1rNSoAA.png" /></figure><p>AWS updated its free tier in <strong>July 2025</strong>. Here’s how it works now for new accounts:</p><p><strong>Free Plan (new accounts)</strong>: You get <strong>$100 in credits immediately</strong> upon sign-up. Complete 5 simple onboarding activities (like launching EC2, trying RDS, or setting up a budget) and earn an additional <strong>$100 in credits </strong>— totaling up to $200. The Free Plan lasts <strong>6 months</strong> or until credits are exhausted, whichever comes first.</p><p>Additionally, AWS offers 30+ Always Free services with monthly usage limits — for example, 1 million Lambda requests/month is always free, forever.</p><h4>Set a Budget Alert — 5 Steps</h4><p>Do this immediately after creating your account. This notifies you before you cross your spending limit:</p><p><strong>1. Go to AWS Console → Search “Budgets” or navigate to Billing → Budgets</strong></p><ul><li>Or visit: console.aws.amazon.com/billing/home#/budgets</li></ul><p><strong>2. Click “Create a budget”</strong></p><ul><li>You’ll see two options — choose “Use a template (simplified)”.</li></ul><p><strong>3. Select “Monthly cost budget” template</strong></p><ul><li>This is the simplest and most useful template for beginners.</li></ul><p><strong>4. Set your budget amount — start with $1</strong></p><ul><li>This helps keep your usage close to zero. You can also set an alert at around $0.1 so you’re notified almost immediately if any cost is incurred.</li></ul><p><strong>5. Enter your email and click “Create budget”</strong></p><ul><li>Done! AWS will now email you if you’re forecasted to exceed or actually exceed your budget. Peace of mind, secured.</li></ul><p><a href="https://docs.aws.amazon.com/cost-management/latest/userguide/budget-templates.html">Using a budget template (simplified)</a></p><blockquote><em>💡</em>Setting up a budget in AWS Budgets also earns you $20 in free credits as part of the onboarding activities! So it literally pays to be responsible. 😄</blockquote><h3>Now Let’s Get You Started 🎉<br>Launch Your First Website on AWS S3</h3><p>Enough theory — let’s build something real. We’re going to host a live website on Amazon S3 in about 10 minutes. No EC2. No server. Just a storage bucket that serves a webpage to the entire world.</p><p>This is actually how real teams deploy React apps, static sites, documentation portals, and frontend builds. You’re not doing a toy exercise — this is production-grade stuff.</p><h4>Step 1 — Create Your index.html File</h4><p>Copy the code below and save it as index.html on your computer:</p><pre>&lt;!DOCTYPE html&gt;<br>&lt;html lang=&quot;en&quot;&gt;<br>&lt;head&gt;<br>  &lt;meta charset=&quot;UTF-8&quot; /&gt;<br>  &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;/&gt;<br>  &lt;title&gt;My First AWS Website 🚀&lt;/title&gt;<br>  &lt;style&gt;<br>    * { margin: 0; padding: 0; box-sizing: border-box; }<br>    body {<br>      background: #0b0f1a;<br>      color: #e2e8f0;<br>      font-family: &#39;Segoe UI&#39;, sans-serif;<br>      display: flex;<br>      align-items: center;<br>      justify-content: center;<br>      min-height: 100vh;<br>      text-align: center;<br>    }<br>    .card {<br>      background: #111827;<br>      border: 1px solid #1f2f4a;<br>      border-radius: 20px;<br>      padding: 48px 40px;<br>      max-width: 480px;<br>    }<br>    .emoji { font-size: 4rem; margin-bottom: 20px; }<br>    h1 { font-size: 2rem; font-weight: 800; margin-bottom: 12px; }<br>    h1 span { color: #f59e0b; }<br>    p { color: #7c8fa6; line-height: 1.7; margin-bottom: 20px; }<br>    .badge {<br>      display: inline-block;<br>      background: rgba(52,211,153,0.1);<br>      border: 1px solid rgba(52,211,153,0.3);<br>      color: #34d399;<br>      padding: 8px 20px;<br>      border-radius: 100px;<br>      font-size: 14px;<br>      font-weight: 600;<br>    }<br>  &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>  &lt;div class=&quot;card&quot;&gt;<br>    &lt;div class=&quot;emoji&quot;&gt;☁️&lt;/div&gt;<br>    &lt;h1&gt;Hello from &lt;span&gt;AWS&lt;/span&gt;!&lt;/h1&gt;<br>    &lt;p&gt;<br>      This page is hosted on &lt;strong style=&quot;color:#fff&quot;&gt;Amazon S3&lt;/strong&gt; — <br>      no server, no backend. Just a file in a bucket, <br>      served to the entire world. 🌍<br>    &lt;/p&gt;<br>    &lt;div class=&quot;badge&quot;&gt;✅ Live on AWS S3&lt;/div&gt;<br>  &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;</pre><h4>Step 2 — Create an S3 Bucket</h4><p><strong>1. Go to the AWS Console → Search “S3” → Click “Create bucket”</strong></p><ul><li>Make sure your region is set to your preferred location (e.g. ap-south-1 for Mumbai).</li></ul><p><strong>2. Give your bucket a unique name</strong></p><ul><li>Bucket names are globally unique across all AWS accounts. Try something like my-first-aws-site-yourname. Keep it lowercase, no spaces.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZrKICcOCmV01sP0lCR8Xcg.png" /><figcaption>AWS Console -&gt; S3 -&gt; Create Bucket</figcaption></figure><p><strong>3. Uncheck “Block all public access”</strong></p><ul><li>By default, S3 blocks public access. For a public website, we need to allow it. Uncheck this and acknowledge the warning — it’s expected for a static site.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g2vHkWgp90yfvjM2yJK2nA.png" /><figcaption>Uncheck “Block all public access” and Acknowledge</figcaption></figure><p><strong>4. Click “Create bucket”</strong></p><ul><li>Your bucket is ready. Next, we’ll enable website hosting.</li></ul><h4>Step 3 — Enable Static Website Hosting</h4><p><strong>1. Click your bucket → Go to “Properties” tab</strong></p><ul><li>Scroll all the way down to find “Static website hosting”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xCOXEx6uIo3t86bpEVDS8Q.png" /><figcaption>S3 -&gt; Bucket Properties -&gt; Static Website Hosting</figcaption></figure><p><strong>2. Click “Edit” → Enable → Set index document to “index.html”</strong></p><ul><li>Save changes. AWS will generate a public website URL for your bucket.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gYnH2CfzeNiQPlPw6bGA6g.png" /><figcaption>S3 Bucket -&gt; Properties -&gt; Scroll to end and Find Static Website Hosting and Enable it</figcaption></figure><h4>Step 4 — Upload Your File &amp; Set Permissions</h4><p><strong>1. Go to “Objects” tab → Click “Upload” → Add your index.html</strong></p><ul><li>Click Upload. Your file is now in the bucket.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_ejTKpLrw7viWsAWGqapeA.png" /><figcaption>S3 Bucket -&gt; Objects Tab -&gt; Upload -&gt; Choose index.html and upload</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*loCKX5bbigNU8N3eov-U-w.png" /><figcaption>Upload Success</figcaption></figure><p><strong>2. Add a bucket policy to make files publicly readable</strong></p><ul><li>Go to “Permissions” tab → “Bucket Policy” → Paste the policy below (replace YOUR-BUCKET-NAME).</li></ul><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:::YOUR-BUCKET-NAME/*&quot;<br>    }<br>  ]<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zC8Ly2MU_2hA_O3YTDIffg.png" /><figcaption>S3 Bucket -&gt; Permissions -&gt; Edit Bucket Policy -&gt; Copy &amp; Paste above policy and replace bucket name</figcaption></figure><h4>Step 5 — Visit Your Live Website</h4><p>Go back to Properties → Static website hosting and copy the Bucket website endpoint URL. Paste it in your browser and — your page is live on the internet, hosted on AWS! 🎉</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xdVq1b76c5ImoV979OPzzg.png" /><figcaption>Static Website is hosted on AWS S3</figcaption></figure><blockquote><em>💡</em>This exact setup is used in production. When you run npm run build on a React or Next.js app, you get a folder of static files. Upload those files to S3 with static hosting enabled — and your frontend is deployed. Add CloudFront in front of it for a CDN + custom domain + HTTPS, and you&#39;ve got a production-grade setup.</blockquote><h3>What’s Next? Your Learning Roadmap 🗺️</h3><p>You’ve just deployed a live website to AWS. That’s Day 1 done. Here’s a suggested path forward — one step at a time:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*ftCj8_9Yx4V-sldPr9yR3Q.png" /></figure><p>The next stop is Amazon EC2 — where you’ll rent a virtual server, SSH into it, and run your own application. It’s where most backend deployments begin. Watch out for the next post in this series!</p><blockquote><strong>💡 What You Learned Today</strong></blockquote><blockquote>✦ What cloud computing is and why it exists ·✦ What AWS is and how big its infrastructure is · ✦ The Region → AZ → Data Center → Edge mental model · ✦ Core AWS services map · ✦ IAM basics and least privilege · ✦ Free tier and budget alerts · ✦ Hosting a live static website on S3</blockquote><h3>Conclusion — You’ve Just Taken Your First Step into the Cloud ☁️</h3><p>Cloud computing can feel intimidating from the outside — hundreds of services, unfamiliar terms, and a billing model that seems like it could surprise you at any moment. But as you’ve seen today, it doesn’t have to be that way. You now understand what the cloud actually is, how AWS organizes its global infrastructure, which services matter for beginners, and — most importantly — you’ve deployed a real, live website on AWS S3.</p><p>The key is to go one service at a time. Don’t try to learn everything at once. Master S3, then move to EC2, then build something real. Each service you learn compounds on the last.</p><blockquote>“The cloud is not a destination — it’s a skill you build one service at a time. Every expert in the room was once a beginner who simply refused to stop clicking.”</blockquote><blockquote>— Keep building, keep exploring</blockquote><h3>Bonus Resources 🎁</h3><p>Want to go deeper? Here are five essential AWS resources every beginner should bookmark:</p><p><a href="https://aws.amazon.com/architecture/well-architected/">AWS Well-Architected Framework</a> — 6 pillars of building reliable, secure, efficient cloud systems. Must-read.</p><p><a href="https://aws.amazon.com/compliance/shared-responsibility-model/">AWS Shared Responsibility Model</a> — What AWS secures vs. what YOU are responsible for. Critical for any cloud role.</p><p><a href="https://aws.amazon.com/free/">AWS Free Tier Details</a> — Official page listing all always-free, 12-month, and credit-based free offers.</p><p><a href="https://aws.amazon.com/what-is-cloud-computing/">Cloud Computing Benefits</a> — AWS’s official overview of the 6 advantages of cloud — agility, elasticity, cost savings, and more.</p><p><a href="https://explore.skillbuilder.aws/">AWS Skill Builder</a> — Free official AWS training platform. Start with “AWS Cloud Practitioner Essentials” — it’s free and excellent.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc1726ba8b2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Does Your Website Have SEO? Here’s How to Get It Right: Your Step-by-Step SEO Guide]]></title>
            <link>https://medium.com/@deepakcardoza/does-your-website-have-seo-heres-how-to-get-it-right-your-step-by-step-seo-guide-128b11e98cd2?source=rss-cbfe363f8f26------2</link>
            <guid isPermaLink="false">https://medium.com/p/128b11e98cd2</guid>
            <category><![CDATA[google-search-console]]></category>
            <category><![CDATA[sitemap]]></category>
            <category><![CDATA[crawling]]></category>
            <category><![CDATA[seo-tips]]></category>
            <category><![CDATA[seo]]></category>
            <dc:creator><![CDATA[Deepak Cardoza]]></dc:creator>
            <pubDate>Sat, 16 Nov 2024 08:47:29 GMT</pubDate>
            <atom:updated>2024-11-16T08:47:29.773Z</atom:updated>
            <content:encoded><![CDATA[<h4>Unlock the secrets of On-Page and Off-Page SEO to boost your site’s visibility, rank higher, and drive organic traffic effortlessly</h4><figure><img alt="Image with “SEO” text" src="https://cdn-images-1.medium.com/max/1024/0*GoDr7-lbQaTQq8dF" /><figcaption>Photo by <a href="https://unsplash.com/@merakist?utm_source=medium&amp;utm_medium=referral">Merakist</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Search Engine Optimization (SEO) enhances a website’s visibility on search engines like <em>Google</em>. When done right, SEO helps your site appear at the top of search results, attracting more visitors and increasing your chances of reaching the right audience. At its core, SEO involves optimizing various aspects of your site, from the content and structure (on-page SEO) to external factors like backlinks (off-page SEO).</p><p>In this guide, we’ll dive into actionable steps to improve your SEO, focusing on technical and practical aspects to ensure your website is fully optimized — and the best part? You can do it all for free! We’ll cover two essential techniques: <strong><em>On-Page SEO</em></strong> and <strong><em>Off-Page SEO</em></strong>, each playing a unique role in boosting your site’s visibility and ranking on search engines.</p><h4>Table of Contents</h4><p>· <a href="#efac">On-Page SEO — Optimizing Your Website Inside Out</a><br> ∘ <a href="#1424">Optimizing Speed and Performance</a><br> ∘ <a href="#4746">Check and Improve Your Site’s Speed</a><br> ∘ <a href="#2da1">Enhance Visibility with Meta Tags</a><br> ∘ <a href="#3d0b">Adding a Favicon</a><br>· <a href="#7b2c">Off-Page SEO — Making Your Website Discoverable</a><br> ∘ <a href="#c305">What is Crawling?</a><br> ∘ <a href="#ab5f">Steps to Create and Upload a Sitemap</a><br> ∘ <a href="#0f95">Bonus Tip — Take Your SEO Strategy to the Next Level</a><br> ∘ <a href="#f06d">Conclusion</a></p><h3>On-Page SEO — Optimizing Your Website Inside Out</h3><p>On-page SEO involves optimizing elements on your website to improve its visibility and relevance for search engines. This includes techniques like using targeted keywords, optimizing meta tags, improving content quality, and ensuring your site’s structure is easy for users and search engines to navigate. In short, it’s about making your website as search-friendly as possible from the inside out.</p><h4>Optimizing Speed and Performance</h4><p>To improve your website’s visibility and ranking, On-Page SEO is essential. One key factor is <em>page speed, performance</em>, and overall <em>user experience</em>. Search engines, like Google, prioritize sites that offer a seamless experience, so optimizing your site’s loading speed and performance is a must.</p><p>One effective way to boost speed is by using a <strong>Content Delivery Network (CDN)</strong>. A CDN distributes your site’s assets (like images and scripts) across multiple servers worldwide, ensuring users can load your site faster by accessing data from a server closer to them. Other methods include compressing images, minimizing CSS and JavaScript files, and enabling browser caching to reduce load times.</p><h4>Check and Improve Your Site’s Speed</h4><p>To check your site’s speed and get insights for improvement, use <a href="https://pagespeed.web.dev/"><strong>Google PageSpeed Insights</strong></a>. This tool provides separate scores and recommendations for both web and mobile performance, helping you make targeted improvements to optimize your site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WLvRmdiAJ6_hBBDCSbb7wg.png" /><figcaption>Google Page Speed Insights — Performance Check</figcaption></figure><h4>Enhance Visibility with Meta Tags</h4><p>Another crucial aspect of On-Page SEO is adding <strong>meta tags</strong> and detailed information that helps search engines understand your content. A convenient tool to set up these meta tags is <a href="https://metatags.io/"><strong>metatags.io</strong></a>. It allows you to add a title, preview images, keywords, and other details that enhance your site’s visibility in search results.</p><figure><img alt="Metatags.io — Screenshot of the Website" src="https://cdn-images-1.medium.com/max/1024/1*SP3_LSb26izmoyUDG3mkpQ.png" /><figcaption>Metatags.io — Generate Meta Tags with Ease</figcaption></figure><blockquote>Example Meta Tags</blockquote><pre>&lt;!-- Primary Meta Tags --&gt;<br>&lt;title&gt;Deepak Cardoza - Software Engineer at 7EDGE | AWS Certified Developer Associate&lt;/title&gt;<br>&lt;meta name=&quot;title&quot; content=&quot;Deepak Cardoza - Software Engineer at 7EDGE | AWS Certified Developer Associate&quot; /&gt;<br>&lt;meta name=&quot;description&quot; content=&quot;Backend Developer in cloud-native solutions at 7EDGE. AWS Certified in Cloud Practitioner and Developer Associate, with expertise in Node.js, Python, and serverless API development on AWS. Passionate about web apps, graphic design, and video editing.&quot; /&gt;<br><br>&lt;!-- Open Graph / Facebook --&gt;<br>&lt;meta property=&quot;og:type&quot; content=&quot;website&quot; /&gt;<br>&lt;meta property=&quot;og:url&quot; content=&quot;https://deepakcardoza.com/&quot; /&gt;<br>&lt;meta property=&quot;og:title&quot; content=&quot;Deepak Cardoza - Software Engineer at 7EDGE | AWS Certified Developer Associate&quot; /&gt;<br>&lt;meta property=&quot;og:description&quot; content=&quot;Backend Developer in cloud-native solutions at 7EDGE. AWS Certified in Cloud Practitioner and Developer Associate, with expertise in Node.js, Python, and serverless API development on AWS. Passionate about web apps, graphic design, and video editing.&quot; /&gt;<br>&lt;meta property=&quot;og:image&quot; content=&quot;https://metatags.io/images/meta-tags.png&quot; /&gt;<br><br>&lt;!-- Twitter --&gt;<br>&lt;meta property=&quot;twitter:card&quot; content=&quot;summary_large_image&quot; /&gt;<br>&lt;meta property=&quot;twitter:url&quot; content=&quot;https://deepakcardoza.com/&quot; /&gt;<br>&lt;meta property=&quot;twitter:title&quot; content=&quot;Deepak Cardoza - Software Engineer at 7EDGE | AWS Certified Developer Associate&quot; /&gt;<br>&lt;meta property=&quot;twitter:description&quot; content=&quot;Backend Developer in cloud-native solutions at 7EDGE. AWS Certified in Cloud Practitioner and Developer Associate, with expertise in Node.js, Python, and serverless API development on AWS. Passionate about web apps, graphic design, and video editing.&quot; /&gt;<br>&lt;meta property=&quot;twitter:image&quot; content=&quot;https://metatags.io/images/meta-tags.png&quot; /&gt;<br><br>&lt;!-- Meta Tags Generated with https://metatags.io --&gt;</pre><p>Primary Meta Tags</p><ul><li>&lt;title&gt;: This tag specifies the title of your webpage, which appears on the browser tab and in search engine results.</li><li>&lt;meta name=&quot;title&quot; content=&quot;...&quot;&gt;: Similar to the &lt;title&gt; tag, this meta tag defines the page title for search engines.</li><li>&lt;meta name=&quot;description&quot; content=&quot;...&quot;&gt;: This provides a summary of the page, helping search engines understand and display relevant content in search results.</li></ul><p>Open Graph / Facebook</p><ul><li>&lt;meta property=&quot;og:type&quot; content=&quot;website&quot; /&gt;: Specifies the type of content for Open Graph (used by Facebook and LinkedIn). Here, it indicates the content is a website.</li><li>&lt;meta property=&quot;og:url&quot; content=&quot;https://deepakcardoza.com/&quot; /&gt;: The URL of the webpage, so platforms know where to link when users share your page.</li><li>&lt;meta property=&quot;og:title&quot; content=&quot;...&quot;&gt;: The Open Graph title, is displayed when the page is shared on social platforms.</li><li>&lt;meta property=&quot;og:description&quot; content=&quot;...&quot;&gt;: A brief description of the page for Open Graph, giving viewers context when the page is shared.</li><li>&lt;meta property=&quot;og:image&quot; content=&quot;https://metatags.io/images/meta-tags.png&quot; /&gt;: The image displayed when the page is shared on social platforms, making it more engaging.</li></ul><p>Twitter</p><ul><li>&lt;meta property=&quot;twitter:card&quot; content=&quot;summary_large_image&quot; /&gt;: Specifies the type of Twitter card. &quot;summary_large_image&quot; shows a large preview image with the post.</li><li>&lt;meta property=&quot;twitter:url&quot; content=&quot;https://deepakcardoza.com/&quot; /&gt;: The URL of the page as it appears on Twitter.</li><li>&lt;meta property=&quot;twitter:title&quot; content=&quot;...&quot;&gt;: The title is displayed when the link is shared on Twitter.</li><li>&lt;meta property=&quot;twitter:description&quot; content=&quot;...&quot;&gt;: A brief description of the page for Twitter, helping users understand the page content.</li><li>&lt;meta property=&quot;twitter:image&quot; content=&quot;https://metatags.io/images/meta-tags.png&quot; /&gt;: The image displayed on Twitter when sharing the link, making it visually appealing.</li></ul><h4>Adding a Favicon</h4><p>A <strong>favicon</strong> is a small icon displayed in browser tabs, bookmarks, and search results that represents your website. While it may seem like a minor detail, a favicon plays a key role in enhancing your site’s branding and professionalism. It indirectly supports SEO by improving user trust, brand recognition, and click-through rates in search results or browser tabs.</p><p><strong>To add a favicon</strong></p><ol><li><strong>Create a Favicon</strong></li></ol><ul><li>Use a tool like <a href="https://realfavicongenerator.net/">Favicon Generator</a> to design a 16x16 or 32x32 pixel icon. This tool generates favicons in multiple sizes, is compatible with all major browsers, and supports various platforms, including Android, iOS, and Windows (both desktop and mobile, including Windows Tiles).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*if-IUo4FUuQMv2NOGjKjlQ.png" /><figcaption>RealFaviconGenerator — Generate Favicon for all Platforms</figcaption></figure><p><strong>2. Add the Favicon to Your Website</strong></p><ul><li>Download the favicon package from the RealFavioconGenerator website and upload it to your website’s root folder.</li><li>Include the code in your website’s &lt;head&gt; section.</li></ul><blockquote>Example Code to Add Favicon</blockquote><pre>&lt;link rel=&quot;icon&quot; type=&quot;image/png&quot; href=&quot;/favicon-96x96.png&quot; sizes=&quot;96x96&quot; /&gt;<br>&lt;link rel=&quot;icon&quot; type=&quot;image/svg+xml&quot; href=&quot;/favicon.svg&quot; /&gt;<br>&lt;link rel=&quot;shortcut icon&quot; href=&quot;/favicon.ico&quot; /&gt;<br>&lt;link rel=&quot;apple-touch-icon&quot; sizes=&quot;180x180&quot; href=&quot;/apple-touch-icon.png&quot; /&gt;<br>&lt;link rel=&quot;manifest&quot; href=&quot;/site.webmanifest&quot; /&gt;</pre><p>Although small, a favicon is a key part of creating a user-friendly website and contributes to the overall effectiveness of On-Page SEO.</p><h3><strong>Off-Page SEO — Making Your Website Discoverable</strong></h3><p>Off-page SEO isn’t just about backlinks and social media, it’s also about ensuring search engines can discover and understand your website. This involves technical steps like submitting a sitemap, enabling crawling, and indexing your site in search engines like Google. These processes help search engines recognize your site, making it possible for it to appear in search results. Once indexed, your site can then benefit from additional strategies like link-building and social engagement to boost its authority and credibility.</p><p>Now that we’ve added meta tags to make our website search engine-friendly, the next step in Off-Page SEO is ensuring that search engines know your website exists. This is achieved through a process called <strong>crawling</strong>.</p><h4>What is Crawling?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*si-wURo-sORn3V1Z" /><figcaption>Photo by <a href="https://unsplash.com/@growtika?utm_source=medium&amp;utm_medium=referral">Growtika</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><p>Crawling is when search engine bots (spiders) visit your website to analyze its content and structure. These bots collect information to help search engines index your site and rank it appropriately in search results. Essentially, crawling is how search engines discover and understand your website.</p><p>To enable crawling, we need to <strong>index our website</strong> by creating and uploading a <strong>sitemap</strong> to <strong>Google Search Console</strong>. A sitemap is like a roadmap of your website that guides bots to all the important pages.</p><h4>Steps to Create and Upload a Sitemap</h4><ol><li><strong>Generate a Sitemap</strong></li></ol><ul><li>Navigate to <a href="https://www.xml-sitemaps.com/"><strong>XML Sitemaps Generator</strong></a>.</li><li>Enter your website URL. The tool scans your website, detects all backlinks, meta tags, and content, and generates a sitemap in .XML format.</li><li>The generated sitemap includes a <strong>priority </strong>key, which helps search engines understand which pages are most important.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yZ7kkmEOFLFQPD8Lt84Hfw.png" /><figcaption>Generating XML Sitemap</figcaption></figure><p><strong>2. Upload the Sitemap</strong></p><ul><li>Save the .XML file and upload it to the root folder of your website. For example, the sitemap for <em>deepakcardoza.com</em> would be available at:<br><a href="https://deepakcardoza.com/sitemap.xml"><em>https://deepakcardoza.com/sitemap.xml</em></a>.</li></ul><p><strong>3. Verify Your Website in Google Search Console</strong></p><ul><li>Navigate to <a href="https://search.google.com/search-console/about"><strong>Google Search Console</strong></a>.</li><li>Click <strong>Add Property</strong> to add your website to Google Search Console.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MuEZLWoUnzhfsSWR85rohw.png" /><figcaption>Google Search Console — Add Property (Domain)</figcaption></figure><ul><li>Choose the option <strong>Domain</strong> and paste your website URL.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*m7-J13QwmvTGl10SsC9_7g.png" /><figcaption>Google Search Console — Adding Domain</figcaption></figure><ul><li>In the next step, verify ownership of the property by using a <strong>TXT record</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/797/1*Sy8aLnGmrvxL5_oqvrSw-Q.png" /><figcaption>Google Search Console — Verifying Domain</figcaption></figure><ul><li>Add the TXT record to your website’s DNS settings through your DNS provider.</li><li>For example, if you’re using Hostinger as your DNS provider, log in to Hostinger and update your DNS settings to include the TXT record provided by Google Search Console.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nPcekV3qvM5-J5lgzXGC1Q.png" /><figcaption>Hostinger — DNS Management Settings (Adding a TXT Record)</figcaption></figure><p><strong>4. Submit the Sitemap in the Google Search Console</strong></p><ul><li>In the left-hand menu of Search Console, go to the <strong>Sitemaps</strong> section.</li><li>Enter the URL of your sitemap (https://deepakcardoza.com/sitemap.xml) and click <strong>Submit</strong>.</li><li>Once submitted, Google will start crawling your website. Within a few days, your site will appear in search engine results.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WG_qlK4b2JYVrB9aUezQnQ.png" /><figcaption>Google Search Console — Submitting a Sitemap</figcaption></figure><h4>Bonus Tip — Take Your SEO Strategy to the Next Level</h4><p>While the On-Page and Off-Page SEO techniques we’ve covered are essential for improving your website’s visibility and ranking organically, there might still be cases where your site doesn’t rank as expected. This could be due to high competition in your niche, or because competitors are using paid strategies like advertising or bidding for top positions in search engine results.</p><p>If you’re looking to go beyond free methods and further enhance your site’s visibility, consider exploring <strong>Digital Marketing Strategies</strong> such as:</p><ul><li><strong>Email Marketing:</strong> Build and nurture relationships with your audience by sharing updates, offers, or content directly in their inbox.</li><li><strong>Social Media Marketing:</strong> Engage with your audience on platforms like Facebook, Instagram, and LinkedIn to create awareness and drive traffic to your website.</li><li><strong>Content Marketing:</strong> Create high-quality, valuable content that resonates with your audience, helping you establish authority and attract more visitors.</li><li><a href="https://ads.google.com/"><strong>Google Ads</strong></a><strong>:</strong> Invest in paid advertising to target specific keywords and appear at the top of search results.</li></ul><p>Additionally, using tools like the <a href="https://www.facebook.com/business/m/meta-business-suite"><strong>Meta Business Suite</strong></a> can help you manage and optimize your ad campaigns across Facebook and Instagram, ensuring better reach and engagement.</p><p>For those new to digital marketing, Google offers a free<strong> </strong><a href="https://skillshop.exceedlms.com/student/collection/648385-digital-marketing"><strong>Digital Marketing Course</strong></a><strong> </strong>available in<strong> Google Skillshop </strong>(previously Google Digital Garage). This course provides valuable insights into marketing techniques and strategies, helping you build a strong foundation for promoting your website effectively.</p><p>By combining free SEO techniques with paid and advanced marketing strategies, you can maximize your website’s visibility and achieve your online goals.</p><h4>Conclusion</h4><p>In conclusion, mastering the essentials of On-Page and Off-Page SEO is key to building a strong foundation for your website’s visibility and organic growth. These techniques not only improve your site’s ranking but also establish credibility in a competitive digital landscape. However, SEO is just one part of the puzzle. To truly stand out, consider integrating advanced strategies like social media marketing, content creation, and paid campaigns. You can further enhance your skills by exploring training on Google Ads and other marketing tools through Google Skillshop.</p><blockquote>Remember, SEO is a journey, not a destination, and consistent optimization is the key to long-term success.</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=128b11e98cd2" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>