<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Meetfunkygeb on Medium]]></title>
        <description><![CDATA[Stories by Meetfunkygeb on Medium]]></description>
        <link>https://medium.com/@meetfunkygeb?source=rss-ff63baacd653------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*j4NGfweIXYtfTI0R</url>
            <title>Stories by Meetfunkygeb on Medium</title>
            <link>https://medium.com/@meetfunkygeb?source=rss-ff63baacd653------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 12:50:14 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@meetfunkygeb/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How I Built a Production-Grade AWS CI/CD Pipeline from Scratch . A Complete 3-Tier DevOps Project]]></title>
            <link>https://medium.com/@meetfunkygeb/how-i-built-a-production-grade-aws-ci-cd-pipeline-from-scratch-a-complete-3-tier-devops-project-08014efc2d4b?source=rss-ff63baacd653------2</link>
            <guid isPermaLink="false">https://medium.com/p/08014efc2d4b</guid>
            <category><![CDATA[react]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[ci-cd-pipeline]]></category>
            <dc:creator><![CDATA[Meetfunkygeb]]></dc:creator>
            <pubDate>Mon, 27 Jul 2026 16:29:47 GMT</pubDate>
            <atom:updated>2026-07-27T16:29:47.184Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Complete 3-Tier DevOps Project with Version Control, Rollback Strategy, and Monitoring</h3><p><em>As part of my DevOps training with </em><strong><em>CloudBoosta</em></strong><em>, I was challenged to build a real-world CI/CD pipeline on AWS, not just follow a tutorial, but actually design, build, troubleshoot, and deploy a full 3-tier application from scratch. This article is the complete story of what I built, how I built it, and every mistake that made me a better engineer.</em></p><h3>What I Set Out to Build</h3><p>The goal was clear: build a fully automated pipeline where pushing code to GitHub automatically builds, tests, and deploys a full stack application to AWS with proper version control, automatic rollback protection, and real-time monitoring in place.</p><p><strong>Here’s the full phases I implemented:</strong></p><p>GitHub (Source)<br> ↓<br>AWS CodePipeline (Orchestrator)<br> ↓<br>AWS CodeBuild (Build &amp; Compile)<br> ↓<br>Amazon S3 (Artifact Storage)<br> ↓<br>AWS CodeDeploy (Deployment Agent)<br> ↓<br>Amazon EC2 (Ubuntu 24.04 + Nginx)<br> ↓<br>Amazon RDS MySQL (Private Database)</p><p><strong>Three tiers, fully connected:</strong></p><p><strong>Presentation:</strong> React/TypeScript frontend compiled with Vite, served by Nginx</p><p><strong>Application:</strong> Node.js/Express REST API running on port 3200</p><p><strong>Data:</strong> MySQL database on Amazon RDS in a private subnet</p><h3>Phase 1: Infrastructure Setup</h3><h4>EC2 Instance</h4><p>I launched an Ubuntu 24.04 LTS EC2 instance (t2.micro) in us-east-1 with:</p><ul><li>A security group allowing HTTP (port 80), SSH (port 22), and custom TCP (port 3200) for the backend API</li><li>An IAM instance profile with AmazonEC2RoleforAWSCodeDeploy permissions so the CodeDeploy agent could authenticate with AWS</li><li>The CodeDeploy agent installed automatically via user-data script at launch</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B64LOf0JKTb9PzNXtpZMEw.png" /></figure><h4>RDS MySQL Database</h4><p>I provisioned an RDS MySQL instance (db.t4g.micro) in the same VPC as the EC2 instance, with:</p><ul><li><strong>Public access: disabled. </strong>the database is completely unreachable from the internet</li><li>A dedicated security group only allowing port 3306 connections from the EC2 instance’s security group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3ggcqR6h6SoBJP-QvUUSog.png" /></figure><h4>S3 Artifact Bucket</h4><p>Created an S3 bucket with versioning enabled to store build artifacts between pipeline stages. CodeBuild uploads the compiled application here, and CodeDeploy pulls it from here during deployment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yTdN_8YaH_vgHT-69P2apw.png" /></figure><h3>Phase 2: Version Control Strategy</h3><p>Before writing a single pipeline config file, I implemented a professional Git branching strategy because in DevOps, how you manage code is just as important as how you deploy it.</p><p><strong>Branch Structure</strong></p><p>main → Production only. Protected. No direct pushes allowed.<br>develop → Active development. All features merge here first.</p><h4>Branch Protection on Main</h4><p>I configured GitHub branch protection rules so that:</p><ul><li>No one can push directly to main, not even me as the repo owner</li><li>All changes must go through a Pull Request</li><li>At least one approval is required before merging</li></ul><p>This mirrors how real engineering teams work, the main branch is sacred and protected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jyaWtXXOjhUYWYUZ4hBcVA.png" /></figure><h4>Release Tagging</h4><p>Tagged the first working production deployment as v1.0.0. Every major production deployment gets a version tag, making it easy to identify exactly what’s running in production at any time.</p><h4>Documentation</h4><p>Created two documentation files:</p><p><strong>CONTRIBUTING.md- </strong>documents the full branching strategy, commit message conventions (feat:, fix:, config:, docs:), and PR workflow so any team member can follow the same process.</p><p><strong>ROLLBACK.md- </strong>documents the rollback procedures (automatic via CodeDeploy, manual via Git revert, and console-based via CodeDeploy redeploy).</p><h3>Phase 3: The CI/CD Pipeline</h3><p>Three configuration files make the entire pipeline work automatically.</p><h4>buildspec.yml — CodeBuild Instructions</h4><p>This tells CodeBuild to install Node.js 18, install dependencies for both frontend and backend, then compile the React/TypeScript frontend into plain JavaScript using Vite.</p><p><strong>appspec.yml — CodeDeploy Instructions </strong>This tells CodeDeploy exactly where to put the files and what scripts to run at each lifecycle stage.</p><h4>Deployment Scripts</h4><p><strong>before_install.sh</strong> cleans up old files before the new deployment arrives. <strong>after_install.sh</strong> installs backend dependencies and sets up the database. <strong>start_server.sh </strong>starts the Node.js backend in the background.</p><h4>The Pipeline Flow</h4><p>Once CodePipeline is created connecting GitHub → CodeBuild → CodeDeploy:</p><ol><li>Developer pushes code to main branch on GitHub</li><li>CodePipeline detects the change within seconds</li><li>CodeBuild spins up a fresh Ubuntu container, installs dependencies, compiles React</li><li>Built artifact is uploaded to S3</li><li>CodeDeploy instructs the EC2 instance’s agent to pull the artifact</li></ol><p>6. Deployment scripts run in order: BeforeInstall → Install → AfterInstall → ApplicationStart</p><p>7. Application is live with new code.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BA-xNNQUG97qMD9klONTBw.png" /></figure><p><strong>Phase 4: Rollback Strategy</strong></p><h4>Testing the Rollback — Live Demo</h4><p>To prove the rollback actually works, I intentionally deployed broken code. I replaced start_server.sh with a new code to break it. I pushed this via a Pull Request from develop to main, watched the pipeline trigger, and observed CodeDeploy:</p><ol><li>Detect the ApplicationStart failure</li><li>Automatically trigger a rollback deployment</li><li>Redeploy the last successful version</li></ol><p><strong>The application stayed live throughout.</strong> Users would never have known anything went wrong. That’s production-grade resilience.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vkCgUGrkPUgy2CSXl50Ryw.png" /></figure><p><strong>Phase 5: Monitoring with CloudWatch</strong></p><p>You can’t manage what you can’t measure. I set up few layers of observability.</p><h4>CloudWatch Dashboard</h4><p>Created mydemo-project-dashboard with:</p><ul><li><strong>NetworkIn/NetworkOut</strong> — real-time traffic graph showing deployment spikes and normal traffic patterns</li><li><strong>StatusCheckFailed</strong> — instant visibility into instance health (both showing 0 — healthy)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s-XBAACQEC3PQZVf7q0ZYQ.png" /></figure><h3>What Broke Along the Way</h3><ol><li><strong>Wrong Ubuntu version</strong><br> Used Ubuntu 26.04 initially. CodeDeploy’s Ruby version check rejects 3.3.8. Switched to 24.04 and it worked immediately.</li></ol><p><strong>2. SSH blocked by ISP</strong><br> My home network blocks outbound port 22. This also blocked EC2 Instance Connect since it routes through the same port. Solution: open the security group SSH rule to 0.0.0.0/0 for Instance Connect to work.</p><p><strong>3. React build output folder</strong><br> Vite outputs to dist/ not build/ like Create React App. The appspec.yml was pointing at frontend/build which doesn&#39;t exist. Changed to frontend/dist and it worked.</p><p><strong>4. API prefix missing</strong><br> The Node backend mounts all routes under /api so the correct endpoint is /api/books not /books. The React frontend was calling the wrong URL for days.</p><p><strong>5. EC2 Instance Connect blocked by security group</strong><br> EC2 Instance Connect connects from AWS’s IP ranges, not local IP. Having SSH restricted to “My IP” blocks it. Added the AWS Instance Connect IP range for us-east-1: 18.206.107.24/29.</p><p>Every single one of these errors is now something I’ll never forget because I had to fix it myself.</p><h3>The Final Result</h3><p>A fully working 3-tier application deployed automatically via CI/CD:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7tgQarWkMwH2IUQrb6G7iQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*f_-Y0PrPPnv05uN9GyHcDg.png" /></figure><p><strong>Live application features:</strong></p><ul><li>React dashboard with interactive charts (Bar chart showing book length distribution, Pie chart showing books by author)</li><li>Full CRUD operations for Books and Authors</li><li>Real data from MySQL RDS database</li><li>Automatic deployment on every GitHub push</li><li>Automatic rollback protection</li><li>Real-time CloudWatch monitoring</li></ul><p><strong>GitHub repository:</strong> <a href="https://github.com/funkygeb-nuel/lirw-react-node-mysql-app">funkygeb-nuel/lirw-react-node-mysql-app</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=08014efc2d4b" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>