<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Maxwell Ugochukwu</title>
    <description>The latest articles on Forem by Maxwell Ugochukwu (@princemaxi).</description>
    <link>https://forem.com/princemaxi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1116473%2Ffe858b30-17f8-4b42-98b9-7d17df251edb.jpg</url>
      <title>Forem: Maxwell Ugochukwu</title>
      <link>https://forem.com/princemaxi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/princemaxi"/>
    <language>en</language>
    <item>
      <title>🚀 Mastering the LEMP Stack: Architecture, Use Cases, and Deployment in Modern Web Development</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Mon, 11 Aug 2025 09:08:14 +0000</pubDate>
      <link>https://forem.com/princemaxi/mastering-the-lemp-stack-architecture-use-cases-and-deployment-in-modern-web-development-38d4</link>
      <guid>https://forem.com/princemaxi/mastering-the-lemp-stack-architecture-use-cases-and-deployment-in-modern-web-development-38d4</guid>
      <description>&lt;h2&gt;
  
  
  📖 Understanding the LEMP Stack
&lt;/h2&gt;

&lt;p&gt;The LEMP stack is a battle-tested suite of open-source software components used for building and running high-performance web applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;LEMP stands for:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Linux&lt;/strong&gt; – The foundational operating system.&lt;br&gt;
&lt;strong&gt;- Nginx (Engine-X)&lt;/strong&gt; – A high-performance, event-driven web server.&lt;br&gt;
&lt;strong&gt;- MySQL&lt;/strong&gt; – A relational database system for structured data storage.&lt;br&gt;
&lt;strong&gt;- PHP&lt;/strong&gt; – A server-side scripting language for generating dynamic content.&lt;/p&gt;

&lt;p&gt;It’s the younger, faster cousin of the LAMP stack (which uses Apache), prized for its ability to handle heavy concurrent traffic with minimal overhead.&lt;/p&gt;


&lt;h2&gt;
  
  
  🌟 Why the LEMP Stack Still Reigns in 2025
&lt;/h2&gt;

&lt;p&gt;In an era dominated by serverless functions, containers, and JAMstack architectures, the LEMP stack remains highly relevant because it delivers:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Performance&lt;/strong&gt; – Nginx is built for scale and concurrency.&lt;br&gt;
&lt;strong&gt;- Flexibility&lt;/strong&gt; – Replace components easily (MariaDB for MySQL, Python for PHP, etc.).&lt;br&gt;
&lt;strong&gt;- Cost Efficiency&lt;/strong&gt; – Fully open-source, no licensing fees.&lt;br&gt;
&lt;strong&gt;- Global Support&lt;/strong&gt; – Backed by one of the largest developer communities.&lt;br&gt;
&lt;strong&gt;- Proven Stability&lt;/strong&gt; – Powering production workloads for well over a decade.&lt;/p&gt;


&lt;h2&gt;
  
  
  🛠️ Common Use Cases
&lt;/h2&gt;

&lt;p&gt;The LEMP stack is a Swiss Army knife for web application development:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Static websites&lt;/strong&gt; – Lightning-fast HTML/CSS delivery via Nginx.&lt;br&gt;
&lt;strong&gt;- Dynamic sites&lt;/strong&gt; – PHP + MySQL to deliver personalized, data-driven pages.&lt;br&gt;
&lt;strong&gt;- API backends&lt;/strong&gt; – RESTful or GraphQL APIs serving mobile/web clients.&lt;br&gt;
&lt;strong&gt;- CMS platforms&lt;/strong&gt; – Optimized hosting for WordPress, Drupal, Joomla, and more.&lt;/p&gt;


&lt;h2&gt;
  
  
  🏗️ LEMP Stack Architecture
&lt;/h2&gt;

&lt;p&gt;Here’s how the components interact in a typical request-response cycle:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Browser (User Request: example.com)
            │
            ▼
       ┌───────────────┐
       │     Nginx     │
       │ Serves static │
       │ Routes PHP    │
       └───────────────┘
            │
     PHP Request
            ▼
       ┌───────────────┐
       │   PHP-FPM     │
       │ Executes PHP  │
       │ Talks to MySQL│
       └───────────────┘
            │
     SQL Queries
            ▼
       ┌───────────────┐
       │    MySQL      │
       │ Stores/Retr.  │
       └───────────────┘
            │
    HTML Output
            ▼
       ┌───────────────┐
       │   Browser     │
       │ Renders page  │
       └───────────────┘
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  🚀 Full Deployment Guide (Tested on Ubuntu Server 24.04 LTS)
&lt;/h2&gt;

&lt;p&gt;This section walks through a from-scratch LEMP setup on AWS EC2 — no skipped steps, no guesswork.&lt;/p&gt;

&lt;h3&gt;
  
  
  🛠 Prerequisites
&lt;/h3&gt;

&lt;p&gt;Before diving into deploying a LEMP stack on AWS, ensure you have the following:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. AWS Account&lt;/strong&gt;&lt;br&gt;
Sign up at &lt;a href="//aws.amazon.com"&gt;AWS Console&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;You’ll need billing enabled (a valid credit/debit card) to provision EC2 instances.&lt;/p&gt;

&lt;p&gt;Make sure you’re familiar with AWS free tier limits to avoid unexpected charges.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Basic Linux Command-Line Skills&lt;/strong&gt;&lt;br&gt;
Knowledge of commands like cd, ls, apt, and nano will be useful.&lt;/p&gt;

&lt;p&gt;If you’re new, check out:&lt;br&gt;
📖 &lt;a href="https://ubuntu.com/tutorials/command-line-for-beginners" rel="noopener noreferrer"&gt;Beginner’s Guide to Linux Commands&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Git Installed Locally&lt;/strong&gt;&lt;br&gt;
To clone or push project files to GitHub.&lt;/p&gt;

&lt;p&gt;Install:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update &amp;amp;&amp;amp; sudo apt install git -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Or download from &lt;a href="https://git-scm.com/" rel="noopener noreferrer"&gt;git-scm.com&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Provisioning an AWS EC2 Instance&lt;/strong&gt;&lt;br&gt;
💡 We’ll use this EC2 server as the environment for our LEMP stack.&lt;/p&gt;

&lt;p&gt;Steps:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Log in to your AWS Console.&lt;/li&gt;
&lt;li&gt;Navigate to &lt;strong&gt;EC2&lt;/strong&gt; → Click &lt;strong&gt;Launch Instance&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F29v3xwa50bg7dekbqocf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F29v3xwa50bg7dekbqocf.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flvvi6la17yvzhpekviah.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flvvi6la17yvzhpekviah.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Name your instance: &lt;code&gt;LEMP-Server&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpx3n5tsfkteow4xtg8if.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpx3n5tsfkteow4xtg8if.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Select Amazon Machine Image (AMI): &lt;strong&gt;Ubuntu Server 24.04 LTS&lt;/strong&gt; (Free tier eligible).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fstha4aoepzpbbc2yxjmn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fstha4aoepzpbbc2yxjmn.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Choose Instance Type: &lt;strong&gt;t2.micro&lt;/strong&gt; (Free tier eligible).&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffmvox00ygs0e10ceiuxx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffmvox00ygs0e10ceiuxx.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Create or choose a Key Pair for SSH access.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftsq2qkqk8hij679b2fek.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftsq2qkqk8hij679b2fek.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Configure Security Group:

&lt;ul&gt;
&lt;li&gt;Allow &lt;strong&gt;SSH&lt;/strong&gt; (Port 22) from your IP.&lt;/li&gt;
&lt;li&gt;Allow &lt;strong&gt;HTTP&lt;/strong&gt; (Port 80) from anywhere.&lt;/li&gt;
&lt;li&gt;Allow &lt;strong&gt;HTTPS&lt;/strong&gt; (Port 443) from anywhere.&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ysj9e4b2ov3f1b62do2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6ysj9e4b2ov3f1b62do2.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo74sirjs9dzbdt9u584o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fo74sirjs9dzbdt9u584o.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvq2mlj6vcoqer8p7n3ag.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvq2mlj6vcoqer8p7n3ag.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz7x1r6gcdp1tgnvk8ikk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fz7x1r6gcdp1tgnvk8ikk.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk4j9qoj3q4flf0ymleey.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk4j9qoj3q4flf0ymleey.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Click &lt;strong&gt;Launch Instance&lt;/strong&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmana209ix3lwbbto8urq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmana209ix3lwbbto8urq.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsxh8gu8cgvkvo4z18dd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsxh8gu8cgvkvo4z18dd.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffinvi3ez8xl8l49meuph.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffinvi3ez8xl8l49meuph.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Once running, copy the &lt;strong&gt;Public IPv4 address&lt;/strong&gt; — you’ll use it to connect via SSH.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;5. SSH Access&lt;/strong&gt;&lt;br&gt;
From your local terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 400 ~/&amp;lt;your key pair&amp;gt;.pem
ssh -i /path/to/key.pem ubuntu@&amp;lt;Your-EC2-Public-IP&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvda60jiczl3hfvct0b9n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvda60jiczl3hfvct0b9n.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyqv2xbc2diuwvpzdafv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyqv2xbc2diuwvpzdafv.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;⚡ With these prerequisites in place, you’re ready to start setting up the LEMP stack on AWS!&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 1: Update the System
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo apt update&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Updates the package list from repositories.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo apt upgrade -y&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Installs the latest updates for all packages.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F76wihqin99nissabp9t7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F76wihqin99nissabp9t7.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 2: Install Nginx
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;sudo apt install nginx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Installs the Nginx web server and prompt for confirmation.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rwku7r804jop7i7prvz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3rwku7r804jop7i7prvz.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Check the status of Nginx
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl status nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;systemctl status nginx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Shows Nginx status.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0x456zccc15jmsysjaq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0x456zccc15jmsysjaq.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Test locally on the instance. If you see HTTP/1.1 200 OK or the default Nginx HTML, Nginx is serving.
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -I http://localhost
# or
curl http://127.0.0.1:80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6nmmlp4mmj28r1zaewm0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6nmmlp4mmj28r1zaewm0.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Test on a browser
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://&amp;lt;EC2-Public-IP&amp;gt;:80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fop2kpv1sz5sh8lgfq3if.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fop2kpv1sz5sh8lgfq3if.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 6: Install MySQL
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mysql-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;apt install mysql-server&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Installs the MySQL database server.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2nwztsdcqn2pk9ubr6j1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2nwztsdcqn2pk9ubr6j1.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Secure MySQL
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Step&lt;/th&gt;
&lt;th&gt;Action&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Password policy&lt;/td&gt;
&lt;td&gt;Choose password validation level.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remove anonymous users&lt;/td&gt;
&lt;td&gt;Prevents anonymous access to DB.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Disallow remote root login&lt;/td&gt;
&lt;td&gt;Increases security.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Remove test database&lt;/td&gt;
&lt;td&gt;Cleans up default DB.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvahjru8kavl1u5n28f46.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvahjru8kavl1u5n28f46.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 7: Install PHP
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;php-fpm php-mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Package&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;php-fpm&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;PHP FastCGI Process Manager for Nginx.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;php-mysql&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;PHP module to interact with MySQL.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftbc7h5j9x5lun7kz91jl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftbc7h5j9x5lun7kz91jl.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create project folder and set owner:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo mkdir -p /var/www/projectLEMP
sudo chown -R $USER:$USER /var/www/projectLEMP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fob4ze5ohym0wv31q1il3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fob4ze5ohym0wv31q1il3.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  3️⃣ Configure Nginx for PHP Processing
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;- Create a new Nginx server block:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/nginx/sites-available/projectLEMP
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Febat64181rw2kxpiodd6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Febat64181rw2kxpiodd6.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paste this configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight nginx"&gt;&lt;code&gt;&lt;span class="k"&gt;server&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kn"&gt;listen&lt;/span&gt; &lt;span class="mi"&gt;80&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;server_name&lt;/span&gt; &lt;span class="s"&gt;projectLEMP&lt;/span&gt; &lt;span class="s"&gt;www.projectLEMP&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;root&lt;/span&gt; &lt;span class="n"&gt;/var/www/projectLEMP&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="kn"&gt;index&lt;/span&gt; &lt;span class="s"&gt;index.php&lt;/span&gt; &lt;span class="s"&gt;index.html&lt;/span&gt; &lt;span class="s"&gt;index.htm&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;try_files&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt; &lt;span class="nv"&gt;$uri&lt;/span&gt;&lt;span class="n"&gt;/&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt; &lt;span class="sr"&gt;\.php$&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;include&lt;/span&gt; &lt;span class="nc"&gt;snippets/fastcgi-php&lt;/span&gt;&lt;span class="s"&gt;.conf&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;fastcgi_pass&lt;/span&gt; &lt;span class="s"&gt;unix:/run/php/php8.3-fpm.sock&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;fastcgi_param&lt;/span&gt; &lt;span class="s"&gt;SCRIPT_FILENAME&lt;/span&gt; &lt;span class="nv"&gt;$document_root$fastcgi_script_name&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kn"&gt;include&lt;/span&gt; &lt;span class="s"&gt;fastcgi_params&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="kn"&gt;location&lt;/span&gt; &lt;span class="p"&gt;~&lt;/span&gt; &lt;span class="sr"&gt;/\.ht&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="kn"&gt;deny&lt;/span&gt; &lt;span class="s"&gt;all&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Line&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;listen 80;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tells Nginx to listen for HTTP requests on port 80.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;server_name projectLEMP www.projectLEMP;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Defines the domain names handled by this block.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;root /var/www/projectLEMP;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Directory containing site files.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;index index.php index.html index.htm;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Default files to serve.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;location / { try_files $uri $uri/ =404; }&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tries to serve the file, else returns 404.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;location ~ \.php$ { ... }&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Configures PHP file handling via PHP-FPM.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;location ~ /\.ht { deny all; }&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Blocks &lt;code&gt;.htaccess&lt;/code&gt; files for security.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feq79gly083nx7hhx18sq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feq79gly083nx7hhx18sq.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Enable and link the configuration:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /etc/nginx/sites-available/projectLEMP /etc/nginx/sites-enabled/
&lt;span class="nb"&gt;sudo &lt;/span&gt;nginx &lt;span class="nt"&gt;-t&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl reload nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;ln -s ...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates a symbolic link to enable the config.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nginx -t&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Tests the Nginx configuration syntax.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;systemctl reload nginx&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Reloads Nginx without downtime.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw85dat39c87rjq8pweze.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw85dat39c87rjq8pweze.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fux1wfi32s9yvvss64bel.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fux1wfi32s9yvvss64bel.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  4️⃣ Test PHP Processing
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;- Create a test file:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /var/www/projectLEMP/info.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhzsqkpq76ndg4v0hno7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuhzsqkpq76ndg4v0hno7.png" alt=" " width="800" height="60"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Add:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="nb"&gt;phpinfo&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Code&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;&amp;lt;?php ... ?&amp;gt;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;PHP opening and closing tags.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;phpinfo();&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Outputs PHP configuration details.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw33zedddf5jac58zbl1a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw33zedddf5jac58zbl1a.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Visit &lt;code&gt;http://your_server_ip/info.php&lt;/code&gt; to confirm PHP is working.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdkoey0o0z2uccntoa8oa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdkoey0o0z2uccntoa8oa.png" alt=" " width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  5️⃣ MySQL Database Setup
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;- Login to MySQL:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmlvppjj0a3es2r3ev3ct.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmlvppjj0a3es2r3ev3ct.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Create DB, user, and grant privileges:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;DATABASE&lt;/span&gt; &lt;span class="n"&gt;example_database&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'example_user'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'%'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;mysql_native_password&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'password'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="k"&gt;GRANT&lt;/span&gt; &lt;span class="k"&gt;ALL&lt;/span&gt; &lt;span class="k"&gt;PRIVILEGES&lt;/span&gt; &lt;span class="k"&gt;ON&lt;/span&gt; &lt;span class="n"&gt;example_database&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;TO&lt;/span&gt; &lt;span class="s1"&gt;'example_user'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'%'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="n"&gt;EXIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CREATE DATABASE ...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates a new database.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CREATE USER ...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates a DB user with password.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;GRANT ALL PRIVILEGES ...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Gives user full access to DB.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  &lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiehdmybqd9v54n0dmlbs.png" alt=" " width="800" height="421"&gt;
&lt;/h2&gt;

&lt;h2&gt;
  
  
  6️⃣ Working with Your MySQL Database
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Login as Your Database User&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mysql &lt;span class="nt"&gt;-u&lt;/span&gt; example_user &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbyf6f43kou5fyhroy0y0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbyf6f43kou5fyhroy0y0.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;mysql&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Launches MySQL client.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-u example_user&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Logs in as &lt;code&gt;example_user&lt;/code&gt;.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;-p&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Prompts for your password.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Confirm Access to the Database&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SHOW&lt;/span&gt; &lt;span class="n"&gt;DATABASES&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SHOW DATABASES;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Lists all available databases for the logged-in user.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frvv2ryqp9x1x5mic6m85.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frvv2ryqp9x1x5mic6m85.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Create a todo_list Table&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;CREATE&lt;/span&gt; &lt;span class="k"&gt;TABLE&lt;/span&gt; &lt;span class="n"&gt;example_database&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;todo_list&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="n"&gt;item_id&lt;/span&gt; &lt;span class="nb"&gt;INT&lt;/span&gt; &lt;span class="n"&gt;AUTO_INCREMENT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;content&lt;/span&gt; &lt;span class="nb"&gt;VARCHAR&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;255&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
  &lt;span class="k"&gt;PRIMARY&lt;/span&gt; &lt;span class="k"&gt;KEY&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;item_id&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Line&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;CREATE TABLE ...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates a new table.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;item_id INT AUTO_INCREMENT&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Adds a unique ID for each row.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;content VARCHAR(255)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores text content up to 255 characters.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;PRIMARY KEY(item_id)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Makes &lt;code&gt;item_id&lt;/code&gt; the unique identifier.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9cx0plw4v1rfsbyrmj05.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9cx0plw4v1rfsbyrmj05.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Insert Sample Data&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;INSERT&lt;/span&gt; &lt;span class="k"&gt;INTO&lt;/span&gt; &lt;span class="n"&gt;example_database&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;todo_list&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;content&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;VALUES&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'My first important item'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Part&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;INSERT INTO ... (content)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the table and column to insert data into.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;VALUES ('My first important item')&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Data to be stored in the &lt;code&gt;content&lt;/code&gt; field.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxn0gmw8dsywx3qdzamrl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxn0gmw8dsywx3qdzamrl.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: View Data in the Table&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;SELECT&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="k"&gt;FROM&lt;/span&gt; &lt;span class="n"&gt;example_database&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;todo_list&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;SELECT *&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Retrieves all columns from the table.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;FROM example_database.todo_list&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Specifies the source table.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu1bidgost6d342ua3jn5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu1bidgost6d342ua3jn5.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Exit MySQL&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="n"&gt;EXIT&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;EXIT;&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Closes the MySQL client session.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;




&lt;h2&gt;
  
  
  7️⃣ Retrieve Data with PHP (PDO Example)
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Create the PHP Script&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /var/www/projectLEMP/todo_list.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Command&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;nano /var/www/projectLEMP/todo_list.php&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Opens a new PHP file for editing in Nano text editor.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ov73yzqflb30i0qq346.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ov73yzqflb30i0qq346.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Add the PHP Code&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="nv"&gt;$user&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"example_user"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"PassWord.1"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$database&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"example_database"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nv"&gt;$table&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"todo_list"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nv"&gt;$db&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;PDO&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"mysql:host=localhost;dbname=&lt;/span&gt;&lt;span class="nv"&gt;$database&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$user&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nv"&gt;$password&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

    &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;h2&amp;gt;TODO&amp;lt;/h2&amp;gt;&amp;lt;ol&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;foreach&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nv"&gt;$db&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;query&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"SELECT content FROM &lt;/span&gt;&lt;span class="nv"&gt;$table&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;as&lt;/span&gt; &lt;span class="nv"&gt;$row&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;li&amp;gt;"&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$row&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'content'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;/li&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;echo&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;/ol&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nc"&gt;PDOException&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;print&lt;/span&gt; &lt;span class="s2"&gt;"Error!: "&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="nv"&gt;$e&lt;/span&gt;&lt;span class="o"&gt;-&amp;gt;&lt;/span&gt;&lt;span class="nf"&gt;getMessage&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="mf"&gt;.&lt;/span&gt; &lt;span class="s2"&gt;"&amp;lt;br/&amp;gt;"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;die&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;💡 Breakdown&lt;/strong&gt;&lt;/p&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Line&lt;/th&gt;
&lt;th&gt;Purpose&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$user = "example_user";&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores the database username.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$password = "PassWord.1";&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores the database password.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$database = "example_database";&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores the DB name.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;$table = "todo_list";&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stores the table name.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;new PDO("mysql:host=localhost;...&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Creates a database connection using PDO.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;foreach ($db-&amp;gt;query(...))&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Loops through each row of query results.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;echo "&amp;lt;li&amp;gt;" . $row['content'] . "&amp;lt;/li&amp;gt;";&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Outputs each item as an HTML list element.&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;catch (PDOException $e)&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Handles any connection/query errors.&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5lrylhqylt6yumx0aln5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5lrylhqylt6yumx0aln5.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Test in Browser&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Visit:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://&amp;lt;EC2-Public-IP&amp;gt;/todo_list.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;If successful, you’ll see your TODO list items displayed in a browser.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft93l8kos22jy0f4qeenz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ft93l8kos22jy0f4qeenz.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  8️⃣ Final Testing
&lt;/h2&gt;

&lt;p&gt;You now have a fully functional LEMP stack.&lt;br&gt;
You can deploy web apps like WordPress, Laravel, or custom PHP apps.&lt;/p&gt;




&lt;h2&gt;
  
  
  🛠 Common Troubleshooting Tips
&lt;/h2&gt;

&lt;p&gt;If you hit snags during your LEMP setup, these quick checks can save hours:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH Problems → Ensure correct key permissions (chmod 400), right username (ubuntu for Ubuntu AMIs), and valid public IP/Security Group rules. Remove outdated host keys with ssh-keygen -R.&lt;/li&gt;
&lt;li&gt;Connection Timeouts → Check route tables, Internet Gateway, and NACLs allow inbound/outbound traffic on required ports (22 for SSH, 80 for HTTP).&lt;/li&gt;
&lt;li&gt;Nginx/PHP Issues → Make sure index.php is in the index directive and that fastcgi_pass points to the correct PHP-FPM socket.&lt;/li&gt;
&lt;li&gt;MySQL Quirks → Close unbalanced quotes to avoid '&amp;gt; prompt, quit with \q if stuck, and inspect logs if MySQL fails to start.&lt;/li&gt;
&lt;li&gt;Windows/WSL Key Handling → Move .pem into WSL home before SSH, set proper permissions.&lt;/li&gt;
&lt;li&gt;Port 80 Timeouts → If curl localhost works but browser doesn’t, verify firewall rules, public IP, and that Nginx is listening on 0.0.0.0:80.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  ✅ Conclusion
&lt;/h2&gt;

&lt;p&gt;You’ve:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Installed Linux, Nginx, MySQL, and PHP.&lt;/li&gt;
&lt;li&gt;Configured Nginx for PHP-FPM.&lt;/li&gt;
&lt;li&gt;Created and secured a MySQL database.&lt;/li&gt;
&lt;li&gt;Verified PHP is working.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;This process is production-ready with minor tweaks for SSL and security hardening.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/princemaxi/LEMP-STACK-in-AWS" rel="noopener noreferrer"&gt;Link to github step-by-step&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ai</category>
      <category>aws</category>
      <category>webdev</category>
      <category>linux</category>
    </item>
    <item>
      <title>🛠️ Deploying a LAMP Stack on AWS EC2 (Ubuntu 24.04 LTS) — A DevOps Implementation Guide</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Mon, 04 Aug 2025 08:25:56 +0000</pubDate>
      <link>https://forem.com/princemaxi/mastering-lamp-stack-implementation-in-aws-cloud-a-devops-perspective-377i</link>
      <guid>https://forem.com/princemaxi/mastering-lamp-stack-implementation-in-aws-cloud-a-devops-perspective-377i</guid>
      <description>&lt;h2&gt;
  
  
  Introduction:
&lt;/h2&gt;

&lt;p&gt;In today’s digital-first world, building robust and scalable web applications requires a reliable and efficient backend infrastructure — and that’s where the LAMP stack shines.&lt;/p&gt;

&lt;p&gt;The LAMP stack is a powerful combination of four open-source technologies: Linux (operating system), Apache (web server), MySQL (database), and PHP (scripting language). Together, they form a foundational framework for developing high-performance web applications from simple websites to complex enterprise solutions. Thanks to their open-source nature, these technologies are not only cost-effective but also backed by a vast global developer community.&lt;/p&gt;

&lt;p&gt;But why is LAMP still a popular choice in an age of modern frameworks and cloud-native stacks?&lt;/p&gt;

&lt;p&gt;Because it’s flexible, proven, and efficient. It offers a tried-and-tested development environment that significantly reduces setup time, supports dynamic content, and is easily adaptable to cloud platforms like Amazon Web Services (AWS).&lt;/p&gt;

&lt;p&gt;In this blog, we’ll break down how the LAMP stack works, explore its layered architecture, and walk you through the process of deploying a fully functional LAMP stack on AWS. Whether you're a developer looking to migrate your application to the cloud or a beginner seeking hands-on experience in web server configuration, this guide will help you master the fundamentals — and go beyond.&lt;/p&gt;

&lt;p&gt;Let’s dive in and get your web stack cloud-ready! ☁️💡&lt;/p&gt;

&lt;h2&gt;
  
  
  🔧 Before You Begin: Essential Setup Checklist
&lt;/h2&gt;

&lt;p&gt;If you’re just getting started with deploying your own LAMP stack on AWS, it’s important to have the right tools in place. Here’s a step-by-step preparation guide to ensure your local development environment is ready for action.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ 1. Install Windows Terminal(If you are using a Windows Operating System)&lt;/strong&gt;&lt;br&gt;
Windows Terminal provides a modern, fast, and powerful terminal experience that supports multiple shells (e.g., PowerShell, Command Prompt, WSL, etc.).&lt;br&gt;
➡️ &lt;a href="https://aka.ms/terminal" rel="noopener noreferrer"&gt;Download Windows Terminal from Microsoft Store&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ 2. Install Visual Studio Code (VS Code)&lt;/strong&gt;&lt;br&gt;
VS Code is a lightweight yet powerful code editor with tons of extensions for developers.&lt;br&gt;
➡️ &lt;a href="https://code.visualstudio.com/Download" rel="noopener noreferrer"&gt;Download VS Code&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ 3. Set Up a Workspace Folder&lt;/strong&gt;&lt;br&gt;
Create a dedicated folder on your machine where you’ll manage all your project files. You can name it something like lamp-stack-aws.&lt;br&gt;
Open this folder with VS Code and save it as a workspace for quick access.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;✅ 4. Install Git&lt;/strong&gt;&lt;br&gt;
Git is essential for version control and integrating with GitHub.&lt;br&gt;
➡️ &lt;a href="https://git-scm.com/downloads/win" rel="noopener noreferrer"&gt;Download Git for Windows&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Once installed, you can verify by running the following in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;✅ 5. Install OpenSSH Server&lt;/strong&gt;&lt;br&gt;
OpenSSH enables secure communication with your cloud instances via the SSH protocol. Windows 10/11 often includes it, but if it’s not installed:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Open Settings &amp;gt; Apps &amp;gt; Optional Features&lt;/li&gt;
&lt;li&gt;Click Add a feature, search for OpenSSH Server, and install it.&lt;/li&gt;
&lt;li&gt;Then enable and start it using PowerShell
&lt;/li&gt;
&lt;/ol&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Get-Service -Name sshd
Start-Service -Name sshd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;✅ 6. Create Your AWS and GitHub Accounts&lt;/strong&gt;&lt;br&gt;
You’ll need both accounts to deploy and manage your LAMP stack in the cloud and store your project code.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;🔐 AWS Account (includes 12 months of free tier):
👉 &lt;a href="https://portal.aws.amazon.com/billing/signup" rel="noopener noreferrer"&gt;Sign up for AWS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;🧑‍💻 GitHub Account (for version control and DevOps practices):
👉 &lt;a href="https://github.com/signup" rel="noopener noreferrer"&gt;Sign up for GitHub&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔍 With these tools in place, you’re now fully equipped to begin building your LAMP stack in the AWS cloud!&lt;/p&gt;
&lt;h2&gt;
  
  
  🚀 Launch EC2 and Deploy the LAMP Stack on AWS
&lt;/h2&gt;

&lt;p&gt;Now that your local environment is set up, let’s move to the cloud. The LAMP stack (Linux, Apache, MySQL, PHP) will be deployed on an Amazon EC2 instance — a virtual server in AWS.&lt;/p&gt;


&lt;h3&gt;
  
  
  🖥️ Step 1: Launch Your EC2 Instance
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;- Log in to the AWS Console&lt;/strong&gt;&lt;br&gt;
  👉 &lt;a href="https://console.aws.amazon.com" rel="noopener noreferrer"&gt;https://console.aws.amazon.com&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;- Navigate to EC2 Dashboard&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;- Click Services &amp;gt; EC2 or use the search bar to search for EC2.&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;- Click Launch Instance.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw4t9sokhbesxn8zf48q3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw4t9sokhbesxn8zf48q3.png" alt=" " width="800" height="362"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Give your instance a name like lamp-server and choose an Amazon Machine Image (AMI):&lt;/strong&gt; Select Ubuntu Server 24.04 LTS (HVM) – Free tier eligible.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6povp2r6kgamrrrydvfl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6povp2r6kgamrrrydvfl.png" alt=" " width="800" height="379"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Choose Instance Type:&lt;/strong&gt; Select t2.micro (Free tier eligible).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Configure Instance Details.&lt;/strong&gt; Leave default settings for beginners.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Select Create a new key pair,&lt;/strong&gt; download the .pem file securely.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feibmvms6oejlmgp5upe1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feibmvms6oejlmgp5upe1.png" alt=" " width="800" height="376"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fudam7ugl2kuxziaup7zf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fudam7ugl2kuxziaup7zf.png" alt=" " width="800" height="377"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Configure Security Group:&lt;/strong&gt; Create a new security group.&lt;/p&gt;

&lt;p&gt;Add these inbound rules:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;SSH – Port 22 – Anywhere (0.0.0.0/0)&lt;/li&gt;
&lt;li&gt;HTTP – Port 80 – Anywhere (0.0.0.0/0)&lt;/li&gt;
&lt;li&gt;(Optional) Add HTTPS if you plan to use SSL later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxf8gxfo26sq3vh7xp5cg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxf8gxfo26sq3vh7xp5cg.png" alt=" " width="800" height="380"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Launch Your Instance:&lt;/strong&gt; Click Launch Instance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Click the instance ID to enter the ec2&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnldj1fr95gxnxwjog9r.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frnldj1fr95gxnxwjog9r.png" alt=" " width="800" height="108"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuaxdksv10frccsrk2igw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fuaxdksv10frccsrk2igw.png" alt=" " width="800" height="382"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  🌍 Step 2: Assign an Elastic IP (Optional but Recommended)
&lt;/h3&gt;

&lt;p&gt;Elastic IPs ensure your EC2 instance keeps a static public IP.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Go to EC2 &amp;gt; Elastic IPs.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Allocate a new Elastic IP and associate it with your instance.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffro4293bhpzqiynvirsa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffro4293bhpzqiynvirsa.png" alt=" " width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fszi38o34fnvv73bvummb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fszi38o34fnvv73bvummb.png" alt=" " width="800" height="385"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h3&gt;
  
  
  🔐 Step 3: Connect to EC2 via SSH
&lt;/h3&gt;

&lt;p&gt;Once your EC2 instance is up and running, the next crucial step is to connect to it securely from your local machine. This connection is established via SSH (Secure Shell), a cryptographic network protocol that allows you to control and manage your server remotely through the command line.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Before you connect, ensure you have the following:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Your EC2 instance's public IP address (or Public DNS)&lt;/li&gt;
&lt;li&gt;The .pem key pair file you downloaded when launching your EC2 instance&lt;/li&gt;
&lt;li&gt;A terminal (Windows users can use Windows Terminal, Windows Subsystem for Linux or Git Bash; Linux/macOS users can use their default terminal)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;🛠️ Make the PEM file secure (important!)&lt;/strong&gt;&lt;br&gt;
Before connecting, change the permission of your PEM file to ensure it's not publicly viewable. Run the following command in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;chmod 400 path/to/your-key.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace path/to/your-key.pem with the actual path to your PEM file.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🖥️ Connect using SSH&lt;/strong&gt;&lt;br&gt;
Run the following command in your terminal to connect to the EC2 instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh -i "your-key.pem" ubuntu@your-ec2-public-ip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;your-key.pem: the name of your private key file&lt;/li&gt;
&lt;li&gt;ubuntu: the default username for Ubuntu-based EC2 instances&lt;/li&gt;
&lt;li&gt;your-ec2-public-ip: the public IPv4 address of your EC2 instance
You can as well get this command from your aws management console when you click on connect and chose SSH from your EC2 instance.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If everything is set up correctly, you’ll see a welcome message from Ubuntu, and your terminal prompt will change to something like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ubuntu@ip-172-31-32-224:~$
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This means you’re now inside your EC2 server and can begin installing your web stack or managing files as needed.&lt;/p&gt;

&lt;h4&gt;
  
  
  ✅ For WSL (Windows Subsystem for Linux) Users
&lt;/h4&gt;

&lt;p&gt;Your &lt;code&gt;.pem&lt;/code&gt; key can be accessed via:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /mnt/c/Users/&amp;lt;YourWindowsUsername&amp;gt;/Downloads
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Copy to home and set permissions:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cp&lt;/span&gt; /mnt/c/Users/&amp;lt;YourWindowsUsername&amp;gt;/Downloads/your-key.pem ~/
&lt;span class="nb"&gt;chmod &lt;/span&gt;400 ~/your-key.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frjx9lkd3k8xkupkp59gm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frjx9lkd3k8xkupkp59gm.png" alt=" " width="800" height="408"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h3&gt;
  
  
  Installing Apache2 on Your Ubuntu EC2 Instance
&lt;/h3&gt;

&lt;p&gt;Now that your EC2 instance is up and running, the next step is to install Apache2, the web server component of the LAMP stack. Apache2 is responsible for serving your website’s files to users via their web browsers.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📌 Step-by-Step Guide&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Update your package list&lt;/strong&gt;&lt;br&gt;
Before installing any new software, it’s good practice to update the local package index to make sure you're getting the latest version available:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhf9676pj7sngy6spiyyl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhf9676pj7sngy6spiyyl.png" alt=" " width="800" height="378"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Install Apache2&lt;/strong&gt;&lt;br&gt;
This command installs the Apache2 web server:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install apache2 -y
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3kxhdbi61sc3scdy3c2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb3kxhdbi61sc3scdy3c2.png" alt=" " width="800" height="422"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Check if Apache2 is running&lt;/strong&gt;&lt;br&gt;
After installation, verify that Apache is active and running:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl status apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvogelklcmdcu6tlylkk1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvogelklcmdcu6tlylkk1.png" alt=" " width="800" height="402"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You should see output indicating that the service is active (running) like above. If not, you can start it manually using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl start apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Test your server locally&lt;/strong&gt;&lt;br&gt;
Confirm that Apache is serving pages by using curl:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl http://localhost:80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1py2av76zt6xhgeunhk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy1py2av76zt6xhgeunhk.png" alt=" " width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You should see the default Apache2 Ubuntu welcome page content.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Access the web server in your browser.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Finally, open your browser and visit your EC2 public IP address. For example: &lt;code&gt;http://13.134.19.83/&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F67h9k24b1vb8kob4pv6n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F67h9k24b1vb8kob4pv6n.png" alt=" " width="800" height="426"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Confirm that your EC2 instance is running and the Apache2 service is active.&lt;/p&gt;

&lt;p&gt;If the page still doesn’t load, try restarting Apache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Install and Configure MySQL on Your LAMP Stack
&lt;/h2&gt;

&lt;p&gt;With Apache up and running, the next critical component of the LAMP stack is &lt;strong&gt;MySQL&lt;/strong&gt;. It serves as the relational database management system (RDBMS) that stores and manages the backend data for your web applications.&lt;/p&gt;

&lt;h3&gt;
  
  
  ⚙️ Install MySQL
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;mysql-server
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fysohiqxzolhmbrs4fuxi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fysohiqxzolhmbrs4fuxi.png" alt=" " width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;After installation, you can access the MySQL interface using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6t3ofznspbmiasykciqv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6t3ofznspbmiasykciqv.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🔐 Secure Your MySQL Installation
&lt;/h3&gt;

&lt;p&gt;Before proceeding further, it's essential to secure your database with a strong root password:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'root'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;mysql_native_password&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'PassWord.1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foo5k9qqc1wov80u5fwrc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foo5k9qqc1wov80u5fwrc.png" alt=" " width="800" height="225"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Exit, then run the MySQL secure installation script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql_secure_installation
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw0tzdi7oijqlwtbky1p2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw0tzdi7oijqlwtbky1p2.png" alt=" " width="800" height="173"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This will prompt you with a series of questions to remove test databases, disable remote root login, and reload privilege tables to which you should reply yes for all questions.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8h0rwtf9eg1k4ol2z2a8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8h0rwtf9eg1k4ol2z2a8.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1uymg2dluadaavp6utxd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1uymg2dluadaavp6utxd.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now log into MySQL using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;mysql &lt;span class="nt"&gt;-p&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Type your password when prompted.&lt;/p&gt;

&lt;p&gt;To exit MySQL:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;exit&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0res7hffu34s1unnx8p2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0res7hffu34s1unnx8p2.png" alt=" " width="800" height="197"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Install and Verify PHP
&lt;/h2&gt;

&lt;p&gt;PHP is the scripting language that integrates the web server (Apache) with the database (MySQL).&lt;/p&gt;

&lt;h3&gt;
  
  
  🚀 Install PHP and Required Modules
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;php libapache2-mod-php php-mysql
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8dnz8llrtcbel3uvlafj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8dnz8llrtcbel3uvlafj.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  📃 Verify PHP Installation
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;php &lt;span class="nt"&gt;-v&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This should return the PHP version information, confirming that PHP is installed.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1aoi7xw9yslg85wv792v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1aoi7xw9yslg85wv792v.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Host Your Web Project
&lt;/h2&gt;

&lt;p&gt;Next, create a directory where your web project will live:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; /var/www/projectlamp
&lt;span class="nb"&gt;sudo chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; &lt;span class="nv"&gt;$USER&lt;/span&gt;:&lt;span class="nv"&gt;$USER&lt;/span&gt; /var/www/projectlamp/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7gao0ohl2d9t9bjg20qy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7gao0ohl2d9t9bjg20qy.png" alt=" " width="800" height="390"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This ensures you have permission to manage files in that directory.&lt;/p&gt;




&lt;h2&gt;
  
  
  Configure Apache for Your Project
&lt;/h2&gt;

&lt;p&gt;Create a custom virtual host configuration for your &lt;code&gt;projectlamp&lt;/code&gt; site:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/apache2/sites-available/projectlamp.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptpwd1ihl7so93zzk7cq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fptpwd1ihl7so93zzk7cq.png" alt=" " width="800" height="79"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paste the following configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="sr"&gt; *:80&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;        &lt;span class="nc"&gt;ServerName&lt;/span&gt; projectlamp
        &lt;span class="nc"&gt;ServerAlias&lt;/span&gt; www.projectlamp
        &lt;span class="nc"&gt;ServerAdmin&lt;/span&gt; webmaster@localhost
        &lt;span class="nc"&gt;DocumentRoot&lt;/span&gt; /var/www/projectlamp

        &lt;span class="nc"&gt;ErrorLog&lt;/span&gt; ${APACHE_LOG_DIR}/error.log
        &lt;span class="nc"&gt;CustomLog&lt;/span&gt; ${APACHE_LOG_DIR}/access.log combined
&lt;span class="p"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="nl"&gt;VirtualHost&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save and exit the editor.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffjye8ifgy6eh0rbyufj0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffjye8ifgy6eh0rbyufj0.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Enable your new site and disable the default one:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;a2ensite projectlamp
&lt;span class="nb"&gt;sudo &lt;/span&gt;a2dissite 000-default
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb0jdzabp7grumdvsui7e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fb0jdzabp7grumdvsui7e.png" alt=" " width="800" height="223"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Test the configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apache2ctl configtest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then reload Apache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl reload apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9e2yyicjmaf80l1wwjk5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9e2yyicjmaf80l1wwjk5.png" alt=" " width="800" height="120"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Create and Test Web Pages
&lt;/h2&gt;

&lt;h3&gt;
  
  
  🌐 Add a Simple HTML Page
&lt;/h3&gt;

&lt;p&gt;Navigate to the project directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /var/www/projectlamp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a basic HTML file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano index.html
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Paste:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;!DOCTYPE html&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;html&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;Hello LAMP&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;Hello LAMP from hostname&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/html&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftq8pwfr55o2uhcahu3vt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftq8pwfr55o2uhcahu3vt.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save and exit. You can now view this page using your EC2 public IP:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight http"&gt;&lt;code&gt;&lt;span class="err"&gt;http://&amp;lt;your-ec2-public-ip&amp;gt;
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feksz997cb5tovqiwn3oo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feksz997cb5tovqiwn3oo.png" alt=" " width="800" height="413"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;h2&gt;
  
  
  Enable PHP as the Default Page
&lt;/h2&gt;

&lt;p&gt;Apache usually serves &lt;code&gt;index.html&lt;/code&gt; by default. To give priority to &lt;code&gt;index.php&lt;/code&gt;, modify the configuration file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/apache2/mods-enabled/dir.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzv80mnbnstdnjl1koysf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzv80mnbnstdnjl1koysf.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Find this line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="nc"&gt;DirectoryIndex&lt;/span&gt; index.html index.cgi index.pl index.php index.xhtml index.htm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Change it to:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight apache"&gt;&lt;code&gt;&lt;span class="nc"&gt;DirectoryIndex&lt;/span&gt; index.php index.html index.cgi index.pl index.xhtml index.htm
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Reload Apache:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl reload apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  Create a PHP Info Page
&lt;/h2&gt;

&lt;p&gt;This will help confirm that PHP is correctly set up.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;nano /var/www/projectlamp/index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqtrk7l996cv9s9c7uzv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgqtrk7l996cv9s9c7uzv.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Paste:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight php"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?php&lt;/span&gt;
&lt;span class="nb"&gt;phpinfo&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="cp"&gt;?&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0cui8dgjsfkb07wuac9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0cui8dgjsfkb07wuac9.png" alt=" " width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Save and exit. Load your EC2 IP again and you should see a PHP configuration page.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flzo58vgramtuz1lv49r0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flzo58vgramtuz1lv49r0.png" alt=" " width="800" height="412"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To remove the PHP info page for security reasons after verification:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo rm&lt;/span&gt; /var/www/projectlamp/index.php
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0msvpgs07l008098y660.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0msvpgs07l008098y660.png" alt=" " width="800" height="103"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ogfxm16ic6aigiwdv1y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ogfxm16ic6aigiwdv1y.png" alt=" " width="800" height="419"&gt;&lt;/a&gt;&lt;/p&gt;




&lt;p&gt;With this, you've successfully completed the setup of a &lt;strong&gt;LAMP Stack on AWS EC2&lt;/strong&gt;! You now have a fully functional web server environment ready to host dynamic web applications.&lt;/p&gt;




&lt;h2&gt;
  
  
  🔧 LAMP Stack Troubleshooting Guide (Real Scenarios)
&lt;/h2&gt;

&lt;p&gt;Based on actual issues I encountered during deployment, here are common errors and their fixes:&lt;/p&gt;

&lt;h3&gt;
  
  
  ❌ Permission Denied (publickey)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Ensure your &lt;code&gt;.pem&lt;/code&gt; file path is correct and has &lt;code&gt;chmod 400&lt;/code&gt; permissions.&lt;/li&gt;
&lt;li&gt;Example fix:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;chmod &lt;/span&gt;400 ~/your-key.pem
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ❌ Host Key Verification Failed
&lt;/h3&gt;

&lt;p&gt;Occurs if you’ve previously connected to a server with the same IP.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fix:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ssh-keygen &lt;span class="nt"&gt;-R&lt;/span&gt; &amp;lt;your-ec2-public-ip&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ❌ Apache Service Not Found
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;You may have tried using:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start httpd
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;But on Ubuntu, use:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl start apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ❌ MySQL Access Denied (Password Yes/No)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Make sure you've correctly run:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight sql"&gt;&lt;code&gt;&lt;span class="k"&gt;ALTER&lt;/span&gt; &lt;span class="k"&gt;USER&lt;/span&gt; &lt;span class="s1"&gt;'root'&lt;/span&gt;&lt;span class="o"&gt;@&lt;/span&gt;&lt;span class="s1"&gt;'localhost'&lt;/span&gt; &lt;span class="n"&gt;IDENTIFIED&lt;/span&gt; &lt;span class="k"&gt;WITH&lt;/span&gt; &lt;span class="n"&gt;mysql_native_password&lt;/span&gt; &lt;span class="k"&gt;BY&lt;/span&gt; &lt;span class="s1"&gt;'PassWord.1'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;If MySQL socket is missing:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo mkdir&lt;/span&gt; &lt;span class="nt"&gt;-p&lt;/span&gt; /var/run/mysqld
&lt;span class="nb"&gt;sudo chown &lt;/span&gt;mysql:mysql /var/run/mysqld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  ❌ DirectoryIndex Still Loads HTML First
&lt;/h3&gt;

&lt;p&gt;Even after modifying &lt;code&gt;dir.conf&lt;/code&gt;, Apache might still serve &lt;code&gt;index.html&lt;/code&gt;. Ensure &lt;code&gt;index.php&lt;/code&gt; exists in the directory and reload Apache.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl reload apache2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>linux</category>
      <category>aws</category>
      <category>mysql</category>
      <category>php</category>
    </item>
    <item>
      <title>Building an NBA Data Lake with Azure: A Breakdown of the Project Structure</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Thu, 20 Mar 2025 09:41:08 +0000</pubDate>
      <link>https://forem.com/princemaxi/building-an-nba-data-lake-with-azure-a-breakdown-of-the-project-structure-1l23</link>
      <guid>https://forem.com/princemaxi/building-an-nba-data-lake-with-azure-a-breakdown-of-the-project-structure-1l23</guid>
      <description>&lt;h1&gt;
  
  
  Introduction
&lt;/h1&gt;

&lt;p&gt;Data lakes are essential for modern data engineering, enabling efficient storage and processing of raw data. In this blog post, we will explore how to build an NBA Data Lake using Microsoft Azure, leveraging services such as Azure Blob Storage, Azure Synapse Analytics, and Python automation. We will also provide a detailed breakdown of each file in the repository, explaining its purpose and functionality.&lt;/p&gt;

&lt;h1&gt;
  
  
  Prerequisites
&lt;/h1&gt;

&lt;p&gt;Ensure you have the following before running the scripts:&lt;/p&gt;

&lt;h3&gt;
  
  
  1️⃣ SportsData.io API Key
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Sign up at &lt;a href="//SportsData.io"&gt;SportsData.io&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Select NBA as the API you want to use&lt;/li&gt;
&lt;li&gt;Copy your API key from the Developer Portal&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2️⃣ Azure Account (Choose One)
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://azure.microsoft.com/en-us/pricing/purchase-options/azure-account/search?ef_id=_k_Cj0KCQiA-5a9BhCBARIsACwMkJ67jIcqe3S-QU-D_O1aHxhjC1WkH61u0loQD0H5-tu3OJsRpoy8uz4aAnepEALw_wcB_k_&amp;amp;OCID=AIDcmm5edswduu_SEM__k_Cj0KCQiA-5a9BhCBARIsACwMkJ67jIcqe3S-QU-D_O1aHxhjC1WkH61u0loQD0H5-tu3OJsRpoy8uz4aAnepEALw_wcB_k_&amp;amp;gad_source=1&amp;amp;gclid=Cj0KCQiA-5a9BhCBARIsACwMkJ67jIcqe3S-QU-D_O1aHxhjC1WkH61u0loQD0H5-tu3OJsRpoy8uz4aAnepEALw_wcB" rel="noopener noreferrer"&gt;Azure Free $200 Credit&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://azure.microsoft.com/en-us/free/students" rel="noopener noreferrer"&gt;Azure for Students&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.microsoft.com/en-us/startups" rel="noopener noreferrer"&gt;Azure for Startups&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  3️⃣ Development Tools
&lt;/h3&gt;

&lt;p&gt;Install VS Code with the following extensions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Azure CLI Tools&lt;/li&gt;
&lt;li&gt;Azure Tools&lt;/li&gt;
&lt;li&gt;Azure Resources&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4️⃣ Install Azure SDK &amp;amp; Python Packages
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Install Python (if not installed)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew install python  # macOS
sudo apt install python3  # Ubuntu/Debian
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Ensure pip is installed&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 -m ensurepip --default-pip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Install required Python packages&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install azure-identity azure-mgmt-resource azure-mgmt-storage azure-mgmt-synapse azure-storage-blob python-dotenv requests
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fusuc7x39iik681dmj7te.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fusuc7x39iik681dmj7te.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Project Overview
&lt;/h1&gt;

&lt;p&gt;This project is designed to fetch NBA data from an API and store it in an Azure-based data lake. The data pipeline automates cloud resource provisioning, data ingestion, and storage management. The following technologies and services are utilized:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Azure Blob Storage (for storing raw NBA data)&lt;/li&gt;
&lt;li&gt;Azure Synapse Analytics (for querying and analyzing data)&lt;/li&gt;
&lt;li&gt;Python (for scripting and automation)&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Now, let’s dive into the repository structure and understand the role of each file.&lt;/p&gt;

&lt;h1&gt;
  
  
  Repository Structure &amp;amp; File Breakdown
&lt;/h1&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F38uzhslbkpnmvf5lropq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F38uzhslbkpnmvf5lropq.png" alt="Image description" width="531" height="159"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Instructions
&lt;/h3&gt;

&lt;p&gt;This is the main documentation file that explains the project, how to set it up, and the key features of the repository. It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Overview of the project&lt;/li&gt;
&lt;li&gt;Installation and setup instructions&lt;/li&gt;
&lt;li&gt;Step-by-step usage guide&lt;/li&gt;
&lt;li&gt;Future enhancements and improvements&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. .env
&lt;/h3&gt;

&lt;p&gt;This file holds sensitive environment variables, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;API keys&lt;/li&gt;
&lt;li&gt;Azure Subscription ID&lt;/li&gt;
&lt;li&gt;Storage Account Name&lt;/li&gt;
&lt;li&gt;Synapse Workspace Name&lt;/li&gt;
&lt;li&gt;Connection Strings&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;⚠️ Note: The .env file should be added to .gitignore to prevent accidental exposure of sensitive credentials.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. setup_nba_data_lake.py
&lt;/h3&gt;

&lt;p&gt;This is the main script that orchestrates the entire setup of the data lake. It performs the following tasks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Loads environment variables from .env&lt;/li&gt;
&lt;li&gt;Calls azure_resources.py to create Azure resources&lt;/li&gt;
&lt;li&gt;Calls data_operations.py to fetch and store NBA data&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  4. azure_resources.py
&lt;/h3&gt;

&lt;p&gt;This script is responsible for dynamically creating the required Azure resources. It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Creating an Azure Storage Account: Required for storing raw data&lt;/li&gt;
&lt;li&gt;Creating a Blob Storage Container: Organizes the data files in a structured way&lt;/li&gt;
&lt;li&gt;Setting up an Azure Synapse Workspace: Enables querying and analyzing the stored data&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  5. data_operations.py
&lt;/h3&gt;

&lt;p&gt;This script handles data ingestion and upload processes. It includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetching data from the SportsData.io API&lt;/li&gt;
&lt;li&gt;Formatting the data into a JSONL file&lt;/li&gt;
&lt;li&gt;Uploading the file to Azure Blob Storage&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  6. requirements.txt
&lt;/h3&gt;

&lt;p&gt;A list of Python dependencies required to run the project, including:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;azure-identity (for authentication)&lt;/li&gt;
&lt;li&gt;azure-mgmt-resource (for managing Azure resources)&lt;/li&gt;
&lt;li&gt;azure-storage-blob (for handling Blob Storage operations)&lt;/li&gt;
&lt;li&gt;requests (for making API calls)&lt;/li&gt;
&lt;li&gt;python-dotenv (for managing environment variables)&lt;/li&gt;
&lt;li&gt;Run the following command to install dependencies:&lt;/li&gt;
&lt;li&gt;pip install -r requirements.txt&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  7. .gitignore
&lt;/h3&gt;

&lt;p&gt;This file ensures that sensitive files and unnecessary directories are not tracked in version control. It typically includes:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;.env (hides API keys and credentials)&lt;/li&gt;
&lt;li&gt;Instructions/ (prevents clutter from documentation files)&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;pycache&lt;/strong&gt;/ (ignores compiled Python files)&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Workflow Summary
&lt;/h1&gt;

&lt;h3&gt;
  
  
  Step 1: Clone the Repository
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/princemaxi/NBA_Datalake-Azure.git
cd NBA_Datalake-Azure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Step 2: Configure Environment Variables
&lt;/h3&gt;

&lt;p&gt;Create a .env file and add your API keys and Azure details:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SPORTS_DATA_API_KEY=&amp;lt;your_api_key&amp;gt;
AZURE_SUBSCRIPTION_ID=&amp;lt;your_subscription_id&amp;gt;
AZURE_RESOURCE_GROUP=&amp;lt;unique_resource_group_name&amp;gt;
AZURE_STORAGE_ACCOUNT=&amp;lt;unique_storage_account_name&amp;gt;
AZURE_SYNAPSE_WORKSPACE=&amp;lt;unique_synapse_workspace_name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2m7n2f46gbvnnxy5sza.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw2m7n2f46gbvnnxy5sza.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Install the requirements.txt file
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install -r requirements.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbozgrceyjug4t2lnrna6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbozgrceyjug4t2lnrna6.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Run the Setup Script
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python setup_nba_data_lake.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fu7t8g9nbfakka1awtl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0fu7t8g9nbfakka1awtl.png" alt="Image description" width="800" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Verify Data Upload
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Using Azure Portal&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to your Azure Storage Account&lt;/li&gt;
&lt;li&gt;Go to Data Storage &amp;gt; Containers&lt;/li&gt;
&lt;li&gt;Confirm the file raw-data/nba_player_data.jsonl exists&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4x11dqcf1tr88fsqatp1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4x11dqcf1tr88fsqatp1.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6r401sc3ftiv68jxnehz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6r401sc3ftiv68jxnehz.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmpdxyudlwpav06auwldd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmpdxyudlwpav06auwldd.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5h2pfnirp6lr7l5p1kmy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5h2pfnirp6lr7l5p1kmy.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Using Azure CLI&lt;/strong&gt;&lt;br&gt;
List blobs in the container&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az storage blob list \
  --container-name nba-datalake \
  --account-name $AZURE_STORAGE_ACCOUNT \
  --query "[].name" --output table
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwx0cukz5i4422kkyeqxt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwx0cukz5i4422kkyeqxt.png" alt="Image description" width="800" height="247"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Download the file&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;az storage blob download \
  --container-name nba-datalake \
  --account-name $AZURE_STORAGE_ACCOUNT \
  --name raw-data/nba_player_data.jsonl \
  --file nba_player_data.jsonl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F31ctt4u9jsby9t58dbhq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F31ctt4u9jsby9t58dbhq.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;View the contents&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat nba_player_data.jsonl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmr4cxgs8f41nilwtqib.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcmr4cxgs8f41nilwtqib.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Future Enhancements
&lt;/h1&gt;

&lt;p&gt;🔹 Automate Data Refresh: Implement Azure Functions to schedule and automate data updates.&lt;br&gt;
🔹 Stream Real-Time Data: Integrate Azure Event Hubs to process live NBA game stats.&lt;br&gt;
🔹 Data Visualization: Use Power BI with Synapse Analytics to create interactive dashboards.&lt;br&gt;
🔹 Secure Credentials: Store sensitive API keys in Azure Key Vault instead of .env files.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This project demonstrates how to build a fully functional data lake on Azure using Python automation. By following this structure, developers can efficiently manage and analyze NBA data while leveraging the scalability of cloud computing.&lt;/p&gt;

</description>
      <category>devops</category>
      <category>dataengineering</category>
      <category>azure</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Automating Sports Highlights Backup with AWS ECS, DynamoDB, and S3</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Sat, 15 Feb 2025 22:19:59 +0000</pubDate>
      <link>https://forem.com/princemaxi/automating-sports-highlights-backup-with-aws-ecs-dynamodb-and-s3-359c</link>
      <guid>https://forem.com/princemaxi/automating-sports-highlights-backup-with-aws-ecs-dynamodb-and-s3-359c</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In this technical blog, we will explore the SportsDataBackup project, which automates fetching sports highlights, storing data in Amazon S3 and DynamoDB, processing videos, and running on a schedule using AWS ECS Fargate and EventBridge. This guide will walk you through the setup, configuration, and deployment of this cloud-native automation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;p&gt;The SportsDataBackup system is designed to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Retrieve sports highlights from RapidAPI.&lt;/li&gt;
&lt;li&gt;Store metadata in Amazon DynamoDB.&lt;/li&gt;
&lt;li&gt;Save highlight videos in Amazon S3.&lt;/li&gt;
&lt;li&gt;Process videos using AWS MediaConvert.&lt;/li&gt;
&lt;li&gt;Schedule execution using AWS EventBridge and ECS Fargate.&lt;/li&gt;
&lt;li&gt;Monitor logs via Amazon CloudWatch.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we begin, ensure the following dependencies are installed:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Create a RapidAPI Account&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;Register on &lt;a href="https://rapidapi.com/highlightly-api-highlightly-api-default/api/sport-highlights-api/playground/apiendpoint_16dd5813-39c6-43f0-aebe-11f891fe5149" rel="noopener noreferrer"&gt;RapidAPI&lt;/a&gt;.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Get your API key to access sports highlights.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;strong&gt;2. Install Required Tools&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Docker (Pre-installed in most environments)&lt;br&gt;
&lt;code&gt;docker --version&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;AWS CLI (Pre-installed in AWS CloudShell)&lt;br&gt;
&lt;code&gt;aws --version&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-Python3&lt;br&gt;
&lt;code&gt;python3 --version&lt;/code&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;gettext (For environment variable substitution)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Install on Ubuntu/Debian:&lt;/strong&gt; &lt;code&gt;sudo apt install gettext&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install on macOS (Homebrew):&lt;/strong&gt; &lt;code&gt;brew install gettext&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install on Windows (Chocolatey):&lt;/strong&gt; &lt;code&gt;choco install gettext&lt;/code&gt;&lt;br&gt;
Also, you can follow the installation step &lt;a href="https://www.drupal.org/docs/8/modules/potion/how-to-install-setup-gettext" rel="noopener noreferrer"&gt;here&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Retrieve AWS Account ID&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the following command:
&lt;code&gt;aws sts get-caller-identity --query "Account" --output text&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fym3wkbvjqcs31jn51udv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fym3wkbvjqcs31jn51udv.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Save your AWS Account ID for later.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;4. Retrieve AWS Access Keys&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Navigate to IAM Dashboard &amp;gt; Users &amp;gt; Security Credentials.&lt;/li&gt;
&lt;li&gt;Create and save Access Key and Secret Access Key.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Step-by-Step Setup
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Clone the Repository&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/princemaxi/SportsDataBackup
cd SportsDataBackup/src
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwg5qis9zi9h2djr13c55.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwg5qis9zi9h2djr13c55.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Configure Environment Variables&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Modify the .env file with the relevant values:&lt;/p&gt;

&lt;p&gt;AWS_ACCOUNT_ID=your-account-id&lt;br&gt;
AWS_ACCESS_KEY=your-access-key&lt;br&gt;
AWS_SECRET_ACCESS_KEY=your-secret-access-key&lt;br&gt;
AWS_REGION=us-east-1&lt;br&gt;
S3_BUCKET_NAME=your-s3-bucket&lt;br&gt;
RAPIDAPI_KEY=your-rapidapi-key&lt;br&gt;
MEDIA_CONVERT_ENDPOINT=&lt;br&gt;
&lt;code&gt;aws mediaconvert describe-endpoints --query "Endpoints[0].Url" --output text&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdjxf76qnc50jlrpq659i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdjxf76qnc50jlrpq659i.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;SUBNET_ID=subnet-xxx&lt;br&gt;
SECURITY_GROUP_ID=sg-xxx&lt;/p&gt;

&lt;p&gt;Steps for getting SubnetID and Security Group ID:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In the github repo, there is a resources folder and copy the entire contents&lt;/li&gt;
&lt;li&gt;In the AWS Cloudshell or vs code terminal, create the file vpc_setup.sh and paste the script inside.
Run the script &lt;code&gt;vpc_setup.sh&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;You will see variables in the output, paste these variables into Subnet_ID and Security_Group_ID&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwpjfs5bwte3330k68cio.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwpjfs5bwte3330k68cio.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Load Environment Variables&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;set -a
source .env
set +a
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Verify the variables:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $AWS_LOGS_GROUP
echo $TASK_FAMILY
echo $AWS_ACCOUNT_ID
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fagxrqrppq3pgomt3l4k8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fagxrqrppq3pgomt3l4k8.png" alt="Image description" width="800" height="109"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Generate JSON Configuration Files&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Use envsubst to replace placeholders in template files:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;envsubst &amp;lt; taskdef.template.json &amp;gt; taskdef.json
envsubst &amp;lt; s3_dynamodb_policy.template.json &amp;gt; s3_dynamodb_policy.json
envsubst &amp;lt; ecsTarget.template.json &amp;gt; ecsTarget.json
envsubst &amp;lt; ecseventsrole-policy.template.json &amp;gt; ecseventsrole-policy.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Build and Push Docker Image&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an ECR Repository&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;aws ecr create-repository --repository-name sports-backup&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjt4ydswrb233ohyt0s3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcjt4ydswrb233ohyt0s3.png" alt="Image description" width="800" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login to AWS ECR
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecr get-login-password --region ${AWS_REGION} | docker login --username AWS --password-stdin ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsskq3yogo06ovhg2wx9.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frsskq3yogo06ovhg2wx9.png" alt="Image description" width="800" height="124"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Build Docker Image&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;docker build -t sports-backup .&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F941v5ac4um7z8abzk87x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F941v5ac4um7z8abzk87x.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Tag and Push the Image
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker tag sports-backup:latest ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/sports-backup:latest
docker push ${AWS_ACCOUNT_ID}.dkr.ecr.${AWS_REGION}.amazonaws.com/sports-backup:latest
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpm5fut23vjizxh0jm2r1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpm5fut23vjizxh0jm2r1.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Create AWS Resources&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Register the ECS Task Definition&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;aws ecs register-task-definition --cli-input-json file://taskdef.json --region ${AWS_REGION}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzbhf6n93774aplwopwr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fzzbhf6n93774aplwopwr.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create CloudWatch Log Group&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;code&gt;aws logs create-log-group --log-group-name "${AWS_LOGS_GROUP}" --region ${AWS_REGION}&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3lv9qc8p0tgygfpphq52.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3lv9qc8p0tgygfpphq52.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Attach S3/DynamoDB Policy to ECS Task Execution Role
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam put-role-policy --role-name ecsTaskExecutionRole --policy-name S3DynamoDBAccessPolicy --policy-document file://s3_dynamodb_policy.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create ECS Events Role
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam create-role --role-name ecsEventsRole --assume-role-policy-document file://ecsEventsRole-trust.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Attach ECS Events Role Policy
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws iam put-role-policy --role-name ecsEventsRole --policy-name ecsEventsPolicy --policy-document file://ecseventsrole-policy.json
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 7: Schedule the Task with AWS EventBridge&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create the EventBridge Rule
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws events put-rule --name SportsBackupScheduleRule --schedule-expression "rate(1 day)" --region ${AWS_REGION}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Add Target to the Rule
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws events put-targets --rule SportsBackupScheduleRule --targets file://ecsTarget.json --region ${AWS_REGION}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 8: Manually Test the ECS Task&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecs run-task \
  --cluster sports-backup-cluster \
  --launch-type FARGATE \
  --task-definition ${TASK_FAMILY} \
  --network-configuration "awsvpcConfiguration={subnets=[\"${SUBNET_ID}\"],securityGroups=[\"${SECURITY_GROUP_ID}\"],assignPublicIp=\"ENABLED\"}" \
  --region ${AWS_REGION}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feabbuzr4y65rqmpvr0jn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feabbuzr4y65rqmpvr0jn.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn63gws47escfhwihk4s5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn63gws47escfhwihk4s5.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ji88uo81y9bornduem2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7ji88uo81y9bornduem2.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu8i4z595mmto3g6xnxjb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu8i4z595mmto3g6xnxjb.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xvkdasbeym1qsolfktg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4xvkdasbeym1qsolfktg.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfk4o7gib17p5qtsacv3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmfk4o7gib17p5qtsacv3.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbke9c8xyctdq5yj7sq8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsbke9c8xyctdq5yj7sq8.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Learnings
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Using templated JSON files for automated AWS configurations.&lt;/li&gt;
&lt;li&gt;Storing and backing up sports highlight data in DynamoDB and S3.&lt;/li&gt;
&lt;li&gt;Deploying event-driven ECS tasks with AWS Fargate and EventBridge.&lt;/li&gt;
&lt;li&gt;Monitoring logs and task execution in CloudWatch.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Future Enhancements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Automated backup of DynamoDB tables to S3.&lt;/li&gt;
&lt;li&gt;Batch processing of JSON files to handle multiple videos per execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;The SportsDataBackup project demonstrates how AWS services can be combined to automate data ingestion, storage, processing, and scheduling. With a fully automated setup, this solution ensures reliable backup and processing of sports highlights using AWS cloud-native tools.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If you're interested in contributing, feel free to fork the repository and submit pull requests!&lt;/em&gt; 🚀&lt;/p&gt;

</description>
      <category>aws</category>
      <category>docker</category>
      <category>python</category>
      <category>devops</category>
    </item>
    <item>
      <title>Building a Real-Time NBA Game Day Notification System with AWS and Terraform</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Sun, 09 Feb 2025 00:07:51 +0000</pubDate>
      <link>https://forem.com/princemaxi/building-a-real-time-nba-game-day-notification-system-with-aws-and-terraform-kli</link>
      <guid>https://forem.com/princemaxi/building-a-real-time-nba-game-day-notification-system-with-aws-and-terraform-kli</guid>
      <description>&lt;p&gt;Imagine getting real-time NBA game updates delivered straight to your phone or email without lifting a finger. Now, imagine provisioning that entire system in just 15 seconds! 🤯&lt;/p&gt;

&lt;p&gt;In this blog, we’ll walk through how to build an NBA Game Day Notification System using AWS serverless technologies and Infrastructure as Code (IaC) with Terraform. This system fetches live NBA scores and sends updates via SMS and email to subscribed users.&lt;/p&gt;

&lt;p&gt;Previously, setting up this solution manually took several minutes. But with Terraform, we can automate and replicate the deployment effortlessly—making it scalable, repeatable, and secure.&lt;/p&gt;

&lt;h2&gt;
  
  
  Here’s what we’ll cover:
&lt;/h2&gt;

&lt;p&gt;✅ How the system works&lt;br&gt;
✅ Why Infrastructure as Code (IaC) is a game-changer&lt;br&gt;
✅ Step-by-step deployment using AWS &amp;amp; Terraform&lt;br&gt;
✅ How to test and optimize your notifications&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Let’s dive in! 🚀&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;p&gt;The &lt;strong&gt;NBA Game Day Notification System&lt;/strong&gt; is designed to:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fetch real-time NBA scores from an external API.&lt;/li&gt;
&lt;li&gt;Process the data and send notifications via SMS and email to subscribed users.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Here’s the tech stack we’ll use:
&lt;/h2&gt;

&lt;p&gt;🔹 AWS Lambda – Fetches live NBA scores from an API.&lt;br&gt;
🔹 Amazon SNS – Sends notifications via SMS/Email.&lt;br&gt;
🔹 Amazon EventBridge – Triggers updates at scheduled intervals.&lt;br&gt;
🔹 Terraform (IaC) – Automates deployment of the entire infrastructure.&lt;br&gt;
🔹 Python &amp;amp; External APIs – Handles data processing and API integration.&lt;/p&gt;
&lt;h2&gt;
  
  
  System Architecture
&lt;/h2&gt;

&lt;p&gt;Here’s how the system works:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;EventBridge Scheduler triggers an AWS Lambda function at scheduled intervals (e.g., every 2 hours).&lt;/li&gt;
&lt;li&gt;The Lambda function fetches live NBA game data from an external API (SportsData.io).&lt;/li&gt;
&lt;li&gt;The function processes the scores and sends notifications via Amazon SNS.&lt;/li&gt;
&lt;li&gt;Users receive real-time game updates via SMS or Email.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
  
  
  Code Breakdown
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Terraform Configuration (game_day_notifications.tf)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Terraform file provisions all the necessary AWS resources:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;SNS Topic – For sending notifications.&lt;/li&gt;
&lt;li&gt;IAM Role and Policies – Grants Lambda access to SNS, SSM, and CloudWatch.&lt;/li&gt;
&lt;li&gt;Lambda Function – Fetches NBA scores and processes data.&lt;/li&gt;
&lt;li&gt;EventBridge Rule – Triggers the Lambda function every 2 hours.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s a snippet of the Terraform configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;provider "aws" {
  region = "us-east-1" # Change as needed
}

# SNS Topic
resource "aws_sns_topic" "nba_game_alerts" {
  name = "nba_game_alerts"
}

# IAM Role for Lambda
resource "aws_iam_role" "lambda_role" {
  name = "nba_lambda_role"

  assume_role_policy = &amp;lt;&amp;lt;EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Action": "sts:AssumeRole",
      "Principal": {
        "Service": "lambda.amazonaws.com"
      },
      "Effect": "Allow",
      "Sid": ""
    }
  ]
}
EOF
}

# IAM Policy for Lambda to publish to SNS
resource "aws_iam_policy" "sns_publish_policy" {
  name        = "sns_publish_policy"
  description = "Policy to allow Lambda to publish to SNS"

  policy = &amp;lt;&amp;lt;EOF
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": "sns:Publish",
      "Resource": "${aws_sns_topic.nba_game_alerts.arn}"
    }
  ]
}
EOF
}

# Attach IAM Policy for Lambda to publish to SNS to IAM Role
resource "aws_iam_role_policy_attachment" "attach_sns_publish" {
  role       = aws_iam_role.lambda_role.name
  policy_arn = aws_iam_policy.sns_publish_policy.arn
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Python Script (nba_notifications.py)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The Python script handles:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Fetching the API key securely from AWS SSM.&lt;/li&gt;
&lt;li&gt;Getting live NBA scores from SportsData.io.&lt;/li&gt;
&lt;li&gt;Processing and formatting the game data.&lt;/li&gt;
&lt;li&gt;Publishing game updates to SNS for notifications.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Here’s a snippet of the Python script:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
import json
import urllib.request
import boto3
from datetime import datetime, timedelta, timezone

def format_game_data(game):
    status = game.get("Status", "Unknown")
    away_team = game.get("AwayTeam", "Unknown")
    home_team = game.get("HomeTeam", "Unknown")
    final_score = f"{game.get('AwayTeamScore', 'N/A')}-{game.get('HomeTeamScore', 'N/A')}"
    start_time = game.get("DateTime", "Unknown")
    channel = game.get("Channel", "Unknown")

    # Format quarters
    quarters = game.get("Quarters", [])
    quarter_scores = ', '.join([f"Q{q['Number']}: {q.get('AwayScore', 'N/A')}-{q.get('HomeScore', 'N/A')}" for q in quarters])

    if status == "Final":
        return (
            f"Game Status: {status}\n"
            f"{away_team} vs {home_team}\n"
            f"Final Score: {final_score}\n"
            f"Start Time: {start_time}\n"
            f"Channel: {channel}\n"
            f"Quarter Scores: {quarter_scores}\n"
        )
    elif status == "InProgress":
        last_play = game.get("LastPlay", "N/A")
        return (
            f"Game Status: {status}\n"
            f"{away_team} vs {home_team}\n"
            f"Current Score: {final_score}\n"
            f"Last Play: {last_play}\n"
            f"Channel: {channel}\n"
        )
    elif status == "Scheduled":
        return (
            f"Game Status: {status}\n"
            f"{away_team} vs {home_team}\n"
            f"Start Time: {start_time}\n"
            f"Channel: {channel}\n"
        )
    else:
        return (
            f"Game Status: {status}\n"
            f"{away_team} vs {home_team}\n"
            f"Details are unavailable at the moment.\n"
        )

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step-by-Step Deployment
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Clone the Repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;First, clone the GitHub repository to your local machine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/princemaxi/game-day-notifications_terraform
cd game-day-notifications
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 2: Store API Key in AWS Systems Manager (SSM)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To fetch NBA game data, we need an API key from SportsData.io.&lt;/li&gt;
&lt;li&gt;Once you have your API key, store it securely in AWS Systems Manager (SSM):
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ssm put-parameter --name "nba-api-key" --value "&amp;lt;YOUR_API_KEY&amp;gt;" --type "SecureString"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This ensures your API key is stored securely instead of being hardcoded in your code. ✅&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnpypl1sn5q5419bs3daa.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnpypl1sn5q5419bs3daa.png" alt="Image description" width="800" height="154"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Deploy Infrastructure with Terraform&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Initialize Terraform
Run this command to initialize Terraform and download provider plugins:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58608ylr64bp6idn778w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F58608ylr64bp6idn778w.png" alt="Image description" width="800" height="244"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Format Configuration Files
To keep everything clean and readable, format Terraform files:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform fmt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Validate Configuration
Before applying, check for syntax errors:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform validate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmj08guzk4gmkuny3zl3g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmj08guzk4gmkuny3zl3g.png" alt="Image description" width="800" height="68"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Plan Deployment
Preview the changes Terraform will make:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform plan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprwkp5itliz1h3qrvxct.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fprwkp5itliz1h3qrvxct.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftslzkdr5347ys8kae0rf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftslzkdr5347ys8kae0rf.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Apply Configuration
Finally, deploy the infrastructure:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform apply -auto-approve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;✨ Boom! In just 15 seconds, your entire system is up and running! 🚀&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feyr9xgkbiz3cy1xobs8o.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feyr9xgkbiz3cy1xobs8o.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2kl3gtem15f8mmy232wp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2kl3gtem15f8mmy232wp.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Add SNS Subscriptions&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;After deployment, add users to the SNS Topic for notifications:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open AWS SNS in the AWS Console.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgra2uten54klkiiby9p.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsgra2uten54klkiiby9p.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select the NBA Game Day SNS Topic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2z755jhazezqj7b1jru1.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2z755jhazezqj7b1jru1.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create Subscription.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fw0y1yixyyp5muokpba.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1fw0y1yixyyp5muokpba.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose a protocol:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Email: Enter a valid email.&lt;/li&gt;
&lt;li&gt;SMS: Enter a valid phone number (e.g., +1234567890).&lt;/li&gt;
&lt;/ol&gt;

&lt;ul&gt;
&lt;li&gt;Click Create Subscription.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1y10vy0ragp1zhv9flpc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1y10vy0ragp1zhv9flpc.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;For Email: Check your inbox and confirm the subscription.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8uog9edbujnjv45ba319.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8uog9edbujnjv45ba319.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fneh8q93jojntu8q7bpv7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fneh8q93jojntu8q7bpv7.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, whenever there’s an NBA game, you’ll get real-time updates!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Testing the System&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let’s test the solution:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to AWS Lambda in the AWS Console.&lt;/li&gt;
&lt;li&gt;Select the nba_notifications Lambda function.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbfk1obgn8wm1qmgwl36i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbfk1obgn8wm1qmgwl36i.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Test and create a test event.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxkt9kfryk37n3wqyymh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frxkt9kfryk37n3wqyymh.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjqegif5h4tcxeazcjbzb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fjqegif5h4tcxeazcjbzb.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run the function and check CloudWatch logs.&lt;/li&gt;
&lt;li&gt;Verify SMS/Email notifications in your inbox or phone.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0mu4ei6dptf2llvb3ruy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0mu4ei6dptf2llvb3ruy.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Success! You now have a fully automated, real-time NBA game notification system. 🎉&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Clean Up Resources with Terraform Destroy&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once you’re done testing or no longer need the system, you can clean up all the AWS resources created by Terraform with a single command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform destroy -auto-approve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4055z30wo60rn31b68bl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4055z30wo60rn31b68bl.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This command will:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Delete the SNS Topic and its subscriptions.&lt;/li&gt;
&lt;li&gt;Remove the Lambda Function and its associated IAM roles and policies.&lt;/li&gt;
&lt;li&gt;Delete the EventBridge Rule and its permissions.&lt;/li&gt;
&lt;li&gt;Remove the SSM Parameter storing the API key.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flcd1c0v0fg8psxp4w3rz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flcd1c0v0fg8psxp4w3rz.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: Be cautious when running this command, as it will permanently delete all resources managed by Terraform in this configuration.&lt;/em&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Terraform &amp;amp; Infrastructure as Code (IaC)?
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;✅ Fast Deployment:&lt;/strong&gt; What took minutes manually is now provisioned in 15 seconds.&lt;br&gt;
&lt;strong&gt;✅ Scalability:&lt;/strong&gt; Need more users? Just update the Terraform config.&lt;br&gt;
&lt;strong&gt;✅ Security:&lt;/strong&gt; IAM policies ensure least privilege access.&lt;br&gt;
&lt;strong&gt;✅ Automation:&lt;/strong&gt; No more manual configurations—Terraform handles it all.&lt;/p&gt;

&lt;h2&gt;
  
  
  Final Thoughts &amp;amp; Key Learnings
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;🚀 Building this project reinforced key DevOps principles:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;✔️ IaC is a game-changer&lt;/strong&gt; – Terraform made everything smooth and repeatable.&lt;br&gt;
&lt;strong&gt;✔️ AWS Event-Driven Architecture&lt;/strong&gt; enables real-time notifications.&lt;br&gt;
&lt;strong&gt;✔️ Security matters&lt;/strong&gt; – Storing secrets in AWS SSM keeps them safe.&lt;br&gt;
&lt;strong&gt;✔️ Automation saves time&lt;/strong&gt; – 15 seconds vs. several minutes of manual work!&lt;/p&gt;

&lt;p&gt;🔥 Thank you for reading! If you found this helpful, share it with your network and follow for more DevOps insights! 🚀&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;💬 What are your thoughts on Terraform for infrastructure automation? Let’s discuss in the comments! ⬇️&lt;/em&gt;&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>devops</category>
      <category>terraform</category>
      <category>python</category>
      <category>aws</category>
    </item>
    <item>
      <title>Automating AWS EC2 Provisioning with Terraform: A Step-by-Step Guide</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Sat, 08 Feb 2025 13:53:12 +0000</pubDate>
      <link>https://forem.com/princemaxi/automating-aws-ec2-provisioning-with-terraform-a-step-by-step-guide-5cj9</link>
      <guid>https://forem.com/princemaxi/automating-aws-ec2-provisioning-with-terraform-a-step-by-step-guide-5cj9</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;Manually setting up cloud infrastructure can be time-consuming, error-prone, and difficult to maintain. This is where Infrastructure as Code (IaC) tools like Terraform revolutionize cloud provisioning.&lt;/p&gt;

&lt;p&gt;In this guide, we’ll walk through the step-by-step process of provisioning an AWS EC2 instance using Terraform, from installation to deployment and cleanup.&lt;/p&gt;

&lt;p&gt;By the end of this tutorial, you'll understand:&lt;br&gt;
✅ The importance of Terraform in cloud infrastructure management&lt;br&gt;
✅ How to install and configure Terraform on different operating systems&lt;br&gt;
✅ The step-by-step process to provision an EC2 instance on AWS&lt;br&gt;
✅ Best practices for scaling and managing cloud resources efficiently&lt;/p&gt;
&lt;h2&gt;
  
  
  🔧 Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before we begin, ensure you have the following:&lt;/p&gt;
&lt;h4&gt;
  
  
  1. An AWS Account
&lt;/h4&gt;

&lt;p&gt;If you don’t have one, sign up at &lt;a href="https://us-east-1.console.aws.amazon.com/" rel="noopener noreferrer"&gt;AWS Console&lt;/a&gt; and set up your IAM user with programmatic access.&lt;/p&gt;
&lt;h4&gt;
  
  
  2. Install Terraform
&lt;/h4&gt;

&lt;p&gt;Terraform runs on Windows, macOS, and Linux. Follow the installation steps for your OS:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Windows&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Download Terraform from the &lt;a href="https://www.terraform.io/" rel="noopener noreferrer"&gt;Terraform website&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Extract the .zip file and add it to your system’s PATH.&lt;/li&gt;
&lt;li&gt;Verify the installation:
&lt;code&gt;terraform --version&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;macOS (Using Homebrew)&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;brew tap hashicorp/tap
brew install hashicorp/tap/terraform
terraform --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Linux&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install -y gnupg software-properties-common
wget -O- https://apt.releases.hashicorp.com/gpg | sudo gpg --dearmor -o /usr/share/keyrings/hashicorp-archive-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/hashicorp-archive-keyring.gpg] https://apt.releases.hashicorp.com $(lsb_release -cs) main" | sudo tee /etc/apt/sources.list.d/hashicorp.list
sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install terraform
terraform --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  🌍 Step 1: Configuring Terraform for AWS
&lt;/h4&gt;

&lt;p&gt;Terraform requires AWS credentials to interact with your AWS environment. You can configure AWS credentials in two ways:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 1: Using AWS CLI&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;- Install AWS CLI:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install awscli  # Linux
brew install awscli       # macOS
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;- Configure AWS:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws configure
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Provide your AWS Access Key, Secret Key, Region, and Output Format.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Option 2: Manually Adding AWS Credentials&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Store credentials in &lt;code&gt;~/.aws/credentials&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[default]
aws_access_key_id = YOUR_ACCESS_KEY
aws_secret_access_key = YOUR_SECRET_KEY
region = eu-west-2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  📝 Step 2: Writing the Terraform Configuration File
&lt;/h4&gt;

&lt;p&gt;Now, create a working directory for Terraform:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir terraform-ec2 &amp;amp;&amp;amp; cd terraform-ec2

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Create a file named main.tf, and add the following configuration:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;provider "aws" {
    profile = "default"
    region  = "eu-west-2"
}

resource "aws_instance" "UGO_Server" {
    ami           = "ami-0cbf43fd299e3a464"
    instance_type = "t2.micro"

    tags = {
        Name = "MyNCAAInstance"
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxfw9j1curdp13y6uqss.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ffxfw9j1curdp13y6uqss.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Breaking Down the Code&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;✅ provider "aws" – Defines AWS as the cloud provider and sets the region.&lt;br&gt;
✅ resource "aws_instance" "UGO_Server" – Creates an EC2 instance.&lt;br&gt;
✅ ami – Uses an Amazon Machine Image (AMI) for the instance.&lt;br&gt;
✅ instance_type – Specifies the instance type (t2.micro for free tier).&lt;br&gt;
✅ tags – Assigns a name to the instance.&lt;/p&gt;
&lt;h4&gt;
  
  
  🚀 Step 3: Initializing and Applying Terraform
&lt;/h4&gt;

&lt;p&gt;Before deploying, we need to initialize Terraform:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform init
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2fk9t4nkres2repl1ugy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2fk9t4nkres2repl1ugy.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This downloads the necessary provider plugins.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check the Execution Plan&lt;/strong&gt;&lt;br&gt;
Run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform plan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5b5t3hlkgi3xae39bnj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu5b5t3hlkgi3xae39bnj.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This shows what Terraform will create.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Apply the Configuration&lt;/strong&gt;&lt;br&gt;
Now, deploy your EC2 instance:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform apply -auto-approve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcadce01dg8nmf5kfv30s.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcadce01dg8nmf5kfv30s.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This provisions the EC2 instance in AWS.&lt;/p&gt;

&lt;h4&gt;
  
  
  📌 Step 4: Confirming the Deployment
&lt;/h4&gt;

&lt;ol&gt;
&lt;li&gt;Go to the AWS Console&lt;/li&gt;
&lt;li&gt;Navigate to EC2 → Instances&lt;/li&gt;
&lt;li&gt;Verify that your instance is running 🎉&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6byoklzsqprj62h7b209.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6byoklzsqprj62h7b209.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7p91yqym6i5p5xat7tsy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F7p91yqym6i5p5xat7tsy.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  🧹 Step 5: Destroying the Infrastructure
&lt;/h4&gt;

&lt;p&gt;When you're done, clean up resources to avoid unnecessary charges:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;terraform destroy -auto-approve
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu91gygyhij1xh2vmy3ez.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu91gygyhij1xh2vmy3ez.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcagxs47jn5stsfnvbcyn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fcagxs47jn5stsfnvbcyn.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This safely removes all provisioned resources.&lt;/p&gt;

&lt;h2&gt;
  
  
  💡 Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Terraform simplifies cloud provisioning with Infrastructure as Code (IaC).&lt;/li&gt;
&lt;li&gt;You can automate AWS EC2 deployment in a few lines of code.&lt;/li&gt;
&lt;li&gt;Terraform ensures repeatability, scalability, and consistency in cloud infrastructure.&lt;/li&gt;
&lt;li&gt;Cleanup is easy using terraform destroy, preventing resource waste.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🎯 Next Steps
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Try it yourself – Clone my GitHub repo and experiment!
👉 &lt;a href="https://github.com/princemaxi/terraform-provision-ec2/tree/main" rel="noopener noreferrer"&gt;GitHub Repository&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Extend the setup – Add security groups, attach an EBS volume, or deploy multiple instances.&lt;/li&gt;
&lt;li&gt;Learn Terraform Modules – Use modular code to manage large-scale deployments.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;🚀 What’s your experience with Terraform? Let’s discuss in the comments! 👇&lt;/em&gt;&lt;/p&gt;

</description>
      <category>terraform</category>
      <category>aws</category>
      <category>devops</category>
      <category>infrastructureascode</category>
    </item>
    <item>
      <title>Building a Scalable Sports API Management System with AWS</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Thu, 30 Jan 2025 11:21:36 +0000</pubDate>
      <link>https://forem.com/princemaxi/building-a-scalable-sports-api-management-system-with-aws-232i</link>
      <guid>https://forem.com/princemaxi/building-a-scalable-sports-api-management-system-with-aws-232i</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;In the era of real-time data, sports applications require high availability, scalability, and efficient API management to handle large amounts of live sports data. In this blog, we will walk through the process of building a containerized Sports API Management System leveraging AWS services such as Amazon ECS (Fargate), API Gateway, and an Application Load Balancer (ALB).&lt;/p&gt;

&lt;p&gt;By the end of this guide, you'll have a fully functional scalable REST API for querying live sports data, deployed in a serverless containerized environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;p&gt;This project demonstrates how to build a containerized API management system for querying real-time sports data. It integrates:&lt;/p&gt;

&lt;p&gt;✅ Amazon ECS (Fargate): To run a containerized backend for scalability and performance.&lt;br&gt;
✅ Amazon API Gateway: For managing and exposing REST endpoints.&lt;br&gt;
✅ Amazon Elastic Container Registry (ECR): To store and manage Docker container images.&lt;br&gt;
✅ Application Load Balancer (ALB): To distribute incoming requests across multiple ECS tasks for high availability and fault tolerance.&lt;br&gt;
✅ External Sports API: For fetching real-time sports data.&lt;/p&gt;

&lt;p&gt;This architecture provides a secure, scalable, and serverless solution ideal for high-traffic sports applications.&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;Before getting started, ensure you have the following:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Sports API Key:&lt;/strong&gt; Sign up at SerpApi and obtain an API key.&lt;br&gt;
&lt;strong&gt;2. AWS Account:&lt;/strong&gt; Ensure you have an AWS account with permissions to create and manage ECS, API Gateway, and ECR resources.&lt;br&gt;
&lt;strong&gt;3. AWS CLI Installed and Configured:&lt;/strong&gt; Install and configure the AWS CLI to interact with AWS programmatically.&lt;br&gt;
&lt;strong&gt;4. Docker CLI and Desktop Installed:&lt;/strong&gt; Required for building and pushing container images.&lt;br&gt;
&lt;strong&gt;5. SerpApi Python Library Installed:&lt;/strong&gt; Run pip install google-search-results to install the required library.&lt;/p&gt;
&lt;h2&gt;
  
  
  Step-by-Step Implementation
&lt;/h2&gt;
&lt;h3&gt;
  
  
  Step 1: Clone the Repository
&lt;/h3&gt;


&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/princemaxi/containerized-sports-api
cd containerized-sports-api
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;h3&gt;
  
  
  Step 2: Create an ECR Repository
&lt;/h3&gt;

&lt;p&gt;ECR is used to store and manage the Docker container images. Run the following command to create a repository:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecr create-repository --repository-name sports-api --region us-east-1

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9yu3sopng701pa7ef92j.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9yu3sopng701pa7ef92j.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvvv9pentdwzlb01s1z3i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvvv9pentdwzlb01s1z3i.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 3: Build and Push the Docker Image
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Authenticate Docker to AWS ECR:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;aws ecr get-login-password --region us-east-1 | docker login --username AWS --password-stdin &amp;lt;AWS_ACCOUNT_ID&amp;gt;.dkr.ecr.us-east-1.amazonaws.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpm6nnmv3dikul2p9cfyt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpm6nnmv3dikul2p9cfyt.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Build the Docker image:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker build --platform linux/amd64 -t sports-api .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21csys0ral3h04occ017.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21csys0ral3h04occ017.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Tag and push the image to ECR:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;docker tag sports-api:latest &amp;lt;AWS_ACCOUNT_ID&amp;gt;.dkr.ecr.us-east-1.amazonaws.com/sports-api:sports-api-latest
docker push &amp;lt;AWS_ACCOUNT_ID&amp;gt;.dkr.ecr.us-east-1.amazonaws.com/sports-api:sports-api-latest

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgkexecqix5w1j609h4yn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgkexecqix5w1j609h4yn.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4jzxsljl2f80cbb005ip.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4jzxsljl2f80cbb005ip.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 4: Set Up an ECS Cluster with Fargate
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Create an ECS Cluster&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to the ECS Console → Clusters → Create Cluster.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foqvmcktpaid4qw5jaidm.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foqvmcktpaid4qw5jaidm.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0bybhayg3fonwsthgaf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fe0bybhayg3fonwsthgaf.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F85sptvexzvpevfj6ys32.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F85sptvexzvpevfj6ys32.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Name your cluster sports-api-cluster.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Select Fargate as the infrastructure type.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm2jftuh54q6d40fgugb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkm2jftuh54q6d40fgugb.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create Cluster.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnywop8o4w6xtnuljsjlk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnywop8o4w6xtnuljsjlk.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a Task Definition&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to Task Definitions → Create New Task Definition.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvs90oejtmhfj77brfaac.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvs90oejtmhfj77brfaac.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name it sports-api-task.&lt;/li&gt;
&lt;li&gt;Select Fargate as the launch type.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fys0ipdb2hm9khi71io2x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fys0ipdb2hm9khi71io2x.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Add a container:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Name: sports-api-container&lt;/li&gt;
&lt;li&gt;Image URI: .dkr.ecr.us-east-1.amazonaws.com/sports-api:sports-api-latest&lt;/li&gt;
&lt;li&gt;Container Port: 8080&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frp48gl9uefi7wbiyku99.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frp48gl9uefi7wbiyku99.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Define Environment Variables:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Key: SPORTS_API_KEY&lt;br&gt;
Value: YOUR_SPORTSDATA.IO_API_KEY&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn36qa33zhaerujlerc6x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fn36qa33zhaerujlerc6x.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create Task Definition.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tsofgjdux4x6j1ozy3x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9tsofgjdux4x6j1ozy3x.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F822c9ohkyvz9rhfq15nn.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F822c9ohkyvz9rhfq15nn.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Run the Service with an ALB&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to Clusters → Select your cluster → Services → Create.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnk3tm9chehitmhhhbbhr.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnk3tm9chehitmhhhbbhr.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Choose Fargate as the capacity provider.&lt;/li&gt;
&lt;li&gt;Select the sports-api-task definition.&lt;/li&gt;
&lt;li&gt;Name your service sports-api-service.&lt;/li&gt;
&lt;li&gt;Set desired tasks to 2.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctqkmljl9gqrwu5g0sj6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fctqkmljl9gqrwu5g0sj6.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Configure Networking:&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Create a new security group.&lt;/li&gt;
&lt;li&gt;Type: All TCP&lt;/li&gt;
&lt;li&gt;Source: Anywhere.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6i5u55a1icteq3cmlkyv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6i5u55a1icteq3cmlkyv.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Select Application Load Balancer (ALB) for Load Balancing.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Configure ALB:&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;ol&gt;
&lt;li&gt;Create a new ALB: sports-api-alb.&lt;/li&gt;
&lt;li&gt;Target Group Health Check Path: "/sports".&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flau7ag4umwpwx4903exe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Flau7ag4umwpwx4903exe.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm5urmj8rjn93nwacmset.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm5urmj8rjn93nwacmset.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Click Create Service.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Test the ALB&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Once deployed, note the DNS name of the ALB:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://sports-api-alb-&amp;lt;AWS_ACCOUNT_ID&amp;gt;.us-east-1.elb.amazonaws.com/sports

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzgly24t3o2wkn9dfmne.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmzgly24t3o2wkn9dfmne.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Visit the URL in a browser to confirm the API is running.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F48m8w70z2xihp37z0tow.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F48m8w70z2xihp37z0tow.png" alt="Image description" width="800" height="400"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Step 5: Configure API Gateway
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa9e7ek3frkhbdqdpe57e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fa9e7ek3frkhbdqdpe57e.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create a New REST API&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to API Gateway Console → Create API → REST API.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu6q76yl37q6tkccsn8ao.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu6q76yl37q6tkccsn8ao.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Name it Sports API Gateway.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8u8zcb1ajoj4ixt8m3ap.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8u8zcb1ajoj4ixt8m3ap.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Set Up Integration&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a resource /sports.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vx314auvmrgwikfdl2f.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F0vx314auvmrgwikfdl2f.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fquo065nz9ldnappy4yr3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fquo065nz9ldnappy4yr3.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create a GET method.&lt;/li&gt;
&lt;li&gt;Choose HTTP Proxy as the integration type.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk51g5vkxwnhgmsnq63ux.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fk51g5vkxwnhgmsnq63ux.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Enter the ALB DNS name:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;http://sports-api-alb-&amp;lt;AWS_ACCOUNT_ID&amp;gt;.us-east-1.elb.amazonaws.com/sports

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frd716gzay2go3rk33und.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Frd716gzay2go3rk33und.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Deploy the API&lt;/strong&gt;&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Deploy to a stage (e.g., prod).&lt;/li&gt;
&lt;li&gt;Note the endpoint URL.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fot1rt2esi8thcza4btn7.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fot1rt2esi8thcza4btn7.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9hvx5edkdf429e9f5kl3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9hvx5edkdf429e9f5kl3.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Test the API Gateway&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl https://&amp;lt;api-gateway-id&amp;gt;.execute-api.us-east-1.amazonaws.com/prod/sports
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyqkdmwc2f1qndcpsdxx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fpyqkdmwc2f1qndcpsdxx.png" alt="Image description" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What We Learned
&lt;/h2&gt;

&lt;p&gt;✔️ Deploying a containerized, scalable application on AWS using ECS and ALB.&lt;br&gt;
✔️ Managing API routing and security using API Gateway.&lt;br&gt;
✔️ Configuring IAM roles with least privilege access.&lt;/p&gt;

&lt;h2&gt;
  
  
  Future Enhancements
&lt;/h2&gt;

&lt;p&gt;🔹 Add caching using Amazon ElastiCache for frequent API requests.&lt;br&gt;
🔹 Integrate DynamoDB to store user preferences.&lt;br&gt;
🔹 Secure API Gateway using API keys or IAM authentication.&lt;br&gt;
🔹 Implement CI/CD using AWS CodePipeline and CodeBuild.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;This project demonstrates how DevOps and cloud computing can build resilient, scalable, and secure APIs. With ECS, ALB, and API Gateway, you can deploy high-performance applications without managing servers. Try this project, explore AWS services, and elevate your cloud skills! 🚀&lt;/p&gt;

</description>
      <category>aws</category>
      <category>docker</category>
      <category>python</category>
      <category>devops</category>
    </item>
    <item>
      <title>NBA Game Day Notifications / Sports Alerts System</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Sun, 12 Jan 2025 16:43:05 +0000</pubDate>
      <link>https://forem.com/princemaxi/nba-game-day-notifications-sports-alerts-system-4k36</link>
      <guid>https://forem.com/princemaxi/nba-game-day-notifications-sports-alerts-system-4k36</guid>
      <description>&lt;p&gt;A real-time notification system designed for sports enthusiasts, providing live NBA game updates via SMS and email. This project leverages AWS services, Python, and the NBA Game API to create a secure, automated, and user-friendly alert system.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Highlights
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real-Time Game Updates:&lt;/strong&gt; Fetches live NBA game scores using an external API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Multi-Channel Notifications:&lt;/strong&gt; Sends formatted score updates to subscribers via SMS and Email using Amazon SNS.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automated Scheduling:&lt;/strong&gt; Utilizes Amazon EventBridge to automate regular notifications during game hours.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Secure Architecture:&lt;/strong&gt; Designed with security best practices, implementing least privilege access for IAM roles.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Features
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;🏀 Live Score Updates:&lt;/strong&gt; Stay updated with the latest NBA scores and stats in real time.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;📩 Customizable Alerts:&lt;/strong&gt; Receive notifications via your preferred channel—SMS or Email.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;⚙️ Scheduled Updates:&lt;/strong&gt; Automatically sends updates at key intervals, ensuring fans never miss critical game moments.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;🔒 Secure Infrastructure:&lt;/strong&gt; Adheres to cloud security principles for robust and reliable operations.&lt;/p&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;1️⃣ Sports API Key:&lt;/strong&gt; Create a free account at sportsdata.io to access NBA game data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;2️⃣ AWS Account:&lt;/strong&gt; Set up an AWS account with basic knowledge of AWS services like SNS, Lambda, and EventBridge.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;3️⃣ Python Skills:&lt;/strong&gt; Familiarity with Python for setting up API integration and notification logic.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Why This Project Matters
&lt;/h2&gt;

&lt;p&gt;This system combines cloud computing and real-world application of APIs to deliver timely sports alerts, making it a perfect example of leveraging modern technology for fan engagement.&lt;/p&gt;

&lt;h2&gt;
  
  
  Technical Architecture
&lt;/h2&gt;

&lt;p&gt;Technologies Used&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Cloud Provider:&lt;/strong&gt; AWS&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Core AWS Services:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amazon SNS (Simple Notification Service):&lt;/strong&gt; Sends notifications to subscribers via SMS and Email.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;AWS Lambda:&lt;/strong&gt; Executes the notification logic when triggered.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amazon EventBridge:&lt;/strong&gt; Automates scheduling of notifications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;External API:&lt;/strong&gt; NBA Game API (SportsData.io)&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Programming Language:&lt;/strong&gt; Python 3.x&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;IAM Security:&lt;/strong&gt; Implements the principle of least privilege for roles and policies.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foeyq7ny3dzaoks8g0q4v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foeyq7ny3dzaoks8g0q4v.png" alt="Image description" width="800" height="757"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-by-Step Implementation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Clone the Repository&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;git clone &lt;a href="https://github.com/princemaxi/Game-Day-Notifications" rel="noopener noreferrer"&gt;https://github.com/princemaxi/Game-Day-Notifications&lt;/a&gt;&lt;br&gt;
cd game-day-notifications&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Create an SNS Topic&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the SNS service in the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Click Create Topic → Select Standard.&lt;/li&gt;
&lt;li&gt;Name the topic (e.g., gd_topic) and note the ARN.&lt;/li&gt;
&lt;li&gt;Click Create Topic.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 3: Add Subscriptions to the SNS Topic&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Select your SNS topic and go to the Subscriptions tab → Click Create Subscription.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Choose your preferred protocol:&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Email:&lt;/strong&gt; Provide a valid email address and confirm the subscription via the link sent to your inbox.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SMS:&lt;/strong&gt; Enter a phone number in international format (e.g., +1234567890).&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff20tbq1z364xt3k0neg0.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ff20tbq1z364xt3k0neg0.png" alt="Image description" width="800" height="357"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Create an SNS Publish Policy&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to IAM service → Policies → Create Policy.&lt;/li&gt;
&lt;li&gt;Under JSON, paste the content from policies/gd_sns_policy.json.&lt;/li&gt;
&lt;li&gt;Replace REGION and ACCOUNT_ID with your AWS region and account ID.&lt;/li&gt;
&lt;li&gt;Click Next → Review, name the policy (e.g., gd_sns_policy), and click Create Policy.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 5: Create an IAM Role for Lambda&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to IAM service → Roles → Create Role.&lt;/li&gt;
&lt;li&gt;Select AWS Service → Choose Lambda.&lt;/li&gt;
&lt;li&gt;Attach the following policies:&lt;/li&gt;
&lt;li&gt;gd_sns_policy (created in Step 4).&lt;/li&gt;
&lt;li&gt;AWSLambdaBasicExecutionRole (AWS-managed policy).&lt;/li&gt;
&lt;li&gt;Name the role (e.g., gd_role) and save its ARN.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdamn8l0udibjtyu3fts4.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdamn8l0udibjtyu3fts4.png" alt="Image description" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 6: Deploy the Lambda Function&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Go to Lambda service → Create Function → Author from Scratch.&lt;/li&gt;
&lt;li&gt;Enter a name (e.g., gd_notifications) and select Python 3.13 as the runtime.&lt;/li&gt;
&lt;li&gt;Assign the IAM role (gd_role) to the function.&lt;/li&gt;
&lt;li&gt;Upload the code from src/gd_notifications.py into the function editor.&lt;/li&gt;
&lt;li&gt;Add environment variables:&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;NBA_API_KEY:&lt;/strong&gt; Your SportsData.io API key.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SNS_TOPIC_ARN:&lt;/strong&gt; The ARN of the SNS topic created earlier.&lt;/li&gt;
&lt;li&gt;Click Create Function.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiud446n37y9dbxb3azrb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiud446n37y9dbxb3azrb.png" alt="Image description" width="800" height="359"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd5dwavrv3pys4ni97jma.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fd5dwavrv3pys4ni97jma.png" alt="Image description" width="800" height="364"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 7: Set Up Automation with EventBridge&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to EventBridge → Rules → Create Rule.&lt;/li&gt;
&lt;li&gt;Set the event source to Schedule → Use a cron expression for regular updates.&lt;/li&gt;
&lt;li&gt;Example (hourly updates): 0 * * * *&lt;/li&gt;
&lt;li&gt;Set the target to your Lambda function (gd_notifications) and save the rule.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Step 8: Test the System&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the Lambda function in the AWS Console.&lt;/li&gt;
&lt;li&gt;Create a test event to simulate execution.&lt;/li&gt;
&lt;li&gt;Verify that notifications are sent to your email/SMS subscribers.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8ade6wrquhhexc46cua.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8ade6wrquhhexc46cua.png" alt="Image description" width="800" height="358"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj62tnn31sja2yo1d7wkc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fj62tnn31sja2yo1d7wkc.png" alt="Image description" width="800" height="351"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Takeaways
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Integrated AWS SNS, Lambda, and EventBridge to design a real-time notification system.&lt;/li&gt;
&lt;li&gt;Secured the architecture with least privilege IAM policies.&lt;/li&gt;
&lt;li&gt;Demonstrated API integration and automation in a cloud environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Future Enhancements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Add NFL Alerts:&lt;/strong&gt; Extend functionality to include NFL game notifications.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Personalized Preferences:&lt;/strong&gt; Use DynamoDB to store user preferences (e.g., teams or game types).&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Web UI Integration:&lt;/strong&gt; Create a frontend interface for users to manage subscriptions and preferences.&lt;/li&gt;
&lt;li&gt;****Enhanced Analytics: Use AWS CloudWatch for deeper insights into notification performance.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;This project exemplifies how cloud technologies and APIs can revolutionize user engagement. By leveraging AWS services, Python, and real-time data, we’ve built a robust system that keeps sports fans connected to the action. Whether it’s NBA game day updates or future enhancements like NFL alerts, the possibilities are endless.&lt;/em&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Building a Real-Time Weather Data Collection System with Python and AWS</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Sun, 12 Jan 2025 15:35:27 +0000</pubDate>
      <link>https://forem.com/princemaxi/building-a-real-time-weather-data-collection-system-with-python-and-aws-fel</link>
      <guid>https://forem.com/princemaxi/building-a-real-time-weather-data-collection-system-with-python-and-aws-fel</guid>
      <description>&lt;p&gt;In the era of data-driven decision-making, weather data has become an invaluable resource for businesses and individuals. Whether it’s for logistics, agriculture, or travel planning, a real-time weather data collection system can provide actionable insights. In this blog, we’ll walk through building a Weather Data Collection System using Python, the OpenWeather API, and AWS S3 for storage.&lt;/p&gt;

&lt;h2&gt;
  
  
  Project Overview
&lt;/h2&gt;

&lt;p&gt;This project demonstrates how to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Fetch weather data using the OpenWeather API.&lt;/li&gt;
&lt;li&gt;Display the weather data when running a Python script.&lt;/li&gt;
&lt;li&gt;Store the data in an AWS S3 bucket for historical tracking and analysis.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By the end of this guide, you’ll have a fully functional system showcasing key aspects of DevOps principles, including automation, cloud integration, and scalability.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Services Overview
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Amazon S3 (Simple Storage Service)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function:&lt;/strong&gt; Amazon S3 is a highly scalable and secure object storage service. In this project, it stores historical weather data for analysis.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Key Features:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; Handles growing datasets effortlessly.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Durability:&lt;/strong&gt; Ensures data is not lost with multiple redundancies.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration:&lt;/strong&gt; Works seamlessly with other AWS services like Lambda, Glue, and Athena.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;In our system, the S3 bucket serves as the repository for all weather data fetched from the OpenWeather API.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step-by-Step Implementation
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before we start coding, ensure you have the following:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. AWS Account:&lt;/strong&gt; Create an AWS S3 bucket where the weather data will be stored.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. OpenWeather API Key:&lt;/strong&gt; Sign up at OpenWeather and obtain your API key.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Python Installed:&lt;/strong&gt; Ensure Python 3.x is installed on your system. For this project, we’ll use VSCode as our IDE.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Install Dependencies:&lt;/strong&gt; Create a &lt;code&gt;requirements.txt&lt;/code&gt; file with the following content:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;boto3==1.26.137
python-dotenv==1.0.0
requests==2.28.2

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Run the following command to install the dependencies:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;pip install -r requirements.txt&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ncm7pg04k7gm9abad22.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3ncm7pg04k7gm9abad22.png" alt="Image description" width="800" height="264"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Set Up Your Environment&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a Project Directory:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir weather-data-collector
cd weather-data-collector
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create a .env File:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Store sensitive information like API keys securely in a .env file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OPENWEATHER_API_KEY=your_openweather_api_key
AWS_ACCESS_KEY_ID=your_aws_access_key_id
AWS_SECRET_ACCESS_KEY=your_aws_secret_access_key
S3_BUCKET_NAME=your_s3_bucket_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Fetch Weather Data&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Create a Python script to fetch weather data using the OpenWeather API. Store Data in AWS S3 by using the boto3 library to upload weather data to an S3 bucket.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi3ip5bwc1hl0ticm54kz.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi3ip5bwc1hl0ticm54kz.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;fetch_weather.py:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import os
import json
import boto3
import requests
from datetime import datetime
from dotenv import load_dotenv

# Load environment variables
load_dotenv()

class WeatherDashboard:
    def __init__(self):
        self.api_key = os.getenv('OPENWEATHER_API_KEY')
        self.bucket_name = os.getenv('AWS_BUCKET_NAME')
        self.s3_client = boto3.client('s3')

    def create_bucket_if_not_exists(self):
        """Create S3 bucket if it doesn't exist"""
        try:
            self.s3_client.head_bucket(Bucket=self.bucket_name)
            print(f"Bucket {self.bucket_name} exists")
        except:
            print(f"Creating bucket {self.bucket_name}")
        try:
            # Simpler creation for us-east-1
            self.s3_client.create_bucket(Bucket=self.bucket_name)
            print(f"Successfully created bucket {self.bucket_name}")
        except Exception as e:
            print(f"Error creating bucket: {e}")

    def fetch_weather(self, city):
        """Fetch weather data from OpenWeather API"""
        base_url = "http://api.openweathermap.org/data/2.5/weather"
        params = {
            "q": city,
            "appid": self.api_key,
            "units": "imperial"
        }

        try:
            response = requests.get(base_url, params=params)
            response.raise_for_status()
            return response.json()
        except requests.exceptions.RequestException as e:
            print(f"Error fetching weather data: {e}")
            return None

    def save_to_s3(self, weather_data, city):
        """Save weather data to S3 bucket"""
        if not weather_data:
            return False

        timestamp = datetime.now().strftime('%Y%m%d-%H%M%S')
        file_name = f"weather-data/{city}-{timestamp}.json"

        try:
            weather_data['timestamp'] = timestamp
            self.s3_client.put_object(
                Bucket=self.bucket_name,
                Key=file_name,
                Body=json.dumps(weather_data),
                ContentType='application/json'
            )
            print(f"Successfully saved data for {city} to S3")
            return True
        except Exception as e:
            print(f"Error saving to S3: {e}")
            return False

def main():
    dashboard = WeatherDashboard()

    # Create bucket if needed
    dashboard.create_bucket_if_not_exists()

    cities = ["Philadelphia", "Seattle", "New York"]

    for city in cities:
        print(f"\nFetching weather for {city}...")
        weather_data = dashboard.fetch_weather(city)
        if weather_data:
            temp = weather_data['main']['temp']
            feels_like = weather_data['main']['feels_like']
            humidity = weather_data['main']['humidity']
            description = weather_data['weather'][0]['description']

            print(f"Temperature: {temp}°F")
            print(f"Feels like: {feels_like}°F")
            print(f"Humidity: {humidity}%")
            print(f"Conditions: {description}")

            # Save to S3
            success = dashboard.save_to_s3(weather_data, city)
            if success:
                print(f"Weather data for {city} saved to S3!")
        else:
            print(f"Failed to fetch weather data for {city}")

if __name__ == "__main__":
    main()

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Run the System&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Fetch and display weather data:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python fetch_weather.py&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Fetch, display, and upload to S3&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nmvok3hrle0i30y0mut.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4nmvok3hrle0i30y0mut.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsely0p41wuwly0fs3kda.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fsely0p41wuwly0fs3kda.png" alt="Image description" width="800" height="397"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features of the System
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Real-Time Data:&lt;/strong&gt; Fetches live weather data from OpenWeather API.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalable Storage:&lt;/strong&gt; AWS S3 ensures scalability and durability for your data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation:&lt;/strong&gt; Automates data collection and storage with minimal user intervention.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Best Practices
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Secure API Keys:&lt;/strong&gt; Use environment variables to protect sensitive data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Error Handling:&lt;/strong&gt; Handle API request errors and S3 upload issues gracefully.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Modular Design:&lt;/strong&gt; Keep your scripts modular for reusability and scalability.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Future Enhancements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scheduled Data Collection:&lt;/strong&gt; Use cron jobs or Python libraries like APScheduler to automate periodic data fetching.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Visualization:&lt;/strong&gt; Build dashboards using tools like Grafana or Tableau.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced Analytics:&lt;/strong&gt; Analyze historical weather data for trends and insights.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;With just a few lines of Python and the power of cloud services like AWS, we’ve built a scalable and functional Weather Data Collection System. This project is a great starting point for exploring more advanced DevOps practices and cloud integrations.&lt;/p&gt;

&lt;p&gt;Happy Coding! ☁️☂️&lt;/p&gt;

</description>
      <category>devops</category>
      <category>python</category>
      <category>aws</category>
      <category>linux</category>
    </item>
    <item>
      <title>Building an NBA Data Lake with AWS: A Comprehensive Guide</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Sat, 11 Jan 2025 22:58:36 +0000</pubDate>
      <link>https://forem.com/princemaxi/building-an-nba-data-lake-with-aws-a-comprehensive-guide-5d70</link>
      <guid>https://forem.com/princemaxi/building-an-nba-data-lake-with-aws-a-comprehensive-guide-5d70</guid>
      <description>&lt;p&gt;Creating a cloud-native data lake for NBA analytics has never been easier, thanks to AWS's powerful suite of services. This guide will walk you through the process of building an NBA Data Lake using Amazon S3, AWS Glue, and Amazon Athena. By automating the setup with a Python script, you'll learn how to store, query, and analyze NBA data efficiently. Let's dive into the details.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is a Data Lake?
&lt;/h2&gt;

&lt;p&gt;A data lake is a centralized repository that allows you to store structured and unstructured data at any scale. With a data lake, you can store your data as-is, process it as needed, and use it for analytics, reporting, or machine learning tasks. AWS provides robust tools to build and manage data lakes efficiently.&lt;/p&gt;

&lt;h2&gt;
  
  
  Overview of the NBA Data Lake
&lt;/h2&gt;

&lt;p&gt;This project uses a Python script (setup_nba_data_lake.py) to automate the following tasks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Amazon S3:&lt;/strong&gt; Creates a bucket for storing raw and processed NBA data.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;AWS Glue:&lt;/strong&gt; Sets up a database and an external table for managing metadata and schema.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Amazon Athena:&lt;/strong&gt; Configures query execution to analyze the stored data directly from S3.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;By leveraging these services, the data lake enables seamless integration of real-time NBA data from SportsData.io for analytics and reporting.&lt;/p&gt;

&lt;h2&gt;
  
  
  AWS Services Used
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Amazon S3 (Simple Storage Service)&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function:&lt;/strong&gt;&lt;br&gt;
Amazon S3 is a scalable object storage service. In this project, it acts as the backbone of the data lake, storing both raw and processed NBA data.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How It Works:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script creates an S3 bucket named sports-analytics-data-lake.&lt;/li&gt;
&lt;li&gt;Data is organized into folders, such as raw-data, which stores unprocessed JSON files like nba_player_data.json.&lt;/li&gt;
&lt;li&gt;S3 ensures high availability, durability, and cost efficiency.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Scalability:&lt;/strong&gt; Automatically handles growing datasets.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost-Effective:&lt;/strong&gt; Pay only for the storage and data transfer you use.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Integration:&lt;/strong&gt; Works seamlessly with AWS Glue and Athena.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;2. AWS Glue&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function:&lt;/strong&gt;&lt;br&gt;
AWS Glue is a fully managed ETL (Extract, Transform, Load) service. It helps manage metadata and schema for the data stored in S3.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How It Works:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The script creates a Glue database and an external table (nba_players) to define the schema of the JSON data stored in S3.&lt;/li&gt;
&lt;li&gt;Glue catalogs metadata, making the data queryable by Athena.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Schema Management:&lt;/strong&gt; Automates metadata handling.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;ETL:&lt;/strong&gt; Can be extended to transform data for analytics.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Cost-Effective:&lt;/strong&gt; Charges only for resources consumed.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Amazon Athena&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Function:&lt;/strong&gt;&lt;br&gt;
Amazon Athena is an interactive query service that allows you to analyze data in S3 using standard SQL.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;How It Works:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Athena reads the metadata from AWS Glue.&lt;/li&gt;
&lt;li&gt;Users can run SQL queries directly on the JSON data stored in S3 without needing a database server.&lt;/li&gt;
&lt;li&gt;Sample Query: SELECT FirstName, LastName, Position FROM nba_players WHERE Position = 'PG';&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Key Benefits:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Serverless:&lt;/strong&gt; No infrastructure to manage.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Fast:&lt;/strong&gt; Optimized for big data queries.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Pay-as-You-Go:&lt;/strong&gt; Charged per query execution.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Setting Up the NBA Data Lake
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Prerequisites&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Before starting, ensure you have:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;API Key from SportsData.io:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up at SportsData.io and obtain a free API key for NBA data.&lt;/li&gt;
&lt;li&gt;This key will be used to fetch real-time NBA data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;AWS Account:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set up an account with sufficient permissions for S3, Glue, and Athena.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;IAM Permissions:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The executing user or role must have permissions for the following actions:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;S3:&lt;/strong&gt; CreateBucket, PutObject, ListBucket&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Glue:&lt;/strong&gt; CreateDatabase, CreateTable&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Athena:&lt;/strong&gt; StartQueryExecution, GetQueryResults&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Steps to Build the Data Lake
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Open AWS CloudShell&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Log in to the AWS Management Console.&lt;/li&gt;
&lt;li&gt;Click the CloudShell icon ( &amp;gt;_ ) to open the CloudShell environment.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4j61qb9x0inl7657qmji.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4j61qb9x0inl7657qmji.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Create the Python Script&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Run nano setup_nba_data_lake.py in CloudShell.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm3zbdzt7djvozml674oj.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fm3zbdzt7djvozml674oj.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Copy and paste the contents of the Python script (&lt;a href="https://github.com/princemaxi/NBA-Datalake" rel="noopener noreferrer"&gt;GitHub repo&lt;/a&gt;).&lt;/li&gt;
&lt;li&gt;Replace the api_key placeholder with your SportsData.io API key:

&lt;ul&gt;
&lt;li&gt;SPORTS_DATA_API_KEY=your_sportsdata_api_key&lt;/li&gt;
&lt;li&gt;NBA_ENDPOINT=&lt;a href="https://api.sportsdata.io/v3/nba/scores/json/Players" rel="noopener noreferrer"&gt;https://api.sportsdata.io/v3/nba/scores/json/Players&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Save and exit: Press Ctrl+X, then Y, and hit Enter.
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1v9ua3ypvn77zduikg6j.png" alt="Image description" width="800" height="370"&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;3. Run the Script&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Execute the script using: python3 setup_nba_data_lake.py&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4sj6w3znt7udmo03w55x.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F4sj6w3znt7udmo03w55x.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The script will:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Create an S3 bucket and upload sample NBA data.&lt;/li&gt;
&lt;li&gt;Set up a Glue database and table.&lt;/li&gt;
&lt;li&gt;Configure Athena for querying the data.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;5. Verify Resources&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amazon S3:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to the S3 Console.&lt;/li&gt;
&lt;li&gt;Verify the creation of a bucket named sports-analytics-data-lake.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh6x64upcchuoqp360iij.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fh6x64upcchuoqp360iij.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Check the raw-data folder for the file nba_player_data.json.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5swn48tsoorog3us2eii.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F5swn48tsoorog3us2eii.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foxojub1qyqzpmeysgt9v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foxojub1qyqzpmeysgt9v.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmqs69yd47mjwb22rc4pv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmqs69yd47mjwb22rc4pv.png" alt="Image description" width="800" height="421"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Amazon Athena:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the Athena Console.&lt;/li&gt;
&lt;li&gt;Run the sample query:
SELECT FirstName, LastName, Position, Team
FROM nba_players
WHERE Position = 'PG';&lt;/li&gt;
&lt;li&gt;Verify the results.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdhtng2wqazqfizpnby0y.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fdhtng2wqazqfizpnby0y.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fta59e115ytbxqmwwy53n.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fta59e115ytbxqmwwy53n.png" alt="Image description" width="800" height="370"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What You’ll Learn
&lt;/h2&gt;

&lt;p&gt;By completing this project, you will gain practical experience in:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Cloud Architecture Design:&lt;/strong&gt; Learn how to architect a serverless data lake using Amazon S3, AWS Glue, and Amazon Athena.&lt;/li&gt;
&lt;li&gt;Data Storage Best Practices: Understand how to store, organize, and manage structured and semi-structured data in Amazon S3.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Metadata Management:&lt;/strong&gt; Use AWS Glue to catalog and manage data schemas, enabling seamless querying and integration with other AWS services.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;SQL-Based Analytics:&lt;/strong&gt; Leverage Amazon Athena to run SQL queries directly on data stored in Amazon S3, eliminating the need for complex ETL processes.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;API Integration:&lt;/strong&gt; Incorporate external data sources, like SportsData.io, into your cloud workflows for dynamic data ingestion.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Automation with Python:&lt;/strong&gt; Automate resource provisioning and data ingestion with Python, reducing manual configuration efforts.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;IAM Security Practices:&lt;/strong&gt; Implement least privilege permissions to secure your AWS resources and ensure compliance with best practices.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Future Enhancements
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Automated Data Ingestion:&lt;/strong&gt; Use AWS Lambda to fetch and update data dynamically.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Data Transformation:&lt;/strong&gt; Build ETL pipelines with AWS Glue.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Advanced Analytics:&lt;/strong&gt; Create dashboards and visualizations using AWS QuickSight.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Real-Time Updates:&lt;/strong&gt; Integrate AWS Kinesis for streaming data in real time.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;This project demonstrates the power of serverless architecture in building scalable, secure, and efficient data lakes. Whether you're a DevOps enthusiast, data engineer, or sports analytics professional, this tutorial is a great starting point for exploring AWS's capabilities.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>devops</category>
      <category>aws</category>
      <category>python</category>
      <category>linux</category>
    </item>
    <item>
      <title>DevOps vs. Traditional: Key Differences in Software Development and Delivery</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Sat, 24 Aug 2024 12:51:15 +0000</pubDate>
      <link>https://forem.com/princemaxi/devops-vs-traditional-key-differences-in-software-development-and-delivery-2j0g</link>
      <guid>https://forem.com/princemaxi/devops-vs-traditional-key-differences-in-software-development-and-delivery-2j0g</guid>
      <description>&lt;p&gt;The landscape of software development has evolved significantly, driven by the need for speed, collaboration, and efficiency. Two prominent approaches dominate this landscape: the traditional software development model and the DevOps approach. While both aim to deliver high-quality software, the methods they employ and the outcomes they produce differ fundamentally. In this blog post, we’ll explore the key differences between these approaches in software development and delivery.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Development and Operations Silos vs. Integrated Teams
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Traditional Approach:
&lt;/h3&gt;

&lt;p&gt;In the traditional model, development and operations teams work in silos. Developers focus solely on writing code, while operations teams handle deployment and infrastructure management. The lack of communication and collaboration between these teams often leads to delays, misalignment, and a "throw it over the wall" mentality.&lt;/p&gt;

&lt;h3&gt;
  
  
  DevOps Approach:
&lt;/h3&gt;

&lt;p&gt;DevOps integrates development and operations into a unified team with shared responsibilities. This integration fosters continuous communication, collaboration, and a culture of shared ownership. As a result, issues are identified and resolved more quickly, leading to faster and more reliable releases.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Waterfall vs. Continuous Delivery
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Traditional Approach:
&lt;/h3&gt;

&lt;p&gt;Traditional development often follows the Waterfall methodology, where software is built in sequential stages: requirements gathering, design, development, testing, and deployment. Each stage must be completed before moving to the next, leading to long development cycles. Software is typically released in large, infrequent updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  DevOps Approach:
&lt;/h3&gt;

&lt;p&gt;DevOps emphasizes continuous integration and continuous delivery (CI/CD). Code changes are integrated frequently and delivered in smaller, incremental updates. This approach reduces time to market and allows teams to deliver features faster and respond quickly to customer feedback.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Manual Processes vs. Automation
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Traditional Approach:
&lt;/h3&gt;

&lt;p&gt;In traditional environments, many processes are manual, from code testing to deployment. Manual processes are time-consuming, prone to errors, and difficult to scale. As a result, deployment bottlenecks and inconsistencies often arise.&lt;/p&gt;

&lt;h3&gt;
  
  
  DevOps Approach:
&lt;/h3&gt;

&lt;p&gt;Automation is a cornerstone of DevOps. From automated testing to infrastructure management (using Infrastructure as Code), automation reduces human error, speeds up deployment cycles, and ensures consistency across environments. This automation allows teams to achieve faster, more reliable releases with minimal downtime.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Reactive vs. Proactive Incident Management
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Traditional Approach:
&lt;/h3&gt;

&lt;p&gt;In traditional models, incident management is often reactive. Problems are addressed only after they occur, leading to longer downtimes and a negative impact on user experience. This reactive approach also results in blame-shifting between development and operations teams.&lt;/p&gt;

&lt;h3&gt;
  
  
  DevOps Approach:
&lt;/h3&gt;

&lt;p&gt;DevOps encourages proactive monitoring and quick responses to incidents. With continuous monitoring and alerting systems in place, potential issues are detected early, and teams can take preventive measures before problems escalate. The focus is on resolving issues collaboratively rather than assigning blame.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Rigid vs. Agile and Adaptive
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Traditional Approach:
&lt;/h3&gt;

&lt;p&gt;Traditional development is typically rigid, with fixed plans and timelines. Changes late in the development cycle are costly and disruptive. This rigidity makes it difficult to adapt to new requirements or market shifts.&lt;/p&gt;

&lt;h3&gt;
  
  
  DevOps Approach:
&lt;/h3&gt;

&lt;p&gt;DevOps thrives in an Agile environment. It embraces adaptability, allowing teams to respond swiftly to changes in customer needs or market conditions. With shorter development cycles and continuous feedback loops, DevOps teams can iterate rapidly and adjust their processes on the fly.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Delayed Testing vs. Shift-Left Testing
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Traditional Approach:
&lt;/h3&gt;

&lt;p&gt;Testing in traditional models is usually performed after development is complete, leading to delayed bug discovery and fixing. This approach increases the risk of deploying software with undetected issues.&lt;/p&gt;

&lt;h3&gt;
  
  
  DevOps Approach:
&lt;/h3&gt;

&lt;p&gt;In DevOps, testing is integrated early in the development process, known as “shift-left” testing. Continuous testing ensures that bugs are caught and addressed early, reducing the chances of defects making it to production. This proactive testing approach leads to higher-quality software and smoother deployments.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. Long Feedback Loops vs. Continuous Feedback
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Traditional Approach:
&lt;/h3&gt;

&lt;p&gt;Feedback in traditional models is often delayed, as it’s typically gathered after the release during post-deployment reviews. This delayed feedback makes it difficult to make quick improvements or address issues in a timely manner.&lt;/p&gt;

&lt;h3&gt;
  
  
  DevOps Approach:
&lt;/h3&gt;

&lt;p&gt;DevOps emphasizes continuous feedback from both users and team members. By gathering and analyzing feedback in real-time, teams can implement improvements continuously, resulting in more responsive and user-focused products.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion
&lt;/h3&gt;

&lt;p&gt;The differences between traditional and DevOps approaches highlight the evolving needs of modern software development. While the traditional model can still work for certain projects with well-defined requirements, DevOps offers a more flexible, collaborative, and efficient approach that aligns with today’s fast-paced, customer-driven market. By adopting DevOps practices, organizations can accelerate delivery, improve software quality, and create a culture of continuous learning and innovation.&lt;/p&gt;

&lt;p&gt;In summary, DevOps isn’t just about implementing new tools—it’s about embracing a mindset of collaboration, automation, and continuous improvement. Organizations that successfully transition to DevOps are better positioned to meet market demands, scale operations, and achieve long-term success in an increasingly competitive landscape.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Contacting Microsoft Azure Support: Common Problems and Solutions</title>
      <dc:creator>Maxwell Ugochukwu</dc:creator>
      <pubDate>Fri, 01 Sep 2023 15:20:44 +0000</pubDate>
      <link>https://forem.com/princemaxi/contacting-microsoft-azure-support-common-problems-and-solutions-232f</link>
      <guid>https://forem.com/princemaxi/contacting-microsoft-azure-support-common-problems-and-solutions-232f</guid>
      <description>&lt;p&gt;Microsoft Azure, a leading cloud platform, offers a wide range of services and solutions to businesses and developers around the world. While Azure's extensive documentation and community forums provide valuable resources for troubleshooting, sometimes you may encounter issues that require direct assistance from Microsoft's support team. In this blog post, we'll guide you on how to contact Microsoft Azure support and highlight some common problems that can be resolved by reaching out to them.&lt;/p&gt;

&lt;h2&gt;
  
  
  Contacting Microsoft Azure Support
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;1. Azure Portal&lt;/strong&gt;&lt;br&gt;
One of the most convenient ways to get support for Azure-related issues is through the Azure portal. Here's how to do it:&lt;/p&gt;

&lt;p&gt;Log In: Sign in to your Azure account through the &lt;a href="https://portal.azure.com/" rel="noopener noreferrer"&gt;Azure portal&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Help + Support: In the Azure portal, navigate to "Help + support" on the left-hand side.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feo9d4pyvk7tk4jim3b79.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Feo9d4pyvk7tk4jim3b79.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Create Support Request: Click on "Create a support request" to start the process.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftvqqzk0sd30cftqptd2w.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftvqqzk0sd30cftqptd2w.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Issue Details: Provide details about your issue, including the subscription, service, and severity level of the problem and click on next.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fculwcg9xgm4r0x01fjd8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fculwcg9xgm4r0x01fjd8.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Recommended Solution: Azure automatically generates a recommended solution for your request or problem.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl04y01o1cppx3z2hzkbx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fl04y01o1cppx3z2hzkbx.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
If this recommended solution solves your problem you don't need to proceed to the next part but if it doesn't the click on 'Return to support request' to continue to create a support request, on the next prompt click 'Next'.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyytux57ncijtda9torl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fiyytux57ncijtda9torl.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyfafdsqhmpqzz93j5ilk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyfafdsqhmpqzz93j5ilk.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;New support request:&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Problem Details:&lt;/strong&gt; You input the necessary detail of the problem you want to resolve accordingly, information needed are the problem start date, detailed description, subscription ID, problem ID and you can attach a file such as screenshot of an error message.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxjh999yu3zvcol7c58em.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fxjh999yu3zvcol7c58em.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Advanced Diagnostic Information:&lt;/strong&gt; Select an option either yes or no. Recommended option is yes as its makes your support process fast.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyrw8wzayt9wusiiqk1we.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fyrw8wzayt9wusiiqk1we.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Support Method:&lt;/strong&gt; Choose how you'd like Microsoft to contact you (email, phone, or both) and choose the your preferred language.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftdxqkkylyfvdgltac6r2.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftdxqkkylyfvdgltac6r2.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Contact Method:&lt;/strong&gt; This is where you provide your contact information; names, email address and phone number.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vun364kmsu9uzq3g355.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F6vun364kmsu9uzq3g355.png" alt="Image description"&gt;&lt;/a&gt;&lt;br&gt;
Click 'Next' to review and create support request.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2itg7xi4vfhoqmxnjkeu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F2itg7xi4vfhoqmxnjkeu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Submit Request:&lt;/strong&gt; Click "Create" to submit your support request after reviewing it. Microsoft will respond based on the severity level you selected.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fubgb1brni7hptmr2du85.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fubgb1brni7hptmr2du85.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;From 'Notifications' confirm that your support request is successfully created.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqh3aezywlf9ohl1g9qf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fwqh3aezywlf9ohl1g9qf.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Azure Support Plans:&lt;/strong&gt;&lt;br&gt;
Depending on your subscription and support needs, you may have different &lt;a href="https://azure.microsoft.com/en-us/support/plans" rel="noopener noreferrer"&gt;support plans&lt;/a&gt; which are Basic, Developer, Standard and Professional direct. Review your &lt;a href="https://azure.microsoft.com/en-us/support/plans" rel="noopener noreferrer"&gt;support plan&lt;/a&gt; to get details and understand your entitlements. If you have a paid support plan, you can often get faster responses and more comprehensive assistance.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54pgfgdp87q40s242xj8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F54pgfgdp87q40s242xj8.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Phone Support:&lt;/strong&gt;&lt;br&gt;
If you need immediate assistance or prefer to speak with a support representative, you can find the phone numbers for your region in the Azure Portal under &lt;a href="https://azure.microsoft.com/en-us/contact/#phone-numbers" rel="noopener noreferrer"&gt;"Help + support."&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F93gadubxoony48x2b6gk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F93gadubxoony48x2b6gk.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Azure Community Forums:&lt;/strong&gt;&lt;br&gt;
Before contacting support, consider visiting the Azure &lt;a href="https://portal.azure.com/#view/Microsoft_Azure_Support/HelpAndSupportBlade/~/overview" rel="noopener noreferrer"&gt;Community Forums&lt;/a&gt;. Many common issues have already been discussed and resolved there.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3t6e37v6en4d25ryrk6k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3t6e37v6en4d25ryrk6k.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Common Problems Resolved by Microsoft Azure Support
&lt;/h2&gt;

&lt;p&gt;Here are some common issues that users encounter with Azure and how Microsoft's support team can help resolve them:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Resource Provisioning and Deployment Issues&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; Users often face challenges when provisioning Azure resources or deploying applications. These issues can be due to misconfigurations, resource limitations, or deployment errors.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Microsoft Azure support can provide guidance on configuring resources correctly, troubleshooting deployment errors, and optimizing resource usage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Performance and Scaling Problems&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; As applications grow, they may experience performance bottlenecks or scaling challenges. Identifying and resolving these issues is crucial for ensuring optimal application performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Azure support can help diagnose performance bottlenecks, suggest scaling strategies, and optimize resource configurations to improve application responsiveness.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Security and Compliance Concerns&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; Security and compliance are top priorities for businesses. Azure users may have questions about Azure's security features or need assistance with compliance requirements.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Microsoft Azure support can provide information on Azure's security features, assist with security configurations, and offer guidance on achieving compliance with industry standards.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Billing and Subscription Issues&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; Billing discrepancies, unexpected charges, or subscription-related problems can be confusing and frustrating for Azure users.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Azure support can help users understand their bills, investigate billing discrepancies, and provide guidance on optimizing resource costs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Service Outages and Downtime&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; In rare cases, Azure services may experience outages or downtime, impacting businesses' operations.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Microsoft Azure support can provide updates on service status, estimated recovery times, and alternative solutions during service outages.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;6. Technical Guidance and Best Practices&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;Problem:&lt;/strong&gt; Users may seek technical guidance, best practices, or recommendations for implementing specific solutions on Azure.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Solution:&lt;/strong&gt; Azure support professionals can offer technical guidance, share best practices, and recommend Azure services and features that align with specific use cases.&lt;/p&gt;

&lt;p&gt;Remember that the level of support and response time you receive may depend on your Azure support plan. It's essential to choose the appropriate support plan for your business needs to ensure timely assistance when issues arise.&lt;/p&gt;

&lt;h2&gt;
  
  
  Tips for Effective Communication with Azure Support
&lt;/h2&gt;

&lt;p&gt;When contacting Azure support, keep these tips in mind:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Provide Clear Details:&lt;/strong&gt; Describe your issue concisely and provide relevant details, such as error messages, timestamps, and affected resources.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Severity Level:&lt;/strong&gt; Choose the appropriate severity level for your issue. Critical issues may receive faster responses.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Screenshots and Logs:&lt;/strong&gt; Include screenshots, error logs, and any other relevant information that can help the support team understand your problem.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Follow-Up:&lt;/strong&gt; Stay engaged with the support process. Respond to queries promptly and keep communication channels open.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Escalation:&lt;/strong&gt; If your issue is not being resolved to your satisfaction, don't hesitate to request escalation to a higher support level.&lt;/p&gt;

&lt;p&gt;In conclusion, Microsoft Azure offers comprehensive support for its cloud services. Knowing how to contact Azure support and when to do so can help you quickly resolve issues, ensure the smooth operation of your Azure-based solutions, and maximize the value of your Azure investment. Whether you're facing technical challenges, billing inquiries, or security concerns, Azure support is there to assist you on your cloud journey.&lt;/p&gt;

</description>
      <category>cloudcomputing</category>
      <category>azure</category>
      <category>cloud</category>
    </item>
  </channel>
</rss>
