<?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 Selina Loggins on Medium]]></title>
        <description><![CDATA[Stories by Selina Loggins on Medium]]></description>
        <link>https://medium.com/@tati.fluffy?source=rss-76c4f961f214------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*nGAJjNfHqaXRJNFjkYc5iw.jpeg</url>
            <title>Stories by Selina Loggins on Medium</title>
            <link>https://medium.com/@tati.fluffy?source=rss-76c4f961f214------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 11:22:38 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tati.fluffy/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[I Built a Production-Grade AWS VPC in 30 Minutes Using Terraform]]></title>
            <link>https://medium.com/@tati.fluffy/i-built-a-production-grade-aws-vpc-in-30-minutes-using-terraform-27b66115ca92?source=rss-76c4f961f214------2</link>
            <guid isPermaLink="false">https://medium.com/p/27b66115ca92</guid>
            <dc:creator><![CDATA[Selina Loggins]]></dc:creator>
            <pubDate>Mon, 27 Apr 2026 19:31:01 GMT</pubDate>
            <atom:updated>2026-04-27T19:31:01.619Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*In4VZGSgFhyaZDkjq0G6Kg.png" /></figure><h4>No public IPs. NAT Gateway. VPC Endpoints. Infrastructure as Code.</h4><h3>Week 1 of my AWS Solutions Architect journey.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1U8gYidAxdmN4lktN9SJGQ.png" /><figcaption>terraform apply terminal</figcaption></figure><p>I’m Selina Loggins, a cybersecurity professional working toward my AWS Solutions Architect Associate (SAA) certification. I’m documenting every project publicly the builds, the mistakes, and the lessons so this series will be a raw, honest account of what it actually takes to learn cloud architecture from scratch.</p><p><strong>This is Project 1.</strong></p><h3>What I Built</h3><p>A 3-tier private VPC (Virtual Private Cloud) on AWS the same network architecture used in real production environments deployed entirely with Terraform (Infrastructure as Code).</p><p><strong>The architecture:</strong></p><ul><li>VPC: 10.0.0.0/16 in us-east-1, spanning 2 Availability Zones</li><li><strong>Tier 1 : Public subnets</strong> (10.0.1.0/24, 10.0.2.0/24): for load balancers and the NAT Gateway</li><li><strong>Tier 2 : App subnets</strong> (10.0.10.0/24, 10.0.11.0/24): for EC2 instances private, no public IP</li><li><strong>Tier 3 : Data subnets</strong> (10.0.20.0/24, 10.0.21.0/24): for databases — most restricted tier</li><li>NAT Gateway for outbound internet from private instances</li><li>S3 Gateway Endpoint (free) so private instances reach S3 without touching the internet</li><li>3 SSM Interface Endpoints so I can connect to private instances via Systems Manager zero public IPs needed</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*_qKTW9x_Cq35CEkSj-kndw.png" /><figcaption>architecture diagram</figcaption></figure><h3>Why This Architecture Matters</h3><p>The most important rule of cloud security: <strong>never give a compute instance a public IP if it doesn’t need one.</strong></p><p>A database in a public subnet is a configuration mistake, not a design choice. The 3-tier model exists specifically to prevent this:</p><ul><li><strong>Public tier</strong> only ever holds things that <em>must</em> face the internet (load balancers, bastion hosts, NAT Gateways)</li><li><strong>App tier</strong> holds your compute it talks to the internet <em>through</em> the NAT Gateway, never directly</li><li><strong>Data tier</strong> is the most isolated it only accepts traffic from the app tier</li></ul><p>This pattern shows up on the AWS SAA exam constantly, and more importantly, it shows up in every well-architected production environment.</p><h3>Why Terraform?</h3><p>I could have clicked through the AWS Console to build this. That takes about 60 minutes and produces nothing reusable.</p><p>With Terraform, I wrote the architecture once as code. Now I can:</p><ul><li>Redeploy the exact same network in 5 minutes</li><li>Track every change in Git</li><li>Destroy everything safely with one command (terraform destroy)</li><li>Show recruiters actual code, not just screenshots</li></ul><p>Infrastructure as Code is how professional cloud teams work. Building the habit from day one matters.</p><h3>The Build</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VAVv3uJCz3LbKfImOxdVMg.png" /><figcaption>terraform init terminal output</figcaption></figure><h3>Step 1: terraform init</h3><p>This downloads the AWS provider plugin the code that lets Terraform communicate with AWS. You run this once per project.</p><pre>terraform init</pre><h3>Step 2: terraform plan</h3><p>This is the dry run. Terraform reads your .tf files, checks what exists in AWS (nothing yet), and prints every resource it plans to create with a + symbol for each one. I counted 22 resources.</p><pre>terraform plan</pre><p>Real engineers always review the plan before applying. If something looks wrong here, you fix it before it costs money.</p><h3>Step 3: terraform apply</h3><p>One command. Terraform creates all 22 resources in the correct dependency order it knows the NAT Gateway needs the Internet Gateway, which needs the VPC. I didn’t have to manage any of that sequencing manually.</p><pre>terraform apply</pre><p>The NAT Gateway takes 2-3 minutes to become Available. Terraform waits automatically.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2Nv2ms_4imKkKjlQj0Snow.png" /><figcaption>AWS Console subnets list</figcaption></figure><h3>Step 4: Verify in the Console</h3><p>After applying, I opened the AWS Console to confirm everything was correct:</p><ul><li>6 subnets, none with auto-assign public IPv4 enabled</li><li>Internet Gateway attached to the VPC</li><li>NAT Gateway in Available state, in the public subnet</li><li>Route tables wired correctly (public &gt;IGW, private &gt;NAT)</li><li>4 VPC Endpoints all showing Available</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tBtXhvCp1e7O-spZETAFqQ.png" /><figcaption>VPC Endpoints page</figcaption></figure><h3>Step 5: terraform destroy</h3><p>Because this was a learning build, I tore it all down the same day to stop the billing.</p><pre>terraform destroy</pre><p>This deleted all 22 resources in the correct reverse order in about 5 minutes. Total cost: under $1.</p><h3>Key Lessons &amp; SAA Exam Tips</h3><p><strong>NAT Gateway must be in a PUBLIC subnet.</strong> This trips people up on the exam constantly. The NAT Gateway needs access to the Internet Gateway so it must live in a public subnet. Put it in a private subnet and nothing works.</p><p><strong>S3 Gateway Endpoint is FREE. Interface Endpoints are not.</strong> Gateway endpoints (S3, DynamoDB) are free and work by adding a route to your route table. Interface endpoints create an ENI in your subnet and charge ~$0.01/hr each. The exam loves testing whether you know the difference.</p><p><strong>SSM requires 3 endpoints, not 1.</strong> To connect to a private EC2 instance via Systems Manager with no public IP, you need all three: ssm, ec2messages, and ssmmessages. Forget one and the connection fails silently.</p><p><strong>One NAT Gateway = one point of failure.</strong> For production: deploy one NAT Gateway per AZ. For learning builds: one is fine, and cheaper.</p><h3>The Code</h3><p>All Terraform files are on my GitHub:</p><p>👉 <a href="https://medium.com/github.com/tatiLogg/aws-saa-projects"><strong>github.com/tatilogg/aws-saa-projects</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5HXYoC5Pw_C7Y4kbzixsgQ.png" /><figcaption>GitHub repo</figcaption></figure><p>The repo includes:</p><ul><li>main.tf — all 22 resources</li><li>variables.tf — all configurable inputs</li><li>outputs.tf — VPC ID, subnet IDs, NAT Gateway IP</li><li>terraform.tfvars.example — template to fill in your own values</li><li>.gitignore — protects state files and personal tfvars from being committed</li></ul><h3>What’s Next</h3><p><strong>Project 2</strong> will deploy an EC2 instance into the app subnet of this VPC accessible via SSM only, no SSH, no public IP and I’ll use an IAM instance profile to do it properly.</p><p>If you’re on the same AWS SAA journey, follow along. I’m posting every project.</p><p><em>Cybersecurity Professional · AWS SAA Candidate</em> <em>Portfolio: </em><a href="https://tatilogg.github.io/"><em>tatilogg.github.io</em></a> <em>GitHub: </em><a href="https://github.com/tatilogg"><em>github.com/tatilogg</em></a></p><p><strong>Tags:</strong> AWS, Terraform, Cloud Computing, Infrastructure as Code, AWS Solutions Architect, Women In Tech, Learning In Public</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27b66115ca92" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an Image Recognition Pipeline with Amazon Rekognition + GitHub Actions (CI/CD) + DynamoDB]]></title>
            <link>https://medium.com/@tati.fluffy/building-an-image-recognition-pipeline-with-amazon-rekognition-github-actions-ci-cd-dynamodb-5ffafdc6834b?source=rss-76c4f961f214------2</link>
            <guid isPermaLink="false">https://medium.com/p/5ffafdc6834b</guid>
            <dc:creator><![CDATA[Selina Loggins]]></dc:creator>
            <pubDate>Tue, 10 Jun 2025 00:01:03 GMT</pubDate>
            <atom:updated>2025-06-10T00:01:03.835Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>by </strong><a href="https://github.com/tatiLogg"><strong>@tatiLogg</strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mGsR5yuzY9m-5oz8fsyFhw.png" /></figure><h3>Project Overview</h3><p>This project uses <strong>Amazon Rekognition</strong> to analyze uploaded images, label their content, and store the results in <strong>DynamoDB</strong>. CI/CD automation is handled via <strong>GitHub Actions</strong> to enable automatic analysis on every PR and merge.</p><p>👉 GitHub Repo: <a href="https://github.com/tatiLogg/LUIT-June-2025-Gold-Recognition-Image-AI">https://github.com/tatiLogg/LUIT-June-2025-Gold-Recognition-Image-AI</a></p><h3>Tech Stack</h3><ul><li><strong>AWS Rekognition</strong> — for object detection in images</li><li><strong>Amazon S3</strong> — for storing image files</li><li><strong>Amazon DynamoDB</strong> — for storing label results</li><li><strong>GitHub Actions</strong> — for CI/CD automation</li><li><strong>Python 3</strong> + boto3 to run image analysis script</li></ul><h3>How It Works</h3><ol><li><strong>Added an image</strong> to the <strong>images/ folder</strong> i created.</li><li><strong>Created a PR</strong> → that triggers GitHub Actions.</li><li>The workflow:</li></ol><ul><li>Uploaded images to S3 <strong>(rekognition-input/ folder)</strong>.</li><li>Calls Rekognition to detect labels.</li><li>And writes results to: <strong>beta_results DynamoDB table on PR</strong> AND <strong>prod_results table on merge.</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yg0_6oYnXzns3MR2yYGoPQ.png" /><figcaption>Images saved</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rrlEayZHnyBvNvDSMDaeCg.png" /><figcaption>analyze_image.py script</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dd4O6SEb6YI_zuv3wEKxgg.png" /><figcaption>S3 Buckets showing uploaded images</figcaption></figure><h3>Folder Structure</h3><p>LUIT-June-2025-Gold-Recognition-Image-AI<br>├── .github/workflows/<br>│ ├── on_pull_request.yml<br>│ └── on_merge.yml<br>├── analyze_image.py<br>├── images/<br>│ ├── sample.jpg<br>│ └── screenshot.png<br>└── README.md</p><h3>DynamoDB Setup</h3><ul><li>Accessed the <strong>AWS Console → DynamoDB → Create Table</strong></li><li>Created two tables:</li><li><strong>beta_results </strong>with partition key <strong>filename (S)</strong></li><li><strong>prod_results</strong> with partition key <strong>filename (S)</strong></li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1dC0BMIISMRSiWekbfFVRg.png" /><figcaption>DynamoDB beta_results and prod_results</figcaption></figure><h3>Sample Image Upload</h3><p>Dropped a .jpg y (can also use .png) into my images/folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V-fFBhCIXiWLW82WjeAbug.png" /><figcaption>Uploaded sample.jpg to S3</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Dd4O6SEb6YI_zuv3wEKxgg.png" /><figcaption>S3 Buckets images</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kasYa4zNMznC5c23aPtevw.png" /><figcaption>Sample.jpg image uploaded</figcaption></figure><p>The script below uploads the image to S3, runs Rekognition, and writes the result to DynamoDB:</p><p><strong>import boto3, os, json<br>from datetime import datetime, timezone<br>from decimal import Decimal</strong></p><p><strong># Load environment variables<br>bucket_name = os.getenv(“S3_BUCKET_NAME”)<br>table_name = os.getenv(“DYNAMO_TABLE_NAME”)<br>region = os.getenv(“AWS_REGION”, “us-east-1”)<br>branch = os.getenv(“GITHUB_HEAD_REF”, “local-test”)</strong></p><p><strong># Clients<br>s3 = boto3.client(“s3”, region_name=region)<br>rekognition = boto3.client(“rekognition”, region_name=region)<br>dynamodb = boto3.resource(“dynamodb”, region_name=region)<br>table = dynamodb.Table(table_name)</strong></p><p><strong># File<br>filename = “sample.jpg”<br>local_path = os.path.join(“images”, filename)<br>s3_key = f”rekognition-input/{filename}”</strong></p><p><strong># Upload<br>s3.upload_file(local_path, bucket_name, s3_key)<br>print(f”✅ Uploaded to S3: s3://{bucket_name}/{s3_key}”)</strong></p><p><strong># Analyze<br>response = rekognition.detect_labels(<br> Image={“S3Object”: {“Bucket”: bucket_name, “Name”: s3_key}},<br> MaxLabels=10, MinConfidence=70<br>)</strong></p><p><strong># Build item<br>item = {<br> “filename”: s3_key,<br> “labels”: [<br> {“Name”: l[“Name”], “Confidence”: Decimal(str(l[“Confidence”]))}<br> for l in response[“Labels”]<br> ],<br> “timestamp”: datetime.now(timezone.utc).isoformat(),<br> “branch”: branch<br>}</strong></p><p><strong># Save<br>table.put_item(Item=item)<br>print(“✅ Successfully wrote label results to DynamoDB.”)</strong></p><h3>CI/CD Workflows</h3><h3>Pull Request: on_pull_request.yml</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-eJGYHlV0PtHjWaYdp2baQ.png" /><figcaption>on_pull_request.yml script</figcaption></figure><h3>Merge to Main: on_merge.yml</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*A8ccA9DAX8SUs_uDZqzTGg.png" /><figcaption>on_merge.yml script</figcaption></figure><h3>Required GitHub Secrets</h3><p>Set these in <strong>Settings → Secrets → Actions</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WS_Axk_9lx_2rzi9i2y3sg.png" /><figcaption>AWS Secrets</figcaption></figure><p><strong>Secret Name:</strong> AWS_ACCESS_KEY_ID.</p><p><strong>Purpose:</strong> IAM user access key</p><p><strong>Secret Name:</strong> AWS_SECRET_ACCESS_KEY</p><p><strong>Purpose:</strong> IAM secret key</p><p><strong>Secret Name:</strong> AWS_REGION</p><p><strong>Purpose:</strong> us-east-1</p><p><strong>Secret Name:</strong> S3_BUCKET_NAME</p><p><strong>Purpose:</strong> S3 bucket name</p><p><strong>Secret Name:</strong> DYNAMO_TABLE_NAME</p><p><strong>Purpose:</strong> Table name (overridden in YAML)</p><h3>Test Output</h3><p>Below is a real run showing detected labels and saved DynamoDB item:</p><p>{<br> “filename”: “rekognition-input/sample.jpg”,<br> “labels”: [<br> {“Name”: “Cat”, “Confidence”: 95.23},<br> {“Name”: “Pet”, “Confidence”: 93.76}<br> ],<br> “timestamp”: “2025–06–08T23:47:47Z”,<br> “branch”: “main”<br>}</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V-fFBhCIXiWLW82WjeAbug.png" /><figcaption>Terminal with Uploaded sample.jpg with labels</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ns0XDH4DayRQ6d-YGeT4WA.png" /><figcaption>Visual confirmation that the output was successfully logged to DynamoDB</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xtQG3paY047aBahmL-Wo7g.png" /><figcaption>Visual confirmation that the output was successfully logged to DynamoDB : JSON</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UkQlqllyg6xMEXH5U3DKsQ.png" /><figcaption>Visual confirmation that the output was successfully logged to DynamoDB: ATTRIBUTES</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kdT6yeG8fY7AjryMPDjd6Q.png" /><figcaption>Visual confirmation that the output was successfully logged to DynamoDB: ATTRIBUTES</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Q_yeXOQ-Zte8yd1ixKUZtw.png" /><figcaption>Visual confirmation that the output was successfully logged to DynamoDB: ATTRIBUTES</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hj0mLK0ZeiDJ_o5I9O4Lhw.png" /><figcaption>Visual confirmation that the output was successfully logged to DynamoDB: LABELS</figcaption></figure><h3>Summary</h3><p>This project is a solid demonstration of AWS AI services + CI/CD automation. By combining GitHub workflows with AWS Rekognition, S3, and DynamoDB, we’ve built a lightweight image analysis pipeline that’s fully automated.</p><p>Clone or fork the project here: <a href="https://github.com/tatiLogg/LUIT-June-2025-Gold-Recognition-Image-AI">https://github.com/tatiLogg/LUIT-June-2025-Gold-Recognition-Image-AI</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5ffafdc6834b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pixel Learning — Text-to-Speech Automation with Amazon Polly]]></title>
            <link>https://medium.com/@tati.fluffy/from-idea-to-action-automating-amazon-polly-with-github-actions-b3a78e3cfb3b?source=rss-76c4f961f214------2</link>
            <guid isPermaLink="false">https://medium.com/p/b3a78e3cfb3b</guid>
            <dc:creator><![CDATA[Selina Loggins]]></dc:creator>
            <pubDate>Wed, 04 Jun 2025 02:46:00 GMT</pubDate>
            <atom:updated>2025-06-08T22:15:09.545Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1018/1*8vsy8dPS4S7U-Q5PjNJIpQ.png" /></figure><h3>Pixel Learning: Text-to-Speech Automation with Amazon Polly</h3><p>This project enables automated audio generation from course text using Amazon Polly, AWS S3, and GitHub Actions.</p><h3>Project Overview</h3><p>Pixel Learning Co., a digital-first education startup, uses this serverless pipeline to:</p><p>- Convert text content into audio using Amazon Polly.<br>- Upload audio to Amazon S3 in a structured folder (‘polly-audio/’).<br>- Separate outputs for preview (PRs) and production (main merges).<br>- Keep the solution lightweight, fast, and fully automated.</p><h3><strong>Setup Guide</strong></h3><h3>1. Prepared the Files</h3><ul><li>‘<strong>speech.txt</strong>’ — contains the following text in the screenshot below to convert.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oMcOQZEASCQY0TSSdCzhCg.png" /></figure><p>- ‘<strong>synthesize.py</strong>’ — Python script to read ‘<strong>speech.txt</strong>’, synthesize audio, and uploaded it to S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*shJW6Qbakq3EyZ83nVxdfA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZgPIkWbUWSUu4BDmCBUJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_e64wKxthlyNVe-KoPO6WA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l3_2Zsrc_SApC-QNGkgJ_g.png" /></figure><h3>2. GitHub Actions Workflows</h3><p><strong>‘on_pull_request.yml’</strong><br>- <strong>Trigger</strong>: When a pull request targets `<strong>main</strong>`.<br>- <strong>Result</strong>: Uploads ‘<strong>speech-beta.mp3</strong>’ to ‘<strong>s3://my-polly-pixel/polly-audio/</strong>’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_e64wKxthlyNVe-KoPO6WA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pgyTGKhej00NinC80Fs_Ug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4z0LyjXqwzvMm9rPgYzN4Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1ilWHVjQPBFeleZPerYAZQ.png" /></figure><p><strong>‘on_pull_request.yml’</strong><br>- <strong>Trigger</strong>: When a pull request targets `<strong>main</strong>`.<br>- <strong>Result</strong>: Uploads ‘<strong>speech-beta.mp3</strong>’ to ‘<strong>s3://my-polly-pixel/polly-audio/</strong>’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*74ELpKDiBpJFjX20wzmq5g.png" /></figure><p><strong>‘on_merge.yml’</strong><br>- Trigger: When a PR is merged to ‘<strong>main</strong>’.<br>- Result: Uploads ‘<strong>speech-prod.mp3&#39;</strong> to ‘<strong>s3://my-polly-pixel/polly-audio/</strong>’.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kknD92p7toKFboTV4KV9mA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*h4y9Ey9NiZ31x9gRsB2nSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QU-M05XX2vpGXiQeEP8vqQ.png" /></figure><h3>3. How to Modify the Text</h3><p>Edit the ‘speech.txt’ file in your repo with new content. <br>Once committed via a PR, GitHub Actions will auto-generate updated audio.</p><h3>Workflow Automation (CI/CD with GitHub Actions)</h3><p>This project uses <strong>GitHub Actions</strong> to automatically convert text content (speech.txt) into audio using <strong>Amazon Polly</strong>, and upload the generated <strong>.mp3</strong> files to an <strong>S3 bucket</strong> in different environments (<strong>beta</strong> and <strong>prod</strong>).</p><h3>PR Preview (Beta Environment)</h3><p><strong>Workflow File: .github/workflows/on_pull_request.yml</strong></p><ul><li><strong>Trigger:</strong> When a pull request targets the <strong>main</strong> branch.</li><li><strong>Action:</strong></li></ul><p>-Synthesizes speech from <strong>speech.txt</strong></p><p>-Uploaded the audio as <strong>speech-beta.mp3</strong> to: <strong>s3://my-polly-pixel/polly-audio/speech-beta.mp3</strong></p><h3>Production Deployment (Prod Environment)</h3><p><strong>Workflow File: .github/workflows/on_merge.yml</strong></p><ul><li><strong>Trigger:</strong> On push to the <strong>main</strong> branch (e.g., after merging a PR)</li><li><strong>Action:</strong></li></ul><p>-Synthesizes speech from <strong>speech.txt</strong></p><p>-Uploaded the audio as <strong>speech-prod.mp3</strong> to: <strong>s3://my-polly-pixel/polly-audio/speech-prod.mp3</strong></p><p>This ensured that the latest approved content is automatically pushed to production without any manual steps.</p><h3>4. How to Verify Audio Uploads</h3><p>1. Go to your S3 Console → Bucket: ‘<strong>my-polly-pixel’</strong>.<br>2. Navigate to the ‘<strong>polly-audio</strong>/’ prefix.<br>3. You should see:<br> : ‘<strong>speech-beta.mp3</strong>&#39; (for preview PRs)<br> : ‘<strong>speech-prod.mp3</strong>&#39; (for production)</p><h3>5. Configuring AWS Credentials in GitHub</h3><p><strong>Repo Settings → Secrets → Actions</strong> and added:</p><p><strong>Secret Name</strong>: AWS_ACCESS_KEY_ID</p><p><strong>Value</strong>: My AWS Access Key</p><p><strong>Secret Name</strong>: AWS_SECRET_ACCESS_KEY</p><p><strong>Value</strong>: My AWS Secret Key</p><p><strong>Secret Name</strong>: AWS_REGION</p><p><strong>Value</strong>: e.g us-east-1</p><p><strong>Secret Name</strong>: S3_BUCKET_NAME</p><p><strong>Value</strong>: my-polly-pixel</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HObwG-TCIh2qWL4e6mwgMQ.png" /></figure><h3>Why This Stack?</h3><p><strong>Technology:</strong> Amazon Polly</p><p><strong>Why We Use It:</strong> Instant natural-sounding speech from text (no ML training)</p><p><strong>Technology:</strong> AWS S3</p><p><strong>Why We Use It:</strong> Serverless, scalable storage for audio assets</p><p><strong>Technology:</strong> GitHub Actions</p><p><strong>Why We Use It:</strong> CI/CD automation, no infrastructure to manage</p><p><strong>Github Link Here:</strong> https://github.com/tatiLogg/LUIT-June-2025-Gold-Polly-Pixel-Learning/tree/main</p><h3><strong>Folder Structure</strong></h3><p>.github/workflows/<br>├── on_merge.yml<br>└── on_pull_request.yml<br>speech.txt<br>synthesize.py<br>README.md</p><p>GITHUB LINK: <a href="https://github.com/tatiLogg/LUIT-June-2025-Gold-Polly-Pixel-Learning/tree/main">https://github.com/tatiLogg/LUIT-June-2025-Gold-Polly-Pixel-Learning/tree/main</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b3a78e3cfb3b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zero Servers, Zero Hassle: Automated Web Deployments!]]></title>
            <link>https://medium.com/@tati.fluffy/zero-servers-zero-hassle-automated-web-deployments-57372077f0ce?source=rss-76c4f961f214------2</link>
            <guid isPermaLink="false">https://medium.com/p/57372077f0ce</guid>
            <dc:creator><![CDATA[Selina Loggins]]></dc:creator>
            <pubDate>Fri, 30 May 2025 02:02:46 GMT</pubDate>
            <atom:updated>2025-05-30T02:02:46.943Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*EoiaybdJgtNmgqCN" /></figure><p>We collaborated as a team to complete this project, leveraging our diverse skills to deliver a scalable, serverless web solution with automated deployment and real-time user insights. The project was a joint effort by <strong>Omawatte Rosario, Selina Loggins, Eric Francis, Isaiah Snead, Niyi Ayinde, Adolphas Gwena, and Ronan Leano.</strong></p><p><strong>INTRODUCTION</strong></p><p>This project focuses on helping Vitality Sphere, a growing health and wellness company, modernize its website and backend systems using AWS. Our team migrated their website from a traditional server to a faster, more cost-effective solution using S3 and CloudFront. We also built a simple tracking system to monitor user visits and store the data in a secure database. To make future updates easier and more efficient, we implemented an automated deployment pipeline with a built-in approval process. These improvements ensure the website runs smoothly, loads quickly, and is easier to manage as the company grows.</p><p><strong>PROJECT OVERVIEW</strong></p><p>In this project, our team modernized the website infrastructure for Vitality Sphere, a growing health and wellness company, by moving their site from a traditional server setup to a faster, more cost-effective serverless solution using AWS. We migrated the site content to an S3 bucket for static hosting, improved global performance with CloudFront, and connected the company’s domain via Route 53. To help the company understand how users interact with the site, we built an API that logs visit times and pages viewed using Lambda and DynamoDB. Finally, we automated the entire deployment process using an automated script and GitHub repository, including a manual approval step to ensure secure and controlled releases.</p><p><strong>Let’s dive into our project!</strong></p><p>Most cloud projects, including ours, use two environments — <strong>development</strong> and <strong>production</strong> — to keep testing and live user activity separate. The development environment is where we safely build, test, and troubleshoot without affecting the real website. The production environment is the live version users interact with. This setup helps catch problems early and ensures smooth updates. In our project, we’ll use both environments, and while some tasks may be repeated in each, documenting the process once will be enough since the same steps apply to both.</p><p><strong>TASK 1: WEBSITE MIGRATION TO STATIC S3 HOSTING</strong></p><p><strong>Objectives:</strong></p><ul><li><strong>Content Migration:</strong> Transfer all website assets — including HTML, CSS, JavaScript, and images — from the existing EC2 instance to an Amazon S3 bucket configured for static website hosting.</li><li><strong>CloudFront Integration:</strong> Set up an Amazon CloudFront distribution to deliver the static content, enhancing global performance and reducing latency for end users.</li><li><strong>DNS Configuration:</strong> Update DNS settings in Amazon Route 53 to direct the company’s domain to the CloudFront distribution, ensuring seamless access to the newly hosted website.</li></ul><p><strong>CONTENT MIGRATION</strong></p><p>Content migration is the process of moving all website files — like text, images, and code — from one place to another. In our project, it means transferring the website from an old server to a faster, more reliable storage system. This step is important because it helps improve the website’s speed, reduces costs, and makes it easier to manage and update in the future.</p><p>Steps to migrate our content:</p><p>1. <strong>Set Up Permissions:</strong> We made sure our EC2 instance has an IAM role with permission to access the S3 bucket.</p><p>2. <strong>Connect via SSM:</strong> We used AWS Systems Manager Session Manager to open a secure terminal session to our EC2 instance — no need for SSH keys.</p><p>3. <strong>Copy Files:</strong> In the terminal, we ran a command to copy your website files from the EC2 storage to the S3 bucket using the AWS CLI, like:<br><strong>aws s3 cp /path/to/files s3://your-bucket-name/ — recursive</strong></p><p>Here’s the command broken down simply:</p><p><strong>aws s3 cp /path/to/files s3://your-bucket-name/ — recursive</strong></p><p><strong>· aws s3 cp</strong> — This tells AWS to <strong>copy files</strong> using the S3 service.</p><p><strong>· /path/to/files</strong> — This is the folder on your EC2 instance where your website files are stored.</p><p><strong>· s3://your-bucket-name/</strong> — This is the address of your S3 bucket where you want to copy the files.</p><p><strong>· — recursive</strong> — This means <strong>copy everything inside the folder</strong>, including all subfolders and files.</p><p>So, the whole command says:</p><p>“Copy all files and folders from this location on the EC2 instance to this S3 bucket.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z9Jxs_rd28ZDBFSB" /></figure><p>4. <strong>Verify Transfer:</strong> We checked the S3 bucket in the AWS Console to confirm all files were uploaded successfully.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*FA9W8lxR_p5Yg2Ow" /></figure><p><strong>STATIC WEBSITE HOSTING</strong></p><p><strong>1. Create an S3 Bucket</strong></p><ul><li>Named the bucket exactly like our subdomain (e.g., dev.yourdomain.com). In our case we had already created our buckets before we carried out content migration in the previous step.</li><li>Enabled <strong>“Static website hosting”</strong> in the bucket settings.</li><li>Uploaded our website files (HTML, CSS, images, etc.).</li></ul><p><strong>2. Set Bucket Permissions</strong></p><ul><li>Added a <strong>bucket policy</strong> to allow the public to <strong>read</strong> the files (so the website is viewable).</li><li>Example of a policy that allows everyone to view content:</li></ul><p><strong>{</strong></p><p><strong>“Effect”: “Allow”,</strong></p><p><strong>“Principal”: “*”,</strong></p><p><strong>“Action”: “s3:GetObject”,</strong></p><p><strong>“Resource”: “arn:aws:s3:::dev.yourdomain.com/*”</strong></p><p><strong>}</strong></p><p><strong>3. Created a Record in Route 53</strong></p><h3>1. Created a Hosted Zone</h3><p>1. Accessed <strong>Route 53</strong> in the AWS Console.</p><p>2. Clicked <strong>Hosted Zones</strong> from the menu.</p><p>3. Clicked <strong>Create Hosted Zone</strong>.</p><p>4. Entered our <strong>domain name</strong> (e.g., dev.yourdomain.com).</p><p>5. Chose a <strong>Public Hosted Zone</strong>.</p><p>6. Clicked <strong>Create Hosted Zone</strong>.</p><h3>2. How we Created a Record for our S3 Website</h3><p>1. In the new hosted zone, click <strong>“Create record”</strong>.</p><p>2. <strong>Leave the name blank</strong> (uses the zone’s root name).</p><p>3. Set <strong>Record Type</strong> to <strong>A — Routes traffic to IPv4 address</strong>.</p><p>4. <strong>Turn on Alias</strong> (toggle it to “Yes”).</p><p>5. For <strong>Alias Target</strong>, choose <strong>Alias to S3 website endpoint</strong>.</p><p>6. Choose the <strong>AWS Region</strong> where your S3 bucket was created.</p><p>7. Pick the <strong>S3 website endpoint</strong> from the list.</p><p>8. Use <strong>Simple Routing Policy</strong>.</p><p>9. Turn on <strong>Evaluate Target Health</strong> (toggle to “Yes”).</p><p>10. Click <strong>Create Record</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*84Kb5RucIRzF5hrM" /></figure><p>Now, our domain points to our static website hosted on S3!</p><p><strong>4. Testing our Website</strong></p><ul><li>Go to<strong> </strong><a href="http://dev.yourdomain.com/"><strong>http://dev.yourdomain.com</strong></a> in the browser.</li><li>Your static website should now load using the AWS-provided URL.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RlbkJOzONHLmQzsD" /></figure><p><strong>CLOUDFRONT INTEGRATION</strong></p><p>Connecting CloudFront to Route 53 in our project ensures users are directed to the nearest AWS edge location, which means faster load times and a better experience when accessing the website. It also improves security by making the S3 bucket private and only accessible through CloudFront, reducing the risk of unauthorized access. Additionally, this setup simplifies domain management and makes the infrastructure more reliable and scalable as traffic grows.</p><h3>Integrate S3 with CloudFront</h3><ol><li><strong>Go to CloudFront<br></strong>Open CloudFront in the AWS Console and click <strong>“Create Distribution”</strong>.</li><li><strong>Choose S3 as Origin<br></strong>In the “Origin domain” field, select your <strong>S3 bucket</strong> (the one with your website content).</li><li><strong>Set Up Secure Access (OAC)</strong></li><li>Choose <strong>Origin Access Control (OAC)</strong> to keep your bucket private.</li></ol><p>Click <strong>“Create new OAC”</strong>, leave settings as is, and <strong>create it</strong>.</p><p><strong>Important:</strong> You’ll get a <strong>bucket policy</strong> from CloudFront — copy and <strong>add it to your S3 bucket permissions</strong> later.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kiJIAb2fHs2VVRId" /></figure><ol><li><strong>Redirect HTTP to HTTPS<br></strong>Under Default Cache Behavior, choose <strong>“Redirect HTTP to HTTPS”</strong> to force secure connections.</li><li><strong>Use Default Caching Settings<br></strong>Keep <strong>“Cache key and origin requests”</strong> as recommended.<br><em>(Tip: If testing updates, you can temporarily set caching to “Disabled” later.)</em></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rq1Q8ahrWesjs9Hd" /></figure><ol><li><strong>Skip WAF for Now<br></strong>Leave <strong>Web Application Firewall (WAF)</strong> disabled for now.</li><li><strong>Set Best Performance Option<br></strong>In the settings, choose <strong>“Use all edge locations”</strong> for best global performance.</li><li><strong>Add Custom Domain (Optional)</strong></li><li>Add your domain (e.g., <a href="http://www.vitalitysphere.com)/">www.vitalitysphere.com)</a> as an <strong>Alternate Domain Name</strong>.</li></ol><ul><li>Choose your <strong>SSL certificate</strong> for HTTPS (must be requested in <strong>AWS Certificate Manager</strong> beforehand).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*N-DHPwLHzgUJ78Oo" /></figure><ol><li><strong>Set Default Page<br></strong>Enter index.html as the <strong>Default Root Object</strong> so it shows when users visit the homepage.</li><li><strong>Create the Distribution<br></strong>Click <strong>“Create Distribution”</strong>.<br>It will take a few minutes to deploy.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*D1OIfxr8s76bBv5z" /></figure><p><strong>Test Your Website<br></strong>Once deployed, open the <strong>CloudFront domain name</strong> in your browser. Your site should load faster and more securely!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gu6Om4_ejNwO4ksM" /></figure><p>This setup helps deliver your website faster to users around the world by caching it in <strong>CloudFront edge locations</strong> closest to them.</p><p><strong>DNS CONFIGURATION</strong></p><p>DNS configuration is important for this project because it makes sure that when users type in the website’s name, they’re automatically directed to the correct location — like our CloudFront distribution or S3-hosted site. This setup ensures the website is easy to access, loads quickly, and works reliably, while also allowing us to control and update where traffic goes without changing the domain name users see.</p><p><strong>Steps</strong> to update our DNS in <strong>Route 53</strong> and point our domain to our <strong>CloudFront distribution</strong>, while meeting security best practices:</p><h3>Connect Domain to CloudFront Using Route 53</h3><p>1. <strong>Go to Route 53<br>-</strong>In the AWS Console, open <strong>Route 53</strong>.</p><p>2. <strong>Open Hosted Zones<br>-</strong>Click on <strong>“Hosted zones”</strong>, then select your domain (e.g., <a href="http://pod-milestone2-stack-1747065639.vitality.luitprojects.com/">pod-milestone2-stack-1747065639.vitality.luitprojects.com</a>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ULpAljDlnNMfiQG5" /></figure><p>3. <strong>Create a New Record<br>-</strong>Click <strong>“Create record”</strong>.</p><p>4. <strong>Set Record Type to A (Alias)</strong></p><p>- Leave the <strong>Record name</strong> blank (it points to the root domain).</p><p>- Choose <strong>Type: A — IPv4 address</strong>.</p><p>- Set <strong>Alias: Yes</strong>.</p><p>5. <strong>Route to CloudFront</strong></p><p>- For <strong>“Route traffic to”</strong>, select <strong>Alias to CloudFront distribution</strong>.</p><p>- Choose your CloudFront domain (e.g., d25wzsuphpaywt.cloudfront.net).</p><p>6. <strong>Save the Record<br>-</strong>Click <strong>“Create records”</strong> to finish.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8uWyC-j1cBl87pNV" /></figure><p>This step ensures that users visiting our production domain are routed through <strong>CloudFront</strong> for faster, more secure content delivery, while our S3 bucket stays private and protected.</p><h3>Task 2: Created an API for User Interaction Tracking</h3><h3>Objective</h3><h3>To track user interactions on the website by creating an API that triggers a Lambda function. Create an API using Amazon API Gateway that triggers an AWS Lambda function each time a user visits a page.</h3><p>This function records the <strong>timestamp</strong> and <strong>page</strong> visited by users, and stores the information in a <strong>DynamoDB table</strong>.</p><h3>What Was Implemented?</h3><h4>1. Lambda Function</h4><ul><li><strong>Function Name:</strong> vitalityspherelambdaweb</li><li><strong>Purpose:</strong> Captures the page visited and the current timestamp, then stores this data in DynamoDB.</li><li><strong>Technologies Used:</strong> Python, Boto3, UUID, AWS Lambda</li></ul><p><strong>Function Configuration Overview:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pWV1EdI_iS2jihGH" /></figure><p><em>Figure 1.1: Lambda Function Configuration (vitalityspherelambdaweb)</em></p><p><strong>Ensured the Lambda Handler is set correctly.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rVxgFt-nkDKjSiw-" /></figure><p>When we created a Lambda function, AWS Lambda needs to know where to start execution. It looks for a handler function, which is the first function Lambda should call when it is invoked.</p><ul><li><strong>Filename</strong>: This tells AWS Lambda which file contains the code that should be executed.</li><li><strong>Handler Function</strong>: This tells Lambda exactly which function within the file should be executed first.</li></ul><p>By configuring the handler in the format <strong>&lt;filename&gt;.&lt;handler-function&gt;</strong>, we are telling AWS Lambda exactly where to find your code’s entry point. So in our case we configured the handler to be <strong>vitality_sphere.lambda_handler.</strong></p><p><strong>Lambda Handler Function Code:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*rZ_XG_oQE48P5aUC" /></figure><p><em>Figure 1.2: Documents the actual logic that posts timestamp and page data to DynamoDB</em></p><p>When working in a team or deploying code across different environments (development, staging, production), this explicit configuration of the handler ensures everyone knows exactly where to look for the Lambda entry point. It makes it easier to understand the architecture, especially in larger projects.</p><h4>User Interaction API — Lambda Function</h4><p><strong>Objective:</strong></p><p>Capture and store timestamp and page visit data whenever a user interacts with the website.</p><p><strong>What We Did:</strong></p><p>We developed an AWS Lambda function named vitalityspherelambdaweb using Python. The function is triggered by an API Gateway POST request. When a user visits a page, the frontend sends a request to the API, which invokes this Lambda function. The function:</p><ol><li>Parses the JSON body of the request.</li><li>Extracts the page field.</li><li>Generates a UTC timestamp.</li><li>Writes both values to a DynamoDB table named vitalitysphere-visitor-data.</li></ol><p>This allows us to track user interactions (what page they visited and when) in real time and store them reliably for analytics and auditing purposes.</p><h4>2. API Gateway</h4><ul><li><strong>Resource Path:</strong> /visitor</li><li><strong>Method:</strong> POST</li><li><strong>Integration:</strong> Directly triggers the Lambda function</li><li><strong>CORS Enabled:</strong> Yes (to allow browser-based interaction)</li></ul><h4>Figure 2.1: API Gateway /production POST Method Integration with Lambda</h4><p>This screenshot illustrates how the <strong>API Gateway</strong> is configured to handle <strong>POST</strong> requests on the /production route. These requests are passed as Lambda proxy integrations to the vitalityspherelambdaweb function in <strong>us-east-2</strong>.</p><p><strong>What this shows</strong>:</p><ul><li>The integration type is Lambda.</li><li>Lambda proxy integration is enabled.</li><li>The flow is: <strong>Client ➝ Method Request ➝ Integration Request ➝ Lambda ➝ Integration Response ➝ Method Response ➝ Client</strong>.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6BSfrt4a3tIV3zUP" /></figure><h4>Figure 2.1: API Gateway /production POST Method Integration with Lambda</h4><h4>API Gateway POST Method Response Configuration</h4><p>This screenshot shows the method response setup for the POST route. It confirms that:</p><ul><li>A 200 OK status is configured.</li><li>The response body returns a Content-Type of application/json.</li><li>No additional headers are defined.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eVebBt7SQ9M_CVKU" /></figure><p><em>Figure 2.2 API Gateway /visitor POST method integration with Lambda</em></p><p><strong>API Post Test</strong></p><p>Using the <strong>curl</strong> command in terminal we tested the API invoke URL to see if it would successfully record the TimeStamp and Page data to our DynamoDB table</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PoVnn8GQHqI12Pq3" /></figure><p><em>Figure 2.3 API Post tests to retrieve data and ensure it is posting to DynamoDB</em></p><p>____________________________________________________________________________</p><p><strong>Data Storage:</strong> Capture and store user interaction data — specifically, the timestamp and page URL — in a <strong>DynamoDB Table</strong> for future analysis and insight into user behavior.</p><p>We created a DynamoDB table as specified to show <strong>Partition Key: TimeStamp (String Value) and Sort Key: Page (String Value) </strong>to support efficient data retrieval and scaling capabilities.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*7-ry_zRfslti_sUS" /></figure><p><em>Figure 1 vitalitysphere-visitor-data table created.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Y9LOyvlaltfxplLX" /></figure><p><em>Figure 1.1 output to the DynamoDB table after running the API test.</em></p><p>In the above image you can see that the returned data time and page matched the API tests we ran in the terminal. This means that the API is sending back data to our DynamoDB table successfully.</p><p><strong>TASK 3: Implement an automated script for Automated Deployment.</strong></p><p><strong>Objectives:</strong></p><ul><li><strong>Source Code Management:</strong> Utilized Github as the centralized repository for managing and version-controlling the website’s source code.</li><li><strong>Build and Deployment Automation:</strong> Configured automated script to automate the building, testing, and deployment of website updates.</li><li><strong>Approval Workflow:</strong> A manual approval step in the deployment pipeline to ensure changes are reviewed and authorized before reaching the production environment via GitHub workflow.</li></ul><p>To begin the process of configuring for automated deployment we started by creating a<em> </em><strong><em>GitHub</em></strong><em> </em><strong><em>Repository</em></strong>, which is a secure and scalable way for us to store and manage our source code for files for the website. Once the repository is created we created a specific .sh file, in this case it was <strong><em>deploy.sh</em></strong>, which we used to create a new Git commit and push it to the centralized Git repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Fppo0JPSXam8w4lv" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/548/0*PS42imxqxJ9CyXy_" /></figure><p>Once the repository was set up, we added the CloudFront ARN to the scripts, both the Dev and Prod., so the script knows where to point to for the website.</p><p>We manually added our files that are located in the S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*AqsySO7-JtrAZofG" /></figure><p>Although we did not use CodePipeline, CodeCommit, or CodeBuild, we successfully created a serverless website for our client by using a deployment script and storing our code in a GitHub repository as the source for our dev environment.</p><p><strong>Task 4: Security and Compliance</strong></p><p><strong>We conducted a detailed security review of this project’s AWS Configurations, focusing on the following, please see below:</strong></p><p><strong>When using my AWS user account, we did not have Permissions because we tried to review and save the defined policies attached to the user, and got Access denied; this happens when we hit the Review and save button. See below:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*YcqWa4XnDJI0GnWZ" /></figure><p><strong>My AWS user could NOT update any policy, see the screenshot below:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/937/0*qawEYaadOPYGMIQU" /></figure><p><strong>IAM Access Analyzer is not available for the AWS user, see below screenshot:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/0*qOcizZoolIWkqib_" /></figure><p><strong>AWS CloudTrail is not available for the user:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*Ke0f4SjOdtRcj6_o" /></figure><p><strong>My AWS user does not have access to the AWS Config. See below:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/0*4lXSk-I8RG5YLikM" /></figure><p><strong>Amazon S3 Bucket</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*8vhgP8a3Rm1f5q5l" /></figure><p><strong>The policy above is a good example of implementing least privilege by carefully restricting access to the Amazon S3 bucket. Here’s a clear breakdown of what this policy does:</strong></p><p><strong>Policy Analysis:</strong></p><p><strong>Purpose: </strong>Allows CloudFront to access specific objects within our S3 bucket.</p><p><strong>Actions Permitted:</strong></p><p>Only allows the s3:GetObject action, meaning CloudFront can only read objects from our bucket. No other operations (like modifying or deleting objects) are permitted.</p><p><strong>Resources Affected:</strong></p><p>Restricts access exclusively to objects (/*) within the specified bucket:</p><p>arn:aws:s3:::pod-milestone2-stack-1747065639.vitality.luitprojects.com/*</p><p><strong>Principal:</strong></p><p>Access is explicitly limited to AWS CloudFront service:</p><p>cloudfront.amazonaws.com</p><p><strong>Condition </strong>(Additional Restriction):</p><p>Further limits requests to come only from the specified CloudFront distribution:</p><p>arn:aws:cloudfront::440744217842:distribution/E1WKZR1LGS2JKL</p><p><strong>Security Implications</strong> (Least Privilege):</p><p><strong>Highly Restrictive:</strong> This policy strictly limits who (CloudFront) can access our bucket, what they can do (only GetObject), and from where (only a specified CloudFront distribution).</p><p><strong>Prevents Unauthorized Access:</strong> Blocks unauthorized services or users from directly accessing the bucket or performing unintended actions.</p><p><strong>Reduces Risk Exposure:</strong> Significantly decreases the likelihood of data breaches or misconfiguration incidents.</p><p><strong>Recommendations:</strong></p><p><strong>Maintain and Regularly Review: </strong>Periodically verify and audit the CloudFront distribution and S3 bucket configurations to ensure accuracy and security.</p><p><strong>Logging and Monitoring:</strong> Enable CloudFront and S3 access logs for additional monitoring and troubleshooting capabilities.</p><p><strong>Version Control:</strong> Store IAM policies like this in version control systems for tracking, auditing, and rollback purposes.</p><p>Overall, the policy above effectively implements the principle of least privilege, aligning with AWS security best practices.</p><p><strong>Least Privilege in AWS</strong></p><p>The principle of least privilege is a critical security practice in AWS that involves granting users, applications, or services only the minimum permissions necessary to perform their tasks. This approach minimizes potential security risks by reducing the chance that sensitive resources are accidentally or maliciously accessed or modified.</p><p><strong>Key Concepts:</strong></p><p><strong>Limit Permissions:</strong> Assigns only permissions needed to perform a specific task.</p><p><strong>Fine-Grained Access Control:</strong> Uses AWS Identity and Access Management (IAM) policies to precisely control what actions users and services can perform.</p><p><strong>Role-Based Access:</strong> Uses IAM roles instead of directly granting permissions to users or services, making permission management more manageable and secure.</p><p><strong>Best Practices in AWS:</strong></p><p><strong>Start with Minimal Permissions:</strong> Gradually expand permissions only as needed.</p><p><strong>Regularly Review Permissions:</strong> Periodically audit IAM policies to remove unnecessary permissions.</p><p><strong>Utilize AWS Managed Policies Wisely:</strong> Prefer custom policies tailored to your specific requirements over overly permissive AWS-managed policies.</p><p><strong>Use IAM Roles for Applications:</strong> Avoid embedding AWS credentials in application code; instead, assign roles with appropriate permissions.</p><p><strong>AWS Tools Supporting Least Privilege:</strong></p><p><strong>IAM Access Analyzer:</strong> Identifies permissions that are overly permissive or unused.</p><p><strong>AWS CloudTrail:</strong> Monitors AWS activity, helping identify required permissions.</p><p><strong>AWS Config:</strong> Tracks configuration changes and helps maintain compliance.</p><p>Implementing least privilege enhances security, reduces risks, and supports compliance with industry standards and regulatory requirements.</p><p><strong>Compliance:</strong></p><p>Adheres to the predefined naming conventions and standards for all AWS resources to ensure consistency, traceability, and compliance with internal policies.</p><p>See below:</p><p><strong>Vitality Sphere AWS Resource Naming Convention Format:<br>All AWS resources must adhere to the following naming convention format:</strong></p><p>&lt;VitalitySphere&gt;-&lt;Environment&gt;-&lt;ResourceType&gt;-&lt;UniqueID&gt;-&lt;FunctionalDescriptio&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/0*CN-jUug_hHTmz6Os" /></figure><p><strong>FINAL STEP:</strong></p><p><strong>Decommissioning EC2 Instance<br></strong>After making the modifications to DNS to have the web traffic pointed to the CloudFront distribution instead of the S3 bucket or the EC2 instance, the next step was to decommission the EC2 instance by stopping the EC2 instance, not terminating.</p><p>Once the EC2 instance has been stopped, we would have to make sure that the website is still functional. If it is shown that the website is down after the server has been stopped, then immediately restore it to a functional state.</p><p>As an industry standard, it would be advisable to keep the server powered off at least for a period of 60 days to ensure that no files or settings are needing to be retrieved from it. If after that period of time there have been no activity or requests made of that server, selecting that instance and terminating it, or there could be a case to keep it as a backup in the event that something happens with the serverless deployment.</p><p><strong>SUMMARY</strong></p><p>By completing these tasks, Vitality Sphere will transition to a modern, cloud-native infrastructure that is not only more scalable and cost-effective but also optimized for performance and future growth. Hosting the website on Amazon S3 and delivering content via CloudFront will significantly reduce load times and operational costs, while eliminating the need to maintain traditional server infrastructure. The integration of a user interaction API provides real-time insights into how users engage with the website, enabling data-driven improvements to content and services.</p><p>Finally, the use of an automated script streamlines the deployment process by reducing manual effort, minimizing errors, and ensuring consistent and repeatable updates across environments. Together, these improvements position Vitality Sphere for long-term success in a competitive digital landscape.</p><p><strong>DELIVERABLES</strong></p><ul><li><strong>Static Website Hosting:</strong> A fully migrated and operational website hosted on Amazon S3, distributed globally via CloudFront, and accessible through a custom domain configured in Route 53.</li><li><strong>User Interaction Tracking:</strong> A functioning API that captures and stores user interaction data in DynamoDB via a Lambda function.</li><li><strong>Automated Script:</strong>An automated script that simplifies deployment by reducing manual effort, minimizing errors, and ensuring consistent updates across environments.</li></ul><p>Here’s a LinkedIn-ready summary for your post, with a professional tone and engaging structure. It includes both the main message and the final deliverables as requested:</p><p><strong>Zero Servers, Zero Hassle: Automated Web Deployments!</strong></p><p>Proud to share the successful completion of a serverless web modernization project for <em>Vitality Sphere</em>, a health and wellness company focused on scaling their digital presence!</p><p>Our team — <strong>Omawatte Rosario, Selina Loggins, Eric Francis, Isaiah Snead, Niyi Ayinde, Adolphas Gwena</strong>, and <strong>Ronan Leano</strong> — came together to deliver a secure, cost-effective, and scalable solution on AWS.</p><p><strong>Key Highlights</strong>:</p><p>Migrated the website from EC2 to Amazon <strong>S3 static hosting</strong>, with global distribution via <strong>CloudFront</strong>.</p><p>Set up <strong>Route 53 DNS</strong> to route traffic securely and efficiently.</p><p>Developed a <strong>user interaction tracking API</strong> using <strong>Lambda, API Gateway, and DynamoDB</strong> for real-time analytics.</p><p>Created an <strong>automated deployment pipeline</strong> with GitHub and custom scripts, including a manual approval step for production releases.</p><p>Focused on <strong>security best practices</strong> with strict S3 policies and compliance with AWS’s least privilege model.</p><p>Finalized the project with the <strong>decommissioning of legacy EC2 infrastructure</strong>.</p><p><strong>Final Deliverables</strong>:<br><strong>Static Website Hosting</strong> on S3 + CloudFront with Route 53 domain integration<br><strong>Real-Time User Tracking</strong> via Lambda + DynamoDB<br><strong>Automated Deployment Script</strong> using GitHub for version-controlled releases</p><p>This project not only modernized Vitality Sphere’s web stack but also laid the foundation for continuous innovation and growth all while reducing costs and operational overhead.</p><p>#Serverless #AWS #WebDevelopment #CloudComputing #Automation #DevOps #Innovation #Teamwork #VitalitySphere</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=57372077f0ce" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[From Simple Script to Smart File Explorer: My Python File Metadata Extractor]]></title>
            <link>https://medium.com/@tati.fluffy/from-simple-script-to-smart-file-explorer-my-python-file-metadata-extractor-f678fe2d9134?source=rss-76c4f961f214------2</link>
            <guid isPermaLink="false">https://medium.com/p/f678fe2d9134</guid>
            <dc:creator><![CDATA[Selina Loggins]]></dc:creator>
            <pubDate>Tue, 13 May 2025 18:57:08 GMT</pubDate>
            <atom:updated>2025-05-13T18:57:08.719Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/471/1*01tUDgzfwdke-wjSbKRAzA.png" /></figure><h3>A Real-World Python Project with Foundational, Advanced, and Complex Logic</h3><h3>Overview</h3><p>In this project, I built a Python utility that extracts and organizes metadata about files on a system. It started as a simple script and evolved into a robust, recursive, and modular tool — capable of scanning entire folder trees and returning structured data.</p><p>This wasn’t just a practice project — it simulates real tasks developers face when dealing with automation, DevOps, or data pipelines. And it showcases how foundational knowledge in Python can be expanded into scalable, production-friendly code.</p><h3>Phase 1 — Foundational: Listing Files in a Directory</h3><h3>Goal:</h3><p>Extract basic file information (name + size) from the current directory.</p><h3>What I Built:</h3><p>A script that loops through the files in the working directory and stores their names and sizes in a list of dictionaries.</p><h3>Code:</h3><p><strong>import os</strong></p><p><strong>files_info = []</strong></p><p><strong>for file_name in os.listdir():<br> if os.path.isfile(file_name):<br> file_size = os.path.getsize(file_name)<br> files_info.append({‘path’: file_name, ‘size’: file_size})</strong></p><p><strong>print(files_info)</strong></p><h3><strong>Output Example:</strong></h3><p><strong>[{‘path’: ‘extract_files.py’, ‘size’: 593}, {‘path’: ‘README.md’, ‘size’: 672}]</strong></p><p>This script worked great — but I knew I could make it more reusable and powerful.</p><h3>Phase 2 — Advanced: Making It a Reusable Recursive Function</h3><h3>Goal:</h3><ul><li>Turn the script into a function</li><li>Allow scanning of <strong>any directory</strong></li><li>Enable <strong>recursive traversal</strong> of all subfolders</li></ul><h3>Why It Matters:</h3><p>Most real-world file systems are <strong>nested</strong>. Hardcoding paths or ignoring subfolders limits the script’s usefulness.</p><h3>Code:</h3><p><strong>import os</strong></p><p><strong>def extract_file_info(path=’.’):<br> files_info = []<br> for root, _, files in os.walk(path):<br> for file in files:<br> full_path = os.path.join(root, file)<br> size = os.path.getsize(full_path)<br> files_info.append({‘path’: full_path, ‘size’: size})<br> return files_info</strong></p><p><strong>if __name__ == “__main__”:<br> results = extract_file_info()<br> for item in results:<br> print(item)</strong></p><h3><strong>Output:</strong></h3><p><strong>{‘path’: ‘./extract_files.py’, ‘size’: 801}<br>{‘path’: ‘./.git/HEAD’, ‘size’: 21}<br>…</strong></p><p>I was now recursively scanning directories with a clean and flexible function.</p><h3>Phase 3 — Complex: Nested Dictionary for File Metadata</h3><h3>Goal:</h3><p>Refactor the function to return a <strong>nested dictionary</strong>, grouping files under their directories.</p><h3>Why It’s Tricky:</h3><p>You must preserve hierarchy while organizing flat data (files) under paths. This meant dynamically building a dictionary of dictionaries.</p><h3>Code:</h3><p><strong>import os</strong></p><p><strong>def extract_file_info_nested(path=’.’):<br> nested_info = {}</strong></p><p><strong>for root, _, files in os.walk(path):<br> relative_root = os.path.relpath(root, path)<br> nested_info[relative_root] = {}</strong></p><p><strong>for file in files:<br> full_path = os.path.join(root, file)<br> size = os.path.getsize(full_path)<br> nested_info[relative_root][file] = {‘path’: full_path, ‘size’: size}</strong></p><p><strong>return nested_info</strong></p><p><strong>if __name__ == “__main__”:<br> from pprint import pprint<br> pprint(extract_file_info_nested())</strong></p><h3>Output Example:</h3><p><strong>{<br> ‘.’: {<br> ‘extract_files.py’: {‘path’: ‘./extract_files.py’, ‘size’: 801},<br> ‘README.md’: {‘path’: ‘./README.md’, ‘size’: 672}<br> },<br> ‘.git/hooks’: {<br> ‘pre-commit.sample’: {‘path’: ‘./.git/hooks/pre-commit.sample’, ‘size’: 1643},<br> …<br> }<br>}</strong></p><p>Now, my output wasn’t just usable — it was <strong>structured, grouped, and production-ready</strong>.</p><h3>GitHub Repository</h3><p>All code is publicly available here:<br>🔗 <a href="https://github.com/tatiLogg/file_metadata_extractor">https://github.com/tatiLogg/file_metadata_extractor</a></p><h3>What I Learned</h3><ul><li>Writing reusable functions with default parameters</li><li>Working with os and os.walk for filesystem traversal</li><li>Managing nested data structures (dictionary of dictionaries)</li><li>Using Git and GitHub to version and share real-world code</li></ul><h3>Tools Used</h3><ul><li>Python 3</li><li>Git + GitHub</li><li>macOS terminal (zsh)</li><li>Nano text editor / VS Code</li></ul><h3>Final Thoughts</h3><p>This project started small but quickly became a deep dive into file systems, recursion, and clean code architecture. It reinforced how a simple idea can scale into a powerful tool with just a few iterations and the right mindset.</p><h3>Let’s Connect</h3><ul><li>🔗 GitHub: <a href="https://github.com/tatiLogg">@tatiLogg</a></li><li>💼 Portfolio: <a href="http://www.linkedin.com/in/selina-loggins">www.linkedin.com/in/selina-loggins</a></li><li>✉️ Email: <em>Selina-Loggins@outlook.com</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f678fe2d9134" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How I Built an EC2 Instance Name Generator Using Python]]></title>
            <link>https://medium.com/@tati.fluffy/how-i-built-an-ec2-instance-name-generator-using-python-b2207716ba6f?source=rss-76c4f961f214------2</link>
            <guid isPermaLink="false">https://medium.com/p/b2207716ba6f</guid>
            <dc:creator><![CDATA[Selina Loggins]]></dc:creator>
            <pubDate>Tue, 13 May 2025 16:40:49 GMT</pubDate>
            <atom:updated>2025-05-13T16:40:49.297Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/732/1*VS0uLFcB0uZ8rVfEX4nijA.png" /></figure><p>I built a simple Python script to generate random EC2 instance names for different departments. This foundational project helped me practice scripting, terminal commands, and problem-solving.</p><h3><strong>CI/CD Static Website Project — Part 1: Foundational Phase</strong></h3><p>This phase focused on setting up a basic CI/CD pipeline to automatically deploy a static website to AWS S3 using GitHub and CodePipeline.</p><h3>Step 1 — Set Up the Folder and File</h3><p>I started by creating a new project folder and Python file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7DJV4lnCyW62GSaK1A6RmA.png" /><figcaption><em>Project folder and file created in terminal</em></figcaption></figure><h3>Step 2 — Opened the File in VS Code</h3><p>Then I opened the file in VS Code and began writing my script.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O9Hl7z_Oj3JsOGWwnYt6ZA.png" /><figcaption><em>Initial user input code in VS Code</em></figcaption></figure><h3>Step 3 — Ran Into a Quick Terminal Mistake</h3><p>I mistakenly typed <strong>import</strong> directly into the terminal and received an error. This reminded me to always run Python code inside the <strong>.py</strong> file or with python3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s1KZGMOb3Qeu2hmFKdqaog.png" /><figcaption><em>Terminal error from incorrect import usage</em></figcaption></figure><h3>Step 4 — Tested the Script (No Output Yet)</h3><p>My first test ran but didn’t show results because output code hadn’t been added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2_uMP6r26R8VUU5cB8I2Dg.png" /><figcaption><em>Script prompts for input but doesn’t show EC2 names yet</em></figcaption></figure><h3>Step 5 — Wrote the Full Logic</h3><p>After adding all three steps (input, normalize, generate), the script was ready.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*o0N-pMSwNR5DyS00XwFNUQ.png" /><figcaption><em>Full EC2 name generator logic in VS Code</em></figcaption></figure><h3>Step 6 — Successfully Ran the Script</h3><p>Finally, I tested it and saw the generated EC2 instance names as expected!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7gGkXEpIxW9jKmZfPJF6qQ.png" /><figcaption><em>Successful EC2 name output based on department</em></figcaption></figure><h3>Lessons Learned</h3><ul><li>Python input/output flow</li><li>Avoiding terminal vs. code execution confusion</li><li>Formatting strings and using loops effectively</li></ul><p>This foundational setup gave me the confidence to tackle more complex stages — and laid the groundwork for everything that followed!</p><h3>EC2 Name Generator — Part 2: Advanced Phase (Input Validation &amp; Access Control)</h3><p>In the <strong>Advanced Phase</strong> of my EC2 Random Name Generator project, I focused on improving the script by adding <strong>department restrictions</strong>. The goal was to ensure that only certain teams could use the tool to generate EC2 instance names — simulating a common access control pattern in DevOps.</p><h3>What I Improved</h3><p>In this phase, I enhanced the original script to:</p><ul><li>Accept a <strong>department name</strong> from the user</li><li>Validate it against a list of <strong>approved departments</strong>:</li><li>Marketing</li><li>Accounting</li><li>FinOps</li><li>Block all other departments from using the tool</li><li>Support <strong>case-insensitive input</strong> (e.g., “marketing”, “MARKETING”, “Marketing” all work)</li></ul><h3>Why It Matters</h3><p>In real-world environments, tools like this shouldn’t be used by just anyone. By adding access controls and input validation, I made the script more realistic, more secure, and more adaptable to team policies.</p><h3>How I Did It</h3><p>I added a validation step using Python lists and string normalization:</p><p><strong>Python</strong></p><p><strong>allowed_departments = [“marketing”, “accounting”, “finops”]<br>normalized_dept = department.strip().lower()</strong></p><p><strong>if normalized_dept not in allowed_departments:<br> print(f”\n ‘{department}’ is not authorized to use this EC2 name generator.”)<br> print(“Allowed departments: Marketing, Accounting, or FinOps”)<br> sys.exit(1)</strong></p><p>This ensures:</p><ul><li>Unauthorized departments are blocked</li><li>Valid teams can proceed to generate names</li></ul><h3>Screenshots</h3><h4>Valid Input — Names Generated</h4><p>EC2 instance names successfully generated for a valid department.</p><h4>Valid department example:</h4><p>When <strong>Marketing</strong> is entered, the script outputs three valid, unique EC2 names using random letters and digits.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CAtXIshHXMc8vv1eAo1dGA.png" /><figcaption>When <strong>Marketing</strong> is entered, the script outputs three valid, unique EC2 names using random letters and digits.</figcaption></figure><h4>Invalid Input — Access Denied</h4><p>The tool blocks departments not on the approved list</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bptsnFoGNOPGkESVWNiXaQ.png" /><figcaption>Error message after typing “HR”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQJSLcdVyCjabQDQ2Nr8ag.png" /><figcaption>Error message after typing “Engineering”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXBrOL3OAeLd4bPFUyJ2xA.png" /><figcaption>Testing <strong>FinOps</strong> returns another valid set of EC2 names.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_2XjzYkPEGJvS7PLnCAtA.png" /><figcaption>Here’s the final function with department validation wrapped in a callable format.</figcaption></figure><h3>What I Learned</h3><ul><li>How to use if statements for access control</li><li>How to normalize string input for consistency</li><li>How to block unauthorized use gracefully</li><li>The importance of guiding users with helpful output</li></ul><p>This small change turned my basic script into something more secure and usable in a real team setting.</p><h3>Source Code on GitHub</h3><p>👉 <a href="https://github.com/tatiLogg/ec2-random-name-generator/tree/main">https://github.com/tatiLogg/ec2-random-name-generator/tree/main</a></p><h3>EC2 Name Generator — Part 3: Complex Stage</h3><p>In this final stage, I took everything I built in the foundational and advanced stages and made the code more reusable by converting it into a <strong>function</strong>. This added flexibility allows me to scale and extend the generator more easily — a crucial practice in production-level coding.</p><h3>What Changed?</h3><ul><li>I created a function called <strong>generate_ec2_names()</strong> that encapsulates all the logic from input handling to name generation and validation.</li><li>I called the function at the end of the script to ensure it executes properly.</li><li>The code remains clean, modular, and scalable — ready to be imported into larger automation workflows later.</li></ul><h3>Final Code</h3><p>Here’s what the final function looks like, with all logic encapsulated:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3_2XjzYkPEGJvS7PLnCAtA.png" /><figcaption>Final code refactored into a function</figcaption></figure><h3>Test — Valid Department</h3><p>I ran the script and entered 3 and Marketing. The script executed flawlessly and returned three unique names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sBx_8tB7_Pkx134z0pSMYw.png" /><figcaption>Valid run with Marketing department input</figcaption></figure><h3>Test — Invalid Department</h3><p>Entering HR produced the correct error message and exited the program as expected.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sBx_8tB7_Pkx134z0pSMYw.png" /><figcaption>Invalid department: HR</figcaption></figure><h3>Test — Another Valid Department</h3><p>Using the department FinOps also resulted in a successful output of three properly formatted names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aXBrOL3OAeLd4bPFUyJ2xA.png" /><figcaption>Valid run with FinOps department input</figcaption></figure><p>Code Flow with Screenshot Prompt</p><p>Before any names are generated, the script prompts the user to specify the number of EC2 names.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQJSLcdVyCjabQDQ2Nr8ag.png" /><figcaption>Invalid department: Engineering</figcaption></figure><h3>Key Takeaways</h3><ul><li>Modularizing your Python code into functions is a best practice and lays the groundwork for testability and reusability.</li><li>Protecting system behavior with validations (such as allowed departments) prevents misuse and ensures clarity.</li><li>Clear user prompts and error handling make CLI tools more user-friendly and robust.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2207716ba6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Serverless URL Shortener with AWS Lambda, API Gateway, and CloudWatch]]></title>
            <link>https://medium.com/@tati.fluffy/building-a-serverless-url-shortener-with-aws-lambda-api-gateway-and-cloudwatch-dbc10e016b3f?source=rss-76c4f961f214------2</link>
            <guid isPermaLink="false">https://medium.com/p/dbc10e016b3f</guid>
            <dc:creator><![CDATA[Selina Loggins]]></dc:creator>
            <pubDate>Mon, 21 Apr 2025 17:53:01 GMT</pubDate>
            <atom:updated>2025-04-21T17:53:01.117Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PetRd24IhWEcLlh3Tq-N_A.png" /></figure><h3>Building a Serverless URL Shortener with AWS Lambda, API Gateway, and CloudWatch</h3><p>Have you ever wanted to build your own Bitly-style URL shortener — without having to manage servers or databases manually?</p><p>In this tutorial, I’ll walk you through how I built a serverless URL shortener using AWS Lambda, API Gateway, and DynamoDB, with full observability through CloudWatch dashboards and logs. Bonus: I’ll also show you how to test your API with Postman and curl, and include a cost-saving tip for disabling unnecessary metrics.</p><p>This project is simple, powerful, and production-friendly — and I’ll share my lessons learned along the way!</p><p><strong>Architecture Overview: </strong>[Postman or cURL] → [API Gateway (POST /create)] → [AWS Lambda Function] → [DynamoDB Table]<br> ↘︎ CloudWatch Logs + Metrics</p><h3>What You’ll Build</h3><ul><li>A Lambda function that accepts a long URL and returns a shortened version.</li><li>A DynamoDB table to store the URL mappings.</li><li>An API Gateway endpoint to expose the Lambda.</li><li>CloudWatch metrics and dashboards for full monitoring.</li><li>Postman and curl testing setup for validation.</li></ul><h3>Step 1: Create the DynamoDB Table</h3><ul><li><strong>Table Name</strong>: UrlShortenerTable</li><li><strong>Partition Key</strong>: shortId (String)</li><li>Capacity: On-demand (leave defaults)</li></ul><p>You can create this easily via the AWS Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ptw6fSaWyT7XI8i18c45IQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DJ6JucjFdAUoQ2tiYgenTQ.png" /></figure><h3>Step 2: Write the Lambda Function</h3><p>Language: Python 3.12</p><p><strong>import json<br>import boto3<br>import string<br>import random<br>import os</strong></p><p><strong>dynamodb = boto3.resource(‘dynamodb’)<br>table = dynamodb.Table(os.environ[‘TABLE_NAME’])</strong></p><p><strong>def generate_short_id(length=6):<br> return ‘’.join(random.choices(string.ascii_letters + string.digits, k=length))</strong></p><p><strong>def lambda_handler(event, context):<br> print(“EVENT:”, json.dumps(event))<br> <br> try:<br> body = json.loads(event.get(“body”, “{}”))<br> except json.JSONDecodeError:<br> return {<br> “statusCode”: 400,<br> “body”: json.dumps({“error”: “Invalid JSON in request body”})<br> }</strong></p><p><strong>long_url = body.get(“longUrl”)<br> if not long_url:<br> return {<br> “statusCode”: 400,<br> “body”: json.dumps({“error”: “Missing ‘longUrl’ field”})<br> }</strong></p><p><strong>short_id = generate_short_id()<br> table.put_item(Item={“shortId”: short_id, “longUrl”: long_url})</strong></p><p><strong>return {<br> “statusCode”: 200,<br> “body”: json.dumps({<br> “shortUrl”: f”</strong><a href="https://your-domain/%7Bshort_id"><strong>https://your-domain/{short_id</strong></a><strong>}&quot;,<br> “shortId”: short_id<br> })<br> }</strong></p><p>Set the environment variable:</p><ul><li>TABLE_NAME = UrlShortenerTable</li></ul><p>Attach the AmazonDynamoDBFullAccess policy to your Lambda’s execution role.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ki3eBBpE_OHfNCRggJ5dhw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x5FjCA2KIxpAKVwqcDI6sA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*An2dwcLYgbqubRDtciIINQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_sbhyrfUrYKbAxsItZl78g.png" /></figure><h3>Step 3: Create the API Gateway</h3><ol><li>Use an <strong>HTTP API</strong>, not a REST API.</li><li>Create a route:</li></ol><ul><li>Method: POST</li><li>Path: /create</li></ul><p>3. Integrate it with your Lambda function.</p><p>Once deployed, your URL will look like: <a href="https://your-api-id.execute-api.us-east-1.amazonaws.com/dev/create">https://your-api-id.execute-api.us-east-1.amazonaws.com/dev/create</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jiM-h0VDZMlV-gTubFXxsQ.png" /></figure><h3>Step 4: Test with Postman and curl</h3><h3>Postman Setup:</h3><ul><li>Method: POST</li><li>URL: https://your-api-id.execute-api.us-east-1.amazonaws.com/dev/create</li><li>Headers: Content-Type:applicaton/json</li><li>Body (raw → JSON</li></ul><p><strong>{<br> “longUrl”: “</strong><a href="https://www.medium.com/@tati.fluffy"><strong>https://www.medium.com/@tati.fluffy</strong></a><strong>&quot;<br>}</strong></p><p>Or use curl:</p><p>curl -X POST <a href="https://your-api-id.execute-api.us-east-1.amazonaws.com/dev/create">https://your-api-id.execute-api.us-east-1.amazonaws.com/dev/create</a> \<br> -H “Content-Type: application/json” \<br> -d ‘{“longUrl”:”<a href="https://www.medium.com/@tati.fluffy">https://www.medium.com/@tati.fluffy</a>&quot;}&#39;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j3PEDq2SsGAD9wPruAYkFA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IZhBy8CqiwMvv-0FpvkIgg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q_5eKncYscAf2pFp0efJRA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hcbkN6wNWXuVTXBydnMz3w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bE6sq5pJZM7i371-Vnr77Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URZThIsr1avo4B5nBdMZ7Q.png" /></figure><h3>Step 5: CloudWatch Monitoring</h3><p>I enabled route-level metrics in API Gateway and built a dashboard showing:</p><ul><li>Request count</li><li>4xx and 5xx error rates</li><li>Average latency</li><li>Success rate</li></ul><p><strong>Screenshot</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZIcLhjXx_yTbiFvlX2WtFw.png" /></figure><h3>***Troubleshooting and Fixes</h3><h3>Error 1: Repeating the domain name</h3><p>To fix the requested URL. I had to make sure it is: <a href="https://abc123.execute-api.us-east-1.amazonaws.com/dev/create">https://abc123.execute-api.us-east-1.amazonaws.com/dev/create</a></p><p><strong>AND NOT:</strong> <a href="https://abc123.execute-api.us-east-1.amazonaws.com/dev.execute-api.us-east-1.amazonaws.com/create">https://abc123.execute-api.us-east-1.amazonaws.com/dev.execute-api.us-east-1.amazonaws.com/create</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-OiyVQkfXe3BC6wSkAeDng.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nqRcQDksgUtaZYvE03QqTw.png" /><figcaption>1st Error : repeating the domain (execute-api.us-east-1.amazonaws.com) <strong>twice</strong></figcaption></figure><h3>Error 2: 500 Internal Server Error</h3><p>Viewed the logs in CloudWatch:</p><ul><li>CloudWatch → Log Groups → aws/lambda/CreateShortUrlFunction</li><li>Opened my latest stream → checked traceback</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vY9_j5WY28qdURTDZRKedg.png" /><figcaption>2nd Error — With me hitting a 500 Internal Server Error meant: The API Gateway successfully called my Lambda function, but something inside the Lambda broke.</figcaption></figure><h3>Error 3: “Missing ‘longUrl’ field”</h3><p>Likely caused by incorrect JSON in Postman or malformed curl. Used:</p><p>{<br> “longUrl”: “<a href="https://www.medium.com/@tati.fluffy">https://www.medium.com/@tati.fluffy</a>&quot;<br>}</p><h3>Troubleshooting Tip</h3><p>Got a KeyError: &#39;body&#39; in Lambda logs?</p><p>That means your function is expecting a “body”<br>field in the event but isn’t finding it. Make sure:</p><ul><li>Your API Gateway is using Payload format version 2.0</li><li>You’re using eventevent.get(&quot;body&quot;) safely</li></ul><h3>Lessons Learned</h3><ul><li>Always check the payload format version in API Gateway.</li><li>Lambda needs permissions to write to DynamoDB.</li><li>You can save costs by disabling metrics you’re not actively using.</li><li>curl is a lifesaver when Postman misbehaves!</li></ul><h3>What’s Next?</h3><p>Here’s what I’ll be adding soon:</p><ul><li>A frontend UI for users to paste long URLs and get shortened links</li><li>A redirect handler (GET /{shortId}) to open the original URL</li><li>Slack alerting for failed POSTs</li></ul><h3>GitHub Repo</h3><p>Explore the full project and folder structure: <a href="https://github.com/tatiLogg/serverless-url-shortener">GitHub — serverless-url-shortener</a></p><h3>About Me</h3><p><strong>Selina Loggins</strong><br>Cloud DevOps &amp; Cybersecurity Engineer☁<br><a href="https://github.com/tatiLogg">GitHub</a> | <a href="https://linkedin.com/in/selinaloggins">LinkedIn</a> | <a href="https://medium.com/@tati.fluffy">Medium</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbc10e016b3f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Automating My First Static Website with GitHub + AWS S3 + CodePipeline]]></title>
            <link>https://medium.com/@tati.fluffy/automating-my-first-static-website-with-github-aws-s3-codepipeline-6e6357ad3152?source=rss-76c4f961f214------2</link>
            <guid isPermaLink="false">https://medium.com/p/6e6357ad3152</guid>
            <dc:creator><![CDATA[Selina Loggins]]></dc:creator>
            <pubDate>Mon, 07 Apr 2025 18:45:23 GMT</pubDate>
            <atom:updated>2025-04-07T19:26:38.662Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*He_K9sJYBdsAAcJpO7haKw.png" /></figure><p>How I built my first CI/CD pipeline to deploy a personal website — no more manual uploads!</p><p>As a Cloud Engineer and career pivoter passionate about DevOps and automation. I recently completed a project to automate static website deployment using GitHub, Amazon S3, and AWS CodePipeline, and I’m excited to share how I built it — step by step, with lessons learned.</p><h3>Project Goal</h3><p>My team wanted an automated way to deploy code updates to a static website. Developers were previously doing it manually — now they just push to GitHub and the pipeline takes care of the rest.</p><h3>Tools Used</h3><ul><li><strong>GitHub</strong> — to host my source code</li><li><strong>AWS S3</strong> — to serve the static website</li><li><strong>AWS CodePipeline</strong> — to automate deployment</li><li><strong>Terminal (MacBook Pro)</strong> — for git commands</li><li><strong>Nano + TextEdit</strong> — for editing HTML</li></ul><p>There were some challenges faced that I integrated and labelled below as CHALLENGES along with the SOLUTIONS detailing what I did to solve them.</p><p>Some of my <strong>CHALLENGES</strong> were:</p><ol><li><strong>CHALLENGE</strong>: GitHub Push Rejected</li></ol><p><strong>SOLUTION</strong>: Used git pull origin main — rebase to fix</p><p><strong>2. CHALLENGE</strong>: 403 Access Denied Result</p><p><strong>SOLUTION</strong>: Added a proper bucket policy and checked to make sure I disabled “Block Public Access”</p><p><strong>3. CHALLENGE </strong>: Needed to shorten the name to under 32 characters to be able to proceed and connect.</p><p><strong>SOLUTION</strong>: Shortened the name</p><p>4. <strong>CHALLENGE : </strong>When setting up AWS CodePipeline to connect to GitHub, I initially ran into confusion about granting repository access. I noticed that choosing “All repositories” opens up broader access than necessary, which could expose more projects than intended.</p><p><strong>SOLUTION : </strong>I<strong> </strong>learned that it’s always best practice to select the option “Only Select Repositories” to give AWS explicit access to my repo so that GitHub access is locked in.</p><h3>Foundational Phase Breakdown</h3><h3>Step 1: I Created a GitHub Repo</h3><p>I created a public repository named: cloud-resume-static-site</p><p>Then I cloned it locally:</p><h3>🌐 git clone <a href="https://github.com/tatiLogg/cloud-resume-static-site.git">https://github.com/tatiLogg/cloud-resume-static-site.git</a></h3><h3>Step 2: Created the index.html</h3><p>I created a simple HTML file:</p><p>&lt;h1&gt;Hello Level Up In Tech!&lt;/h1&gt;<br>&lt;h3&gt;Anyone can transition to DevOps. The steps are:&lt;/h3&gt;<br>&lt;ol&gt;<br> &lt;li&gt;Trust the process&lt;/li&gt;<br> &lt;li&gt;Work hard&lt;/li&gt;<br> &lt;li&gt;Be consistent&lt;/li&gt;<br> &lt;li&gt;Stay Hungry&lt;/li&gt;<br>&lt;/ol&gt;</p><p>I later, updated it with my personal story and emoji’s— more on that below!!</p><p>Pasted the index.html content:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3MdyIMvNadLSLl7cYkGOuw.png" /></figure><p>Now proceeded with committing and pushing my changes to GitHub commands:</p><p><strong>: git add index.html<br>: git commit -m “Initial commit with Level Up HTML”<br>: git push origin main</strong></p><p>Expected Result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zr4k0p-qK4oUjgR-vpsIkg.png" /></figure><h3>Step 3: Set Up S3 for Static Hosting</h3><h3>Goal:</h3><p>Create an S3 bucket that will host my static website and serve the HTML file when someone visits a URL.</p><h3>Why This Step Matters:</h3><p>Amazon S3 (Simple Storage Service) can host static websites without needing a server. My pipeline will deploy my HTML file to this S3 bucket so anyone can view my site through a URL.</p><p>Created an S3 bucket named: <strong>cloud-resume-static-site-selina</strong></p><ul><li>Enabled static website hosting</li><li>Configured index.html as the default document</li><li>Made the bucket public using the following policy :</li></ul><p><strong>{<br> “Effect”: “Allow”,<br> “Principal”: “*”,<br> “Action”: “s3:GetObject”,<br> “Resource”: “arn:aws:s3:::cloud-resume-static-site-selina/*”<br>}</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u5IjrLdzEDAwUTMkjq8tRg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MyqUParSvkbT4X-vtvRgfg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ixnKUfl7VLqp_GsEE1Zy-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rDKjx1cGH98ukYS7iG3Eog.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SQo-nySgq47LL5lqknuqIQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P06DWRbcs6YAlLTrEidHxg.png" /></figure><h3>STEP 4: Set Up the AWS CodePipeline to Automate Deployment</h3><h3>Goal:</h3><p>Create a CI/CD pipeline that automatically deploys my HTML to S3 every time I update my GitHub repo.</p><h3>Why This Step Matters:</h3><p>This eliminates the need to manually upload changes to S3. As soon as a developer (myself) pushes new code to GitHub, the pipeline:</p><ul><li>Detects the change</li><li>Pulls the updated file</li><li>Uploads it to my S3 website bucket</li></ul><h3>Pipeline Settings</h3><ul><li><strong>Pipeline name</strong>: cloud-resume-pipeline-selina</li><li><strong>Service role</strong>: Selected — New service role</li><li>AWS named it (Role name)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gbH3DCBdGcxZU03543H2kw.png" /><figcaption>Selected : Build custom pipeline option</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E3xgwfqCqRIaWlVZ8hHIrQ.png" /><figcaption>Role name provided by AWS</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7698Ox04craJYY63eKL6jg.png" /><figcaption>Installation and Authorization after selecting Pipeline Settings</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5fyPIUINN1GcVaglYeA3wQ.png" /><figcaption>Connection process</figcaption></figure><p><strong>CHALLENGE #1</strong> : Needed to shorten the name to under 32 characters to be able to proceed and connect.</p><p><strong>SOLUTION</strong>: Shortened the name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*b0imvmRW50Wr50o2DpJJJg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uJoIEa9KJcZSer4iU8jjGw.png" /></figure><p><strong>CHALLENGE #2 : </strong>When setting up AWS CodePipeline to connect to GitHub, I initially ran into confusion about granting repository access. I noticed that choosing “All repositories” opens up broader access than necessary, which could expose more projects than intended.</p><p><strong>SOLUTION : </strong>I<strong> </strong>learned that its always best practice to select the option “Only Select Repositories” to give AWS explicit access to my repo so that GitHub access is locked in.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vRaUaixKvidVwtOPopfelg.png" /><figcaption>Updated “Repository Access”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kBejkJNeqajQxgUmb-bZtg.png" /><figcaption>Connected to AWS CodePipeline to GitHub successfully</figcaption></figure><h3>3. Source Stage</h3><ul><li><strong>Source provider</strong>: GitHub(via GitHub App)</li><li>Clicked <strong>Connect to GitHub</strong> and authorized</li><li><strong>Repository name</strong>: tatiLogg/cloud-resume-static-site</li><li><strong>Branch name</strong>: main</li><li><strong>Change detection options</strong>: Kept as default</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gkUref0G7B_tlkymH4LxYg.png" /><figcaption>Source stage completion</figcaption></figure><h3>4. Build Stage</h3><ul><li>Chose to: Skip build stage</li><li>Clicked Skip build stage again to confirm</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8IcVOPQ-qmNU5oM-2wE6Nw.png" /><figcaption><em>I’m skipping the build stage since I am not compiling or building anything — I am just deploying HTML directly.</em></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sx2ZskUbnb2Evddvn_DNA.png" /><figcaption><em>I am deploying static files (HTML), not building code. Skipping this stage keeps my pipeline lightweight and fast!</em></figcaption></figure><h3>5. Deploy Stage</h3><ul><li><strong>Deploy provider</strong>: Amazon S3</li><li><strong>Region</strong>: Same as my bucket : us-east-1</li><li><strong>Bucket</strong>: Selected cloud-resume-static-site-selina</li><li><strong>Extracted file before deploy</strong>: ✅ (Checked this box — as it unzips the uploaded file)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YGEUc67iTeRX7jQ3_RmVLA.png" /><figcaption>Deploy stage completion</figcaption></figure><h3>Expected Result:</h3><ul><li>My pipeline will start immediately</li><li>Source pulls from GitHub</li><li>Files are deployed to S3</li><li>My website is LIVE via the static site URL</li></ul><h3>6. Reviewed and Created</h3><ul><li>Reviewed all my settings</li><li>Created my Pipeline</li></ul><p><strong>Expected Result</strong>:</p><ol><li>My pipeline immediately started.</li><li>It pulled the index.html from GitHub</li><li>Deployed it to my S3 bucket</li><li>After a few seconds, I was able to open my S3 Website URL and see my “Hello Level Up In Tech!” message live on the internet!</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IViPSzrukB4zfOQ1Xzwk7w.png" /><figcaption>My pipeline is live, healthy, and has successfully deployed my static site!</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ooA1RBlZSN1afXGj-1uVpw.png" /><figcaption>S3 Website URL results</figcaption></figure><h3>Test:</h3><p>To test that it works, I went to my index.html in GitHub and:</p><ol><li>Changed “Hello Level Up In Tech!” to “Hello from Selina’s CI/CD Pipeline!” along with other additional changes.</li><li>I committed and pushed</li><li>Waited ~1–2 minutes and..</li><li>Refreshed my website link</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NoeeTlrJm6j9ZHLA6NbvDA.png" /></figure><p><strong>CHALLENGE #3:</strong> Error in the terminal screen shot below showed that my GitHub repo has new changes that are not in my local copy as of yet.</p><p><strong>SOLUTION</strong>: To safely bring the remote changes into mylocal repo before pushing, I ran: <strong>git pull origin main — rebas</strong>e</p><p>This command did two things:</p><ol><li>Pulled the latest changes from GitHub (origin/main)</li><li>Reapplied my commits on top of them using a rebase (cleaner history than merge)</li></ol><p>Then I was able to safely push again: <strong>git push origin main</strong></p><p>This:</p><ul><li>Prevents accidental overwriting of changes that exist on GitHub</li><li>Ensures my local branch is synced with the latest version of the repo</li><li>Keeps my commit history clean and avoids unnecessary merge commits</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-n20BwftYjXwqbjf5pmUAw.png" /></figure><p><strong>CHALLENGE #4:</strong> The “Access Denied” error happened due to my bucket missing static website hosting that was not fully configured. The public read permissions were correctly set and confirmed as disabled.</p><p>I fixed it by:</p><ol><li>Going to the <strong>S3 bucket → Properties tab</strong></li><li>Scrolling to <strong>Static Website Hosting</strong></li><li>Enabling it and setting:</li></ol><ul><li>Index document: index.html</li><li>(Optional) Error document: error.html</li></ul><p>Even when using Origin Access Control (OAC)<strong> </strong>with CloudFront, the S3 bucket must still be configured for static website hosting so that it knows what file to serve by default.</p><p>Otherwise, CloudFront will fetch from the root ( / ), and if the bucket doesn’t know to serve index.html, it throws an <strong>Access Denied</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bN9QUOX4RTqcDsyQiemDcw.png" /><figcaption>Access Denied to my website</figcaption></figure><p><strong>SOLUTION to CHALLENGES #3 and #4:</strong> Added a bucket policy to allow public access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2WAlnkvKo90eOAu-3Xd3AA.png" /><figcaption>Bucket policy added</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iLowdjCsgzV7Enq5obh7qQ.png" /><figcaption>Updated website showing my custom message!</figcaption></figure><h3>Final Result</h3><p>You can view the live site here:<br>🌐 <strong>cloud-resume-static-site-selina.s3-website-us-east-1.amazonaws.com</strong></p><h3>Reflections</h3><p>This project gave me confidence in:</p><ul><li>CI/CD pipelines</li><li>Git/GitHub usage</li><li>S3 static hosting</li><li>Debugging real-world AWS issues</li><li>Documenting and communicating tech projects</li></ul><h3>🌐 README content available at: <a href="https://github.com/tatiLogg/cloud-resume-static-site/blob/main/README.md">https://github.com/tatiLogg/cloud-resume-static-site</a></h3><h3>🔜 Up Next: Advanced Phase</h3><p>In Part 2 of this blog series, I’ll walk through:</p><ul><li>Adding a manual approval step</li><li>Setting up a CloudFront distribution for speed and global access</li></ul><p>Let me know what you think!<br>💬 Drop questions or connect with me on <a href="https://www.linkedin.com/in/selinaloggins">LinkedIn</a></p><h3>ADVANCED PHASE OVERVIEW</h3><h3>1. <strong>Added a Manual Approval Step</strong></h3><p>So updates aren’t automatically deployed until someone (like a senior dev or me) approves them.</p><h3>2. <strong>Add CloudFront</strong></h3><p>To cache and serve my site globally with lightning-fast speed and reduced latency.</p><h3><strong>STEP 1:</strong> Added Manual Approval Stage to CodePipeline</h3><h3>Goal:</h3><p>Before any new update hits my S3 website, an email gets sent to an <strong>approver</strong> (myself or another stakeholder). Only when that person clicks <strong>“Approve”</strong>, the deploy continues.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dA56RruEaSuQZkNCzxgc9w.png" /><figcaption>Selected the “edit” to add an action group between “Source” and “Deploy”</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hZszh6aFUyCKd8eij7QQ9Q.png" /><figcaption>Inside the “approval stage” I clicked on “add action group” and filled out the necessary information in the screenshot below</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6ynAvslsEFiiqPEmSn1FOA.png" /><figcaption>***To get approved emails, I would have needed an SNS Topic, however, I chose to proceed without it for now and approve directly from the console</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5SGIE0rB8w8-caI38x0O1g.png" /><figcaption>Saved Manual Approval successfully</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ALveyun9aNDtsJiCEwL1sw.png" /><figcaption>Selected the “Executions”tab to process manual approval</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*t9KlXRAy7GzeG8of11f5GA.png" /><figcaption>Selected the Approval step to proceed to the following screenshot</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KnPEyur33l6-aFuMAcNfAA.png" /><figcaption>Manual Approval</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v0TeLZRFw61JUJHg2nXm7Q.png" /><figcaption>Approval complete</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3Re1oDYEx53dD16YZHpczg.png" /><figcaption>Updated and Approved static website</figcaption></figure><h3>🌐 Here is the link to the README.md content Part 2 for the Advanced portion completion: <a href="https://github.com/tatiLogg/cloud-resume-static-site/blob/main/PART2_COMPLEX.md">https://github.com/tatiLogg/cloud-resume-static-site/blob/main/PART2_COMPLEX.md</a></h3><h3>Final Recap</h3><p>I created a CI/CD pipeline using GitHub + AWS<br>I added manual approval with AWS CodePipeline<br>I deployed a static website to S3<br>I documented every step in README.md<br>I created a <strong>Part 2</strong> file for my complex phase<br>I uploaded and linked a live screenshot</p><h3>COMPLEX PHASE: What I’m Building</h3><p>In this final phase of my CI/CD project, I focused on implementing real-world production practices using AWS CodePipeline, S3, and CloudFront to create a secure and automated static website deployment process.</p><ol><li><strong>Component</strong> : <strong>CloudFront</strong></li></ol><p><strong>Purpose</strong> : Global CDN to boost site speed &amp; reliability</p><p><strong>2. Component</strong> : <strong>OAI or OAC</strong></p><p><strong>Purpose</strong> : Secure S3 so only CloudFront can access it</p><p><strong>3. Component</strong> : <strong>HTTPS</strong></p><p><strong>Purpose</strong> : Secure traffic using SSL</p><p><strong>4. Component</strong> : <strong>Automatic cache busting</strong></p><p><strong>Purpose</strong> : Show updates immediately (optional next step)</p><h3>Production-Ready Enhancements</h3><p>Here’s what I added in this stage:</p><ul><li>Created an Origin Access Control (OAC) to restrict direct access to the S3 bucket and allow only CloudFront to serve content</li><li>Disabled public access to the S3 bucket for enhanced security</li><li>Updated the S3 bucket policy to grant permissions specifically to the CloudFront distribution</li><li>Implemented a manual approval stage in CodePipeline for added control before deploying to production</li><li>Successfully verified the site deployment through the CloudFront URL</li></ul><h3><strong>STEP 1</strong>: Launched CloudFront Distribution</h3><p>I configured the distribution settings after selecting my S3 static website URL, NOT the regular S3 bucket.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*n2b_wPZV2xCQW48shha06A.png" /><figcaption>Selected my S3 static website URL</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uLI5J7UtfpFuKVtgjAXybA.png" /><figcaption>Completion of the Default Cache Behavior section</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nCEaxZ1QyP02LA8iFXtmVA.png" /><figcaption>Completion of the Settings section</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1kp3AvEl6OIu_NM7UY1fXA.png" /><figcaption>Selected “Do not enable security protections” for the WAF info</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fMNynyd-veclmXElAzNhXQ.png" /><figcaption>Distribution created along with the Domain Name</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RurQDGlGWT4GVc0BeBy8Qw.png" /><figcaption>Here’s how it looks after the successful deploy and manual approval: My static site is now being served through CloudFront with Origin Access Control (OAC).</figcaption></figure><h3>🌐 Live Demo</h3><p>Visit the final version of the deployed site here:<br>🔗 <a href="https://d1zllftq6xl906.cloudfront.net/"><strong>https://d1zllftq6xl906.cloudfront.net</strong></a></p><h3>What Just Happened</h3><ul><li>Created an S3 bucket with a static site</li><li>Locked it down (no public access)</li><li>Used Origin Access Control (OAC) to authorize CloudFront</li><li>Updated the bucket policy manually with the correct SourceArn</li><li>Got the CloudFront distribution live and secured</li><li>Published an update that’s automatically deployed</li></ul><h3>💡 What I Learned</h3><ul><li>OAC provides a clean and secure way to serve S3-hosted websites via CloudFront</li><li>Manual approvals are a simple but effective guardrail for production deployments</li><li>Troubleshooting “Access Denied” taught me how important bucket policy updates are when switching from public access to private CloudFront delivery</li></ul><p>🧠 <strong>Reflection</strong>:<br>Each phase of this project has sharpened my understanding of cloud security, automation, and the power of DevOps. I’m excited to keep building!</p><h3>🌐 Here is the link to the README.md content Part 3 for the Complex portion completion:<a href="https://github.com/tatiLogg/cloud-resume-static-site/blob/main/PART3_COMPLEX.md">https://github.com/tatiLogg/cloud-resume-static-site/blob/main/PART3_COMPLEX.md</a></h3><p>#AWS #DevOps #CloudComputing #WomenInTech #CICD #CloudEngineer #LevelUp</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6e6357ad3152" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Secure AWS DynamoDB Media Catalog with CloudFormation]]></title>
            <link>https://medium.com/@tati.fluffy/building-a-secure-aws-dynamodb-media-catalog-with-cloudformation-0d9edbadebcd?source=rss-76c4f961f214------2</link>
            <guid isPermaLink="false">https://medium.com/p/0d9edbadebcd</guid>
            <dc:creator><![CDATA[Selina Loggins]]></dc:creator>
            <pubDate>Sat, 29 Mar 2025 22:51:10 GMT</pubDate>
            <atom:updated>2025-03-29T22:58:26.470Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gRXJB1hGtmpjIjvZ4TmvSQ.png" /></figure><h3>What I Built</h3><p>In this project, I created a secure, read-only DynamoDB-based media catalog for Let’s Go! Media Inc. using AWS services and Infrastructure as Code (IaC) via CloudFormation. This hands-on deployment is part of my cloud engineering journey and taught me how to think like a DevOps engineer by combining automation, security, and scalability.</p><p>The infrastructure included:</p><ul><li>A <strong>DynamoDB table</strong> to store movie metadata</li><li>A <strong>t2.micro EC2 instance</strong> for scanning data</li><li>An <strong>IAM Role + Instance Profile</strong> for secure role-based access</li><li>A <strong>Security Group</strong> restricted to my IP for SSH</li><li>A full <strong>CloudFormation YAML template</strong> to automate provisioning</li></ul><h3>Why This Matters</h3><p>This project helped me understand real-world concepts:</p><ul><li><strong>Least Privilege IAM</strong>: EC2 was only allowed to read, not write</li><li><strong>Secure Access Without Credentials</strong>: No access keys were stored</li><li><strong>CloudFormation</strong>: I automated deployment and made it reproducible</li><li><strong>Troubleshooting</strong>: Learned how to track down permission and dependency issues</li></ul><h3>Challenges I Faced (and Solved)</h3><ol><li><strong>Stack Rollbacks</strong>: Table, IAM Role, and Security Group already existed from earlier steps.</li></ol><p><strong>What I Did To Fix It:</strong> Renamed all resources in the YAML file to use unique names (e.g., MediaCatalogCFN).</p><p><strong>2. IAM Instance Profile Timing</strong>: EC2 instance tried to launch before the role was ready.</p><p><strong>What I Did To Fix It: </strong>Added <strong>Dependson:MediaCatalogInstanceProfile</strong> to fix the deployment order.</p><p><strong>3. SSH Timeout:</strong> Forgot to associate a public IP and open port 22.</p><p><strong>What I Did To Fix It: </strong>Corrected the Security Group + ensured Elastic IP was allocated and attached.</p><p><strong>4. Access Denied Errors:</strong> Tried to run AWS CLI with insufficient permissions.</p><p><strong>What I Did To Fix It: </strong>Verified IAM policies, used proper role assumptions, and tested read/write access correctly</p><h3>FOUNDATIONAL SECTION</h3><h3>Step 1: Creating the DynamoDB Table</h3><h3>What I Did:</h3><p>I created a DynamoDB table named &quot;MediaCatalog&quot; using the AWS CLI. This table would store metadata for 10 movie titles, including title, genre, release date, and rating.</p><h3>Why I Did It:</h3><p>Let’s Go! Media Inc. needed a fast, scalable, serverless NoSQL database to manage their media content catalog.</p><h3>How I designed the table?</h3><p>aws dynamodb create-table \<br> — table-name MediaCatalog \<br> — attribute-definitions AttributeName=Title,AttributeType=S \<br> — key-schema AttributeName=Title,KeyType=HASH \<br> — billing-mode PAY_PER_REQUEST</p><p>This created a pay-as-you-go table with: “Title” as the partition key. I didn’t need to worry about capacity settings because of the on-demand billing mode.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6rsOC7CIVGT_4SzaIp_atQ.png" /><figcaption>Table active to store information</figcaption></figure><h3>Step 2: Populating the Table with 10 Movies</h3><h3>What I Did:</h3><p>I added 10 movies into the “MediaCatalog” table using multiple “put-item” commands.</p><h3>Why I Did It:</h3><p>To simulate realistic media data that Let’s Go! Media Inc. would actually use to analyze their content portfolio.</p><h3>How I Did It:</h3><p>For each movie, I ran a command like this:</p><p>aws dynamodb put-item \<br> — table-name MediaCatalog \<br> — item ‘{<br> “Title”: {“S”: “<strong>Deploy Another Day</strong>”},<br> “Genre”: {“S”: “Action”},<br> “ReleaseDate”: {“S”: “2023–11–01”},<br> “Rating”: {“S”: “PG-13”}<br> }’</p><p>I repeated that with unique titles like:</p><h4>🎥 <strong>Secrets of the S3 Vault</strong>; <strong>Lambda: No Time to Wait</strong>; <strong>Cloudwatch Chronicles</strong>; <strong>The Route 53</strong> ; <strong>Identity in the Shadows</strong>; <strong>Into the Subnet</strong>; <strong>Rise of the Instances</strong>; <strong>DynamoDB Drift</strong>; <strong>Elastic Load Balancer: Judgement Day.</strong></h4><h3>Result:</h3><p>All 10 items were successfully inserted via CLI —with no console needed!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kcrbYRZopzuw-a4Zov53hw.png" /><figcaption>Selected JSON view for my text</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*j7P_P-JqlJjtSygaPIOp2A.png" /><figcaption>MediaCatalog Movies Added</figcaption></figure><h3>Step 3: Launching an EC2 Instance (First Attempt)</h3><h3>What I Did:</h3><p>I launched a “t2.micro” EC2 instance using the AWS Console and assigned a security group with SSH access open to my current IP.</p><h3>Why I Did It:</h3><p>To simulate a secure compute environment that Let’s Go! Media Inc. could use to scan their DynamoDB data. This instance would eventually use an IAM role (no access keys!) to read the data.</p><h3>My Key Setup:</h3><ul><li>OS: Amazon Linux 2023</li><li>Security Group: Port 22 open only to my IP</li><li>Key Pair: Created &quot;MediaCatalogKey.pem&quot; for SSH access</li><li>Instance Role: None yet — that will be added in the Advanced Phase</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*umxIRApfEOOwyRmMVxITDA.png" /><figcaption>IAM Role with read-only permissions created</figcaption></figure><h3>Step 4: Setting Up Least Privilege IAM Access</h3><p>This step was set up in the Advanced Phase, but even in the foundational setup, I was already planning to enforce read-only access for the EC2 instance. This aligns with best practices in cloud security — here I learned the importance of always applying the principle of least privilege.</p><h3>Why I am doing it?</h3><p>This step proves that:</p><ul><li>My EC2 instance can read data from DynamoDB</li><li>The IAM role is working correctly (not my IAM keys!)</li><li>I did not run “aws configure” and yet, it works — because of the role</li></ul><h3>Step 5: Testing Access</h3><p>At this stage:</p><ul><li>I could SSH into the EC2 instance using my .pem key</li><li>I had <strong>not</strong> yet assigned a role, so I couldn’t run AWS commands inside the instance (that came later)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*osiVjPUIGQxJy2DggWf8dg.png" /><figcaption>Screenshot of some of the JSON responses with my movie records</figcaption></figure><p>The following screenshot shows the expected result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lf5DRr71eUleE20jNpchoQ.png" /><figcaption>My EC2 instance attempted to perform a write operation (PutItem) and was not granted access</figcaption></figure><h3>What I Learned in the Foundational Phase:</h3><ul><li>How to create and interact with DynamoDB via CLI</li><li>How to structure JSON input for put-item</li><li>How to launch an EC2 instance with correct networking + key pair</li><li>The importance of IAM roles vs. access keys</li><li>How to plan for secure access from the start</li></ul><h3>Results:</h3><p>By the end of the foundational phase, I had:</p><ul><li>A fully working DynamoDB table</li><li>10 custom movie entries related to cloud and AWS</li><li>A running EC2 instance with proper SSH access</li><li>A clear plan to move into secure access, automation, and full infrastructure deployment via CLI</li></ul><h3>Advanced Phase — Leveling Up with the AWS CLI</h3><p>After completing the Foundational Phase, I was ready to step deeper into the AWS ecosystem by automating everything using the AWS CLI — no console, no shortcuts. This phase tested my understanding of IAM roles, instance profiles, security groups, Elastic IPs, and network troubleshooting.</p><p>Let me walk you through how I completed the Advanced Phase, what I learned, and how I handled the inevitable hiccups along the way.</p><h3>Step 1: Created a Read-Only IAM Role for EC2</h3><h3>What I Did:</h3><p>I created an IAM role named EC2_ReadOnly_MediaCatalog_Role with a trust policy that allowed EC2 instances to assume the role. Then I attached the AmazonDynamoDBReadOnlyAccess policy.</p><h3>Why I Did It:</h3><p>The EC2 instance should only be allowed to read from the “MediaCatalog” table. Following the principle of least privilege, I made sure no write or delete permissions were granted.</p><h3>How I Did It:</h3><p>Created the trust policy: nano trust-policy.json</p><p>And json script:</p><p>{<br> “Version”: “2012–10–17”,<br> “Statement”: [<br> {<br> “Effect”: “Allow”,<br> “Principal”: {<br> “Service”: “ec2.amazonaws.com”<br> },<br> “Action”: “sts:AssumeRole”<br> }<br> ]<br>}</p><p>Created the role and attached the policy:</p><p>aws iam create-role \<br> — role-name EC2_ReadOnly_MediaCatalog_Role \<br> — assume-role-policy-document file://trust-policy.json</p><p>aws iam attach-role-policy \<br> — role-name EC2_ReadOnly_MediaCatalog_Role \<br> — policy-arn arn:aws:iam::aws:policy/AmazonDynamoDBReadOnlyAccess</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4OL53EZ7e6632_V7dyhysg.png" /></figure><h3>Step 3: Created a Security Group with SSH Access</h3><h3>What I Did:</h3><p>I created a security group inside my custom VPC and allowed SSH (port 22) from my personal IP.</p><h3>Why I Did It:</h3><p>To securely connect to the EC2 instance using a .pem key, I needed to limit access to just my machine.</p><h3>How I Did It:</h3><p>aws ec2 create-security-group \<br> — group-name MediaCatalogSG \<br> — description “Security group for EC2 with SSH access” \<br> — vpc-id vpc-0a567f081fd058cbc</p><p>aws ec2 authorize-security-group-ingress \<br> — group-id sg-01a88e27fd89678de \<br> — protocol tcp \<br> — port 22 \<br> — cidr 70.115.111.139/32</p><h3>Step 4: Allocated and Associated an Elastic IP</h3><h3>What I Did:</h3><p>I allocated a static Elastic IP and bound it to the instance after launch.</p><h3>Why I Did It:</h3><p>When launching EC2 via CLI, public IPs are not automatically assigned. Associating an Elastic IP ensures a consistent, accessible endpoint for SSH.</p><h3>How I Did It:</h3><p>aws ec2 allocate-address — domain vpc</p><p>aws ec2 associate-address \<br> — instance-id i-01570ca737370203a \<br> — allocation-id eipalloc-07a7e7b9967d4ba99</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HXMjOzJWxhWXr9uy8zh8pg.png" /><figcaption>Created and Attached an IAM role via CLI</figcaption></figure><h3>Step 5: Launch EC2 Instance via CLI with IAM Role Attached</h3><h3>What I Did:</h3><p>I launched a t2.micro instance using Amazon Linux 2023, placed it in the correct subnet, attached the instance profile, and assigned the previously created security group.</p><h3>Why I Did It:</h3><p>This was the final build piece — spinning up a working EC2 instance entirely through CLI with secure permissions and connectivity.</p><h3>How I Did It:</h3><p>aws ec2 run-instances \<br> — image-id ami-071226ecf16aa7d96 \<br> — count 1 \<br> — instance-type t2.micro \<br> — key-name MediaCatalogKey \<br> — security-group-ids sg-01a88e27fd89678de \<br> — iam-instance-profile Name=EC2_ReadOnly_MediaCatalog_Profile \<br> — subnet-id subnet-0551aa94fb966e1fe</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6DLML6pB_u9RIfsZcLvS-g.png" /><figcaption>Instance profile created and EC2 launched</figcaption></figure><h3>Step 6: Validate Read and Block Write</h3><h3>What I Did:</h3><p>Once I SSH’d into the instance, I ran two final tests:</p><ol><li>Scanned the DynamoDB table</li><li>Tried to write a new item (expecting failure)</li></ol><h3>Scan Command:</h3><p>aws dynamodb scan — table-name MediaCatalog</p><p><strong>Result</strong>: I could read all 10 movies.</p><p>Write Command (Expect Denial):</p><p>aws dynamodb put-item \<br> — table-name MediaCatalog \<br> — item ‘{<br> “Title”: {“S”: “Unauthorized Upload”},<br> “Genre”: {“S”: “Drama”},<br> “ReleaseDate”: {“S”: “2025–04–01”},<br> “Rating”: {“S”: “R”}<br> }’</p><h4>❌ Result: I received an AccessDeniedException — exactly what I expected. My IAM permissions were working perfectly.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pHuPiR5vHr0RFkX7Z_vBMA.png" /><figcaption>AccessDeniedException</figcaption></figure><h3>What I Learned in the Advanced Phase:</h3><ul><li>IAM Role creation and trust policies</li><li>Attaching roles via instance profiles</li><li>EC2 security group management</li><li>How VPC networking works (IGW, subnets, CIDR)</li><li>Elastic IPs, private/public IP mapping</li><li>SSH access control</li><li>Using CloudShell to troubleshoot access issues</li></ul><h3>Final Result:</h3><p>A fully functional, secure AWS architecture using only the AWS CLI that:</p><ul><li>Stores movie data in DynamoDB</li><li>Allows only read access from EC2</li><li>Blocks unauthorized writes</li><li>Is scalable and production-ready</li></ul><h3>Complex Phase — Automating Everything with CloudFormation</h3><p>After successfully building out the foundational and advanced layers of the project using only the AWS CLI, I took things one step further by transforming all of it into code. This phase was about leveraging CloudFormation to automate the entire stack — from the DynamoDB table to the EC2 instance and IAM roles — in a reusable, version-controlled template.</p><h3>Objective:</h3><p>Recreate everything I did in the Foundational and Advanced phases — but this time with a single CloudFormation template. This would include:</p><p>DynamoDB table<br>EC2 instance<br>IAM role and instance profile<br>Security group<br>Subnet + VPC (optional if already created)<br>Elastic IP (manually attached post-deployment)</p><h3>Step 1: Defined the CloudFormation Template (YAML)</h3><h3>What I Did:</h3><p>I wrote a “MediaCatalogStack.yaml CloudFormation template to describe the full infrastructure.</p><h3>Why I Did It:</h3><p>This ensures the entire environment can be redeployed consistently, securely, and automatically — which is exactly how modern DevOps teams manage infrastructure.</p><h3>What Was Inside the Template:</h3><ul><li>DynamoDB Table definition for MediaCatalog</li><li>IAM Role with AmazonDynamoDBReadOnlyAccess policy</li><li>Instance Profile to bind the role to EC2</li><li>Security Group to allow SSH from my IP</li><li>EC2 Instance configured with instance profile, security group, and key name</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z5YqGbkG8jbuwwjtutB8Kw.png" /><figcaption>YAML uploaded to CloudShell</figcaption></figure><h3>Step 2: Deployed the CloudFormation Template</h3><h3>What I Did:</h3><p>I deployed the stack using AWS CLI, specifying the YAML file and stack name.</p><h3>Why:</h3><p>This is Infrastructure as Code in action — no clicking, no guessing, fully repeatable deployments.</p><h3>How I Did It:</h3><p>Ran This Command in CloudShell:</p><p>aws cloudformation create-stack \<br> — stack-name MediaCatalogStack \<br> — template-body file://MediaCatalogStack.yaml \<br> — capabilities CAPABILITY_NAMED_IAM</p><h3>What to Expect:</h3><p>I got a StackId in return which was a good indication.</p><p>Then checked the status:</p><p>aws cloudformation describe-stacks \<br> — stack-name MediaCatalogStack \<br> — query “Stacks[0].StackStatus”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W8GOCZ7R-ndIGzekDE3iqQ.png" /><figcaption>CREATE COMPLETE result and stack created successfully</figcaption></figure><h3>Result:</h3><p>CloudFormation spun up my entire environment in minutes — all from a single file.</p><h3>Step 3: SSH Into the EC2 Instance</h3><h3>What I Did:</h3><p>I used my existing .pem key to SSH into the instance created by CloudFormation.</p><p>ssh -i MediaCatalogKey.pem ec2-user@&lt;public-ip&gt;</p><p>💡 <strong>Note:</strong> Since CloudFormation does not automatically assign a public IP or Elastic IP, I used the CLI to manually allocate and associate one to the instance.</p><h3>Step 4: Test the Infrastructure</h3><h3>Scan from EC2:</h3><p>Command: <strong>aws dynamodb scan — table-name MediaCatalog</strong></p><p>This worked — I could now read all the movie data.</p><p>When I tried to Write the result needed to: Expect Denied:</p><p>aws dynamodb put-item \<br> — table-name MediaCatalog \<br> — item ‘{<br> “Title”: {“S”: “CloudFrontier”},<br> “Genre”: {“S”: “Thriller”},<br> “ReleaseDate”: {“S”: “2025–12–01”},<br> “Rating”: {“S”: “R”}<br> }’</p><p>❌ As expected, the write was blocked with an AccessDeniedException.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Fq96qHcdyhneFFGrGVJrAw.png" /><figcaption>Scan succeeded and Write attempt failed</figcaption></figure><h3>What I Learned in the Complex Phase</h3><ul><li>How to convert manual CLI tasks into automated infrastructure-as-code</li><li>The structure of a CloudFormation template and resource types</li><li>The importance of IAM role trust policies and least privilege</li><li>How EC2, IAM, DynamoDB, security groups, and subnets connect</li><li>How to troubleshoot deployment errors using CloudFormation Events and logs</li></ul><h3>Final Result:</h3><p>With a single YAML file, I can now:</p><ul><li>Deploy a secure DynamoDB table</li><li>Launch an EC2 instance with read-only access</li><li>Set up IAM roles and permissions</li><li>Enforce access control</li><li>Automate the entire process in under 5 minutes</li></ul><h3>What I Achieved in the Complex Phase:</h3><p>Infrastructure as Code: I created a full environment — DynamoDB, IAM Role, EC2, Instance Profile, Security Group — all with a single YAML file via CloudFormation.</p><p><strong>Security Best Practices</strong>:</p><ul><li>IAM role followed least privilege</li><li>EC2 instance assumed the role — no access keys needed</li><li>Verified that it can read from DynamoDB but cannot write</li></ul><p><strong>Deployment Automation</strong>: I now have a repeatable, professional workflow I can apply across projects.</p><h3>🎯 Summary: Why This Project Matters</h3><p>This project has helped me deeply understand AWS architecture, CLI, security, and automation. I moved from clicking in the console… to scripting deployments… to building full-scale, reproducible cloud infrastructure as code.</p><p>It taught me to think like a Cloud Engineer, troubleshoot like a DevOps pro, and secure resources like a Cybersecurity specialist — and every bit of it is now part of my toolkit.</p><p>Published it as a <strong>GitHub portfolio project</strong> :</p><p>README : <a href="https://github.com/tatiLogg/media-catalog-dynamodb/tree/main">media-catalog-dynamodb</a></p><p><strong>Thank you for reading!</strong> I’m excited to keep growing in this space. Connect with me or follow along as I learn more about AWS, containers, Kubernetes, and DevOps tooling.</p><p>#CloudEngineer✨</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=0d9edbadebcd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Welcome to Adventure Works!!]]></title>
            <link>https://medium.com/@tati.fluffy/welcome-to-adventure-works-85b0aca866bb?source=rss-76c4f961f214------2</link>
            <guid isPermaLink="false">https://medium.com/p/85b0aca866bb</guid>
            <dc:creator><![CDATA[Selina Loggins]]></dc:creator>
            <pubDate>Sun, 23 Mar 2025 05:26:00 GMT</pubDate>
            <atom:updated>2025-03-25T03:23:11.952Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2w_502GyWrKYNGX_QWsQlA.png" /></figure><ul><li>✅ <strong>Foundational</strong> — Basic cloud infrastructure setup (networking, WordPress on EC2, and MySQL on RDS).</li><li>🚀 <strong>Advanced</strong> — Load balancing, high availability, automation, and improved security.</li><li>🧠 <strong>Complex</strong> — AMI, Auto Scaling Group (ASG), and traffic-based scaling.</li></ul><h3>FOUNDATIONAL SECTION:</h3><h3>🎯 <strong>Goal:</strong> Set up the network architecture (VPC, subnets, Internet Gateway, routing).</h3><p>This is my virtual data center, and the foundation for deploying secure and scalable applications.</p><h3>STEP 1: Created a Custom VPC (Virtual Private Cloud)</h3><h4>→ What I did</h4><p>I created a custom virtual network in AWS. This is where all resources will live (EC2, RDS, etc.).</p><h4>→ How I Did It:</h4><p><strong>Created a VPC</strong></p><ul><li>Name tag: AdventureWorks-VPC</li><li>IPv4 CIDR block: 10.0.0.0/16<br>(This gives us 65,536 IPs – plenty for a small to medium environment.)</li><li>Kept the rest as default and Created VPC</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NFwc4coSzv48p4cKtndkMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ilQhqDeumDcrRSJ8euEipw.png" /></figure><h3>STEP 2: Created 2 Public Subnets and 2 Private Subnets</h3><h3>→ Why I Did This?</h3><ul><li>Public Subnets are for resources that need internet access (like my EC2 web server running WordPress).</li><li>Private subnets are for backend resources that should be hidden from the internet (like MySQL RDS database).</li><li>I am putting them in 2 different Availability Zones for high availability and redundancy.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*15QUooWrq-S84PRL3EJftQ.png" /><figcaption>Here I created the heart of my virtual infrastructure : 4 total subnets — 2 public, 2 private — across 2 different Availability Zones.</figcaption></figure><h3>STEP 3: Created and Attached an Internet Gateway</h3><h3>→ Why I Did This:</h3><p>An Internet Gateway (IGW) acts like the network’s front door to the internet. It’s how my EC2 instance (in a public subnet) will download WordPress files, install software, and let users access my website.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JoiBaANeZYzpjVudd8g_bg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v8PORVuHLQ8X6nOFAgSG9w.png" /><figcaption>Internet Gateway is created and attached.</figcaption></figure><h3>STEP 4: Set Up Route Tables</h3><h3>→ Why I Did This?</h3><p>Route tables control how network traffic flows:</p><ul><li>I followed by creating a Public Route Table that lets my public subnets send/receive internet traffic via the IGW.</li><li>My Private subnets will stay isolated (and use the default local routing for now).</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J6yHJ5e5MU_gx55EME2E-A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EqZcN5bSsaYhrsI5hFJaJg.png" /><figcaption>Shows the Public Route Table is created, and has the 0.0.0.0/0 route pointing to the IGW, and is associated with both public subnets.</figcaption></figure><h4>Now I officially have a functional NETWORK FOUNDATION!!</h4><h3>STEP 5: Launched an EC2 Instance in the Public Subnet (Web Tier)</h3><h3>🎯 Goal:</h3><p>I launched an Ubuntu EC2 Instance in my public subnet, by installing Apache, PHP so that I can then later add, WordPress on it.</p><p>This EC2 will act as the web server for my WordPress-based Adventure Works website.</p><p>YESSS! 🙌 EC2 is alive and kicking!! I’m now ready to connect and start transforming this blank virtual machine into a fully functioning WordPress web server!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-WGKR5VL4O-DwgLX2bW5rA.png" /><figcaption>EC2 is Ready!!!</figcaption></figure><h3>STEP 6: Connect to My EC2 via SSH and Set Up the Web Server (Apache + PHP)</h3><h3>🎯 Goal:</h3><p>Now my goal is to install:</p><ul><li>Apache (web server)</li><li>PHP (scripting language WordPress runs on)</li><li>And required PHP modules</li></ul><p><strong><em>****WordPress is built with PHP and served via Apache. Installing them turns my EC2 into a proper web host that can run dynamic WordPress pages****</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wIPSInN7pt88v8rfvI5-bA.png" /><figcaption>Updated the package list</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CqMK9FbG7zQHw_fogbSpww.png" /><figcaption>Installed Apache, PHP, and required modules</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lft2fXaUded4VqzYJpXyLA.png" /><figcaption>Started and enabled Apache</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LiU1DxoZK5w8MF7gYfM9bw.png" /><figcaption>This Apache Welcome Page means my EC2 is now officially serving web traffic.</figcaption></figure><h3>STEP 7: Downloaded and Set Up WordPress</h3><h3>🎯 Goal:</h3><p>The goal here is to download WordPress, unzip it into my web root, and set proper permissions so Apache can serve it.</p><h3>→ Why I Did This?</h3><p>I am building with WordPress, which is one of the most popular CMS platforms globally. I’ll be:</p><p>→ Downloading the latest WordPress version</p><p>→ Setting permissions</p><p>→ And removing the default Apache placeholder</p><p>WordPress Setup:</p><p>Navigated to the web root: <strong>cd /var/www/html</strong></p><p>Removed the default Apache page: <strong>sudo rm index.html</strong></p><p>Downloaded the latest WordPress ZIP: <strong>sudo curl -O </strong><a href="https://wordpress.org/latest.zip"><strong>https://wordpress.org/latest.zip</strong></a></p><p>Unzipped WordPress: <strong>sudo apt install unzip -y</strong> followed by: <br><strong>sudo unzip latest.zip</strong></p><p>I proceeded to moving WordPress files to web root; removing unnecessary files; setting proper permissions and finally restarting Apache:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SLO0fz-lXF7W10tlU2LZgw.png" /><figcaption>Steps followed towards restarting Apache</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63Icg5XCIY2a5gbBJn9A-A.png" /><figcaption>WordPress installation wizard. This is where the second tier of my two-tier architecture comes in: the database layer.</figcaption></figure><h3>STEP 8: Set Up the MySQL RDS Instance (Database Tier)</h3><h3>🎯 Goal:</h3><p>My goal here is to launch a MySQL database using Amazon RDS (in my private subnet) that WordPress will connect to.</p><h3>→ Why Am I Doing This?</h3><ul><li>I’m separating the web tier (EC2) and the database tier (RDS) for better security, scalability, and performance.</li><li>RDS is managed and AWS handles backups, patching, and availability.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQeFWyTuSL8xjbkqvUaqSg.png" /></figure><p>After “database- 1” showed Available I proceeded to the next steps:</p><ol><li>Copied the RDS Endpoint</li><li>Proceeded to VPC→ Security Groups and:</li></ol><p>→ Edited AdventureWorks-RDS-SG</p><p>→ Added Inbound Rules:</p><ul><li><strong>Type</strong>: MySQL/Aurora (3306)</li><li><strong>Source</strong>: Custom → Select AdventureWorks-WebSG</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*62hiTcoAjbIAjXaJrEEv0w.png" /><figcaption>Here I’m telling AWS: Only the EC2 server I trust should be allowed to connect to this database on port 3306.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uqjTbvwyNTQh-bPp4alWdA.png" /><figcaption>WordPress Database Connection Details</figcaption></figure><h3>💡 Tips Learned In The Process:</h3><ul><li><strong>NOT TO </strong>use localhost for the database host — that’s only when MySQL is running on the same machine. My DB is running on RDS, so I used the endpoint.</li><li>Making sure my EC2 security group is allowed in the RDS security group</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLta5JNTNQsqgBZq4GdiLA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sq_pXulc7q_syzZvJyLirQ.png" /><figcaption>Result after successfully installing WordPress</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E1q_Fjb2f7Dh9rWPAfEopg.png" /><figcaption>After logging in with my admin username &amp; password</figcaption></figure><p><strong>Finally — successfully completed my two-tier WordPress deployment on AWS!!</strong></p><p>→ Created a custom VPC with subnets</p><p>→ Launched an EC2 Instance (web tier)</p><p>→ Installed Apache, PHP, and WordPress</p><p>→ Created and secured an RDS MySQL Instance (database tier)</p><p>→ Connected WordPress to the DB <strong>AND</strong></p><p>→ Launched a live, scalable site!!</p><h3>🔁 ADVANCED PHASE</h3><p><strong>Objective</strong>: Adding High Availability &amp; Scalability using an Application Load Balancer (ALB) and a second EC2 instance.</p><h3>STEP 1: Launched a Second EC2 Instance</h3><p>This instance will be placed in a different Availability Zone than my first, and will also host WordPress.</p><p>Here I duplicated the original EC2 setup.</p><h3>STEP 2: Installed Apache, PHP, and WordPress on EC2 #2</h3><p>Just like I did with the first EC2. I logged into the second instance using the public IP with the following screenshot below being my result:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*s_VqU1HEeZjxIByOjzgQaA.png" /><figcaption>I was able to log into EC2 #2 and Apache is installed and running</figcaption></figure><h3>STEP 3: Installed WordPress on EC2 #2</h3><p>I repeated the steps from EC2 #1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aWcCtf4yejUTGEnd_Y_oKA.png" /><figcaption>Now I can see the WordPress setup screen again</figcaption></figure><p>Now I’ve got 2 live, load-ready WordPress servers in separate AZs!<br>This is serious <strong><em>cloud architect energy</em></strong> right here!!</p><p>Now it’s time for me to glue the web servers together with a smart, scalable entry point: The Application Load Balancer (ALB)</p><h3>STEP 4: Created an Application Load Balancer (ALB)</h3><p><strong>Purpose:</strong></p><ul><li>Distribute traffic between both EC2s</li><li>Automatically adjust when one is down</li><li>Centralizing my site’s entry point</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xwHX30a_r6wbWUt4POrdcg.png" /><figcaption>Registered EC2 Targets after selecting both EC2 Instances</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MrjKv560TMABFdoHVsAXHg.png" /><figcaption>Included as pending</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ySQG-mqK74haDbV13X7p7w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*F_oDX-ryO0aFCK45G-RPdA.png" /><figcaption>In my ALB I copied the DNS name to get the result in the screenshot below</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qfbVOuUm9Vvp9sdwu-4_9w.png" /><figcaption>I can now open the ALB DNS in a browser and see my WordPress setup</figcaption></figure><p>I have now built a highly available, load balanced WordPress architecture like a true cloud pro!!</p><h3>Final Advanced Step: Lock Down EC2 to Only Allow Traffic from the ALB</h3><p>→ <strong>Why?</strong><br>Right now, my EC2&#39;s accept traffic directly from the internet — but now that I have an ALB, I want the EC2s to only accept traffic <em>through</em> the ALB. This improves security and architecture hygiene.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jItzvvTVpHOrmWNZj86xdg.png" /><figcaption>I updated my inbound rules.</figcaption></figure><h3>Tip:</h3><p>Never remove the ability to SSH → in.</p><h3>Now my EC2 instances will:</h3><ul><li>Reject direct web traffic from the internet</li><li>Only respond to requests coming <em>through the ALB</em></li></ul><h4><strong>This completes the Advanced Phase</strong> of your Two-Tier WordPress Architecture Project.</h4><h4>I now have:</h4><ul><li>Multi-AZ EC2</li><li>Apache + WordPress set up</li><li>RDS in a private subnet</li><li>Application Load Balancer (ALB)</li><li>Security rules that follow best practices</li></ul><h3>🔥 Next: Complex Phase</h3><p><strong>Goal:</strong> Automatically scale my web tier up/down based on demand.</p><p>Here I will be:</p><ol><li>Creating an AMI from one of my configured EC2s</li><li>Creating a Launch Template using that AMI</li><li>Deploying an Auto Scaling Group (ASG) across multiple AZs</li><li>Attaching it to my existing ALB</li><li>Testing Auto Scaling functionality</li><li>Adding cost-saving shutdown/deletion steps when done</li></ol><h3>Step 1: Created an AMI from a Configured EC2 Instance</h3><p>→ <strong>Why?</strong><br>An AMI (Amazon Machine Image) is a “snapshot” of my configured EC2 (Apache, PHP, WordPress files, permissions). I’ll use this image to spin up new, identical EC2&#39;s automatically via the Auto Scaling Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BDcO55YZAZ0WpI8es9MAVQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*10GXJBQ9uAejmpenJp5tyA.png" /><figcaption>Waited for AdventureWorks-AMI to show “Available” status before continuing.</figcaption></figure><p>Now I will proceed to build the mechanism that will automatically launch EC2 instances using that AMI whenever needed: the Launch Template.</p><h3>Step 2: Create a Launch Template</h3><p>→ <strong>Why?</strong><br>The Launch Template will tell AWS:</p><ul><li>Which AMI to use (my custom one)</li><li>What instance type to spin up</li><li>What key pair and security group to apply</li><li>Which network settings to use (VPC + subnets)</li></ul><p>This is what the Auto Scaling Group (ASG) will refer to when scaling.</p><p>With my AdventureWorks-LT launch template now live, I’m officially ready to activate the Auto Scaling.</p><p><strong>The final, <em>Complex</em> step:</strong><br>My infrastructure will now automatically scale based on traffic and recover from failures without my intervention.</p><h3>Step 3: Create an Auto Scaling Group (ASG)</h3><p>→ <strong>What it does:</strong></p><ul><li>Automatically launches EC2 instances using my AMI and template</li><li>Distributes them across AZs for high availability</li><li>Connects them to my existing Application Load Balancer</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yroe21wIOnSnIL8SomAU1A.png" /><figcaption><strong>Health Status</strong></figcaption></figure><h3>Wrapping It Up: Scalable WordPress, Mission Complete!</h3><p>After a hands-on journey through foundational setup, scaling strategies, and resilient architecture, I’ve officially deployed a fault-tolerant, auto-healing WordPress application on AWS using the full power of:</p><ul><li><strong>Amazon EC2</strong></li><li><strong>Amazon RDS (MySQL)</strong></li><li><strong>Application Load Balancer (ALB)</strong></li><li><strong>Auto Scaling Group (ASG)</strong></li><li><strong>Launch Templates</strong></li><li><strong>Custom Security Groups</strong></li></ul><p>Each layer of this project was intentional — from isolating storage with RDS to creating a launch template and tying it into an Auto Scaling Group that intelligently handles instance health and distribution.</p><h3>✅ What I Achieved:</h3><ul><li>Built a secure and highly available WordPress site</li><li>Automated EC2 instance provisioning via AMIs and launch templates</li><li>Scaled across Availability Zones with balanced traffic distribution</li><li>Locked down access using strict security group rules</li><li>Verified instance health and lifecycle status within ASG</li></ul><h3>🔐 Final Thoughts:</h3><p>This project not only deepened my understanding of AWS architecture — but also gave me real-world exposure to how enterprise-grade applications are built for high availability, scalability, and maintainability.</p><p>Whether hosting a personal blog or preparing an infrastructure for production workloads, this setup offers the flexibility and resiliency to handle growth and failure gracefully.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=85b0aca866bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>