<?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 Mmesoma Okaro on Medium]]></title>
        <description><![CDATA[Stories by Mmesoma Okaro on Medium]]></description>
        <link>https://medium.com/@kasnoma?source=rss-418bce830f8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*nr5c9UwKrHhcnb2T</url>
            <title>Stories by Mmesoma Okaro on Medium</title>
            <link>https://medium.com/@kasnoma?source=rss-418bce830f8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 12:28:31 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kasnoma/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[Step-by-Step Guide on how to setup AWS Elastic Disaster Recovery Walkthrough]]></title>
            <link>https://medium.com/@kasnoma/step-by-step-guide-on-how-to-setup-aws-elastic-disaster-recovery-walkthrough-7cfbcf93aa69?source=rss-418bce830f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7cfbcf93aa69</guid>
            <category><![CDATA[security]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Mmesoma Okaro]]></dc:creator>
            <pubDate>Thu, 31 Jul 2025 12:14:46 GMT</pubDate>
            <atom:updated>2025-07-31T12:14:46.826Z</atom:updated>
            <content:encoded><![CDATA[<p>Disaster Recovery (DR) is a critical component of any business continuity strategy. AWS Elastic Disaster Recovery (DRS) (formerly CloudEndure Disaster Recovery) enables organizations to quickly recover IT infrastructure and data in case of disasters whether due to on-premises failures, cloud outages, or cybersecurity incidents.</p><p>In this comprehensive guide, I’ll walk you through how I set up AWS Elastic DRS from scratch. I’ll share the key terminologies used, the prerequisites, my step-by-step replication setup process, how I handled my first failover scenario, the failback procedures I’ve refined, and the cleanup strategies that have saved me both time and money.</p><p><strong>KEY TERMINOLOGIES USED IN THIS ARTICLE:</strong></p><p>Before we dive into the setup, I want to help you understand the essential DR terms that I had to master when I first started:</p><ul><li><strong>Source Server</strong>: This is the server you want to make disaster-ready. I install the AWS replication agent on this server to enable seamless replication.</li><li><strong>Replication Server</strong>: AWS EDR automatically launches this server to replicate your data to another subnet called the staging subnet. You don’t need to manage this AWS handles it for you.</li><li><strong>Conversion Server</strong>: During the launch process, AWS automatically spins up this server to handle driver changes, network configurations, and OS licensing for your instance. It helps with the conversion process and terminates automatically once done.</li><li><strong>Recovery Server</strong>: This is a server that contains all the data and configuration from your source server, set up according to the template we configure. In the event of a disaster, this becomes your primary server.</li><li><strong>Failover</strong>: When something happens to your source server, all user traffic gets redirected to the recovery server. I’ve tested this process multiple times to ensure it works smoothly.</li><li><strong>Failback</strong>: Once your source server is back up and running, we redirect traffic back to it from the recovery server. This is how you return to normal operations.</li><li><strong>Replication</strong>: The continuous process of copying data from your source servers (whether on-premises or in AWS) to AWS for DR readiness.</li><li><strong>Recovery Point Objective (RPO)</strong>: This is the maximum data loss you can accept (e.g., 15 minutes, 1 hour). When I implemented AWS Elastic DRS, I was impressed by how it achieves low RPO through continuous replication.</li><li><strong>Recovery Time Objective (RTO)</strong>: The maximum downtime you can tolerate before restoration (e.g., 2 hours). I’ve found that AWS Elastic DRS minimizes RTO with its automated failover capabilities.</li><li><strong>AWS Regions &amp; Availability Zones (AZs)</strong>: I recommend replicating your data to a different AWS Region for geographic redundancy. But for the purpose of this of this setup I used cross availability zones.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ut9PYKl1OItJ3Eyu" /></figure><p><strong>PREREQUISTIES</strong></p><p><strong>Prerequisite 1:</strong></p><p><strong><em>IAM User and Key</em></strong></p><p>Before we begin, I need to walk you through creating a user that will install the AWS replication agent on your source server. you need to assign the AWS Elastic Disaster Recovery Agent Policy to this user. You also need the access key and secret key of the user you created for CLI initialization</p><p><strong>Steps to create an IAM User and Key:<br></strong>Navigate to IAM Service</p><p>Once you’re in IAM, I click on “Users” in the left sidebar, then hit “Create Users.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*t-J_96owsYGM2FUO" /></figure><p>Click on Next and Setup the permissions for it, Click on attach policies directly</p><p>Attach this policy to your user</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*UaWpn4-RrwP3DP-0" /></figure><p>Click on Next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9wndHbSKLWmo1p4_" /></figure><p>After creating the user, click on the user and navigate to security credentials</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1gsfU0kkqoT4MMsv" /></figure><p>Click on create access key and create a new access key for the newly created user. Make sure you download the access key.</p><p><strong>Prerequisite 2<br><em>S3 Bucket</em></strong></p><p>The next thing I always do is create an S3 bucket for storing my primary server configurations from the primary subnet. Make sure to store all the critical configuration files from source server. This includes network settings, application configurations, and any custom setup files that you will need for restoration.</p><p><strong>Steps to create an S3 bucket:</strong></p><p>Navigate to S3 service, click on create S3 bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*K67h6fpIfOvTqf2e" /></figure><p>Give your bucket a unique name. For the purpose of this setup, leave every other configuration as default and click on create.</p><p><strong>Prerequisite 3:</strong></p><p><strong><em>AWS EDR Security Group</em></strong></p><p>Here’s what I do when creating the security group for EDR:</p><p>I created a new security group with the following inbound rules that I’ve found essential for proper replication:</p><ul><li>Port 443 (HTTPS): This allows secure communication between the replication agent and AWS services</li><li>Port 1500: This is crucial for the replication agent communication — without this, your replication simply won’t work</li><li>Port 22 (SSH) or Port 3389 (RDP): Depending on whether you’re using Linux or Windows servers for management access</li></ul><p>For outbound rules, I typically allow all traffic since the replication agent needs to communicate with various AWS services.</p><p><strong>Prerequisite 4:</strong></p><p><strong><em>Source Server</em></strong></p><p>You must have a source server running, this could be a Windows server or an Ubuntu server that’s actively running. In my experience, I’ve worked with both, and the setup process is quite similar regardless of which operating system you choose. The key is that your source server needs to be operational and accessible because we’ll be installing the AWS replication agent directly on it.</p><p><strong>Steps to Setup an EC2 Server</strong></p><p><strong>Navigate to the EC2 Service on your AWS Console</strong></p><p><strong>Click on Launch Instance</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*bVOPb84-AD6Q-GMH" /></figure><p>Follow the configuration to set up your windows EC2 instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ShcrzvbJpTIFVVQ6" /></figure><p><strong>WALKTHROUGH PROPER</strong></p><p>Before we can start using AWS Elastic Disaster Recovery, I need to show you how to initialize the service for your chosen AWS Region. For the purposes of this walkthrough I used eu-west-1 (ireland) region on AWS</p><p><strong>AWS Elastic Disaster Recovery Service</strong></p><p>Navigate to the AWS Elastic Disaster Recovery service on your console</p><p>Look for the “Configure and initialize” button</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*f48zUlPnA1IdH0qD" /></figure><p>Click on configure and initialize, it will lead you to this page that has 6 steps setup for configuring your EDR.</p><p><strong>Set up replication servers.</strong></p><p>Replication Servers are lightweight Amazon EC2 instances that are used to replicate data between source servers and AWS. When I set this up, I had to choose: Instance type, Subnets for the staging server, Availability zone for the staging subnet. I used the t3.small for it.</p><p>Under the staging subnet region. We are trying to achieve a subnet to subnet replication hence select the eu-west-1b subnet. Remember that our Source Server is on eu-west-1a.</p><p>Under the replication server instance type, select your desired instance type or leave it to the recommended settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*smFgJwr9ycSTTvZF" /></figure><p><strong>Specify Volumes and Security Groups</strong></p><p>This step was crucial for me to understand. For each disk on an added source server there is an identically-sized EBS volume attached to a replication server, and each replication server can handle replication of disks from multiple source servers up to 14 source servers.</p><p>Here’s what I configured: EBS Volume Types: I usually choose gp3 for cost-effectiveness and performance. Volume Size: AWS automatically matches the source server disk sizes. Security Groups: I create specific security groups that allow: Port 443 (HTTPS) for secure replication. Port 1500 for the replication agent communication. Any application-specific ports my servers need.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*v1UtN9yf0Ewbq-4l" /></figure><p>If you want to fulfil compliance, choose this:<br>Use private IP for data replication (VPN, DirectConnect, VPC peering) so replication can happen over the private network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*q7i-zRe009QkWeDa" /></figure><p>Click on Next</p><p><strong>Configure Additional Replication Settings</strong></p><p>This session covers the bandwidth throttling, Point-in-time snapshots, data routing, resource tagging. I configured how often recovery points are created as well as set up my retention policy. I put 7 days there.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ARJ7_k0ODdP011ym" /></figure><p>Click on Next</p><p><strong>Set Default DRS Launch Settings</strong></p><p>This is where I define how my recovery instances will behave during an actual disaster: Instance Types (I can choose different instance sizes for recovery sometimes smaller to save costs), Target Subnet (Where recovered instances will launch), Security Groups (What security groups the recovered instances will use), IAM Roles (What permissions the recovered instances need ie EC2-SSM role). Licensing (if your server is a windows server that requires certain licenses).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WmcD2ooP3wT0-Xrl" /></figure><p>Click on Next.</p><p><strong>Set Default EC2 Launch Template</strong></p><p>I create launch templates that define: AMI Settings (Which operating system images to use). User Data Scripts (Any startup scripts needed for recovery instances). Network Interfaces: How the network should be configured). Storage Configuration (EBS volume settings for recovered instances). For the purpose of this demo , I will leave everything as default. Not to worry, you can still modify the template after setup.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Z6THIYd3VtBu8Ffm" /></figure><p>Click on next</p><p><strong>Review and Initialize</strong></p><p>The final step involves reviewing all my configurations. Always double-check</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pzEttRbl9Pn1xZSK" /></figure><p>Once I click “Initialize,” AWS sets up the entire disaster recovery infrastructure in my chosen region. Default launch settings and Default replication settings are initially configured while Initializing the AWS Elastic Disaster Recovery Service.</p><p>Confirm it has been created successfully</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*jEPtno_u53bAypog" /></figure><p>EC2 Agent Installation</p><p>Navigate to your EC2 console</p><p><strong>Connect to Your Source Server</strong> Next, so I use AWS Systems Manager Session Manager to connect to the server — this is my preferred method because it’s secure and doesn’t require opening RDP ports.</p><p>When I click on my Windows server instance, I select “Connect” and then choose “Session Manager” from the connection options. This gives me a secure shell session directly to my server without needing to worry about VPNs or bastion hosts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dlJX3WUWRWJcNw_Y" /></figure><p>Navigate to the <strong>Downloads directory</strong> inside the server</p><p>Run these commands</p><pre>Invoke-WebRequest -Uri &quot;https://aws-elastic-disaster-recovery-eu-west-1.s3.eu-west-1.amazonaws.com/latest/windows/AwsReplicationWindowsInstaller.exe&quot; -OutFile &quot;AwsReplicationWindowsInstaller.exe&quot;</pre><pre>.\AwsReplicationWindowsInstaller.exe</pre><p>It will prompt you to enter the region secret key and access key that you once created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NJ5Kja1dyKP0QTZ4" /></figure><p>Wait till when you see this on your CLI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*hkECEPfk__KwvgGl" /></figure><p>Navigate back to the AWS EDR Service console and refresh, you will see your source server in the initializing state</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gUfzrQkVtR8ulSc3" /></figure><p>Wait for it to be done before continuing.</p><p>Still on AWS EDR, Click on source server and monitor your data replication progress</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QmVoxXRZwoi_qOqd" /></figure><p>When it’s done, navigate to the EC2 Console to confirm that AWS EDR service has created a replication server for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gj1Cj0qWLIuS_kMs" /></figure><p>Compare the two subnets of the source and replication server</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*dymHSKYMhp2AXQzF" /></figure><p>Notice they are in eu-west-1a and eu-west-1b respectively as we specified in our launch settings</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ANXz1zi0_jqFRDRU" /></figure><p>Navigate to the AWS EDR</p><p>Confirm your replication is completed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*z7JLOqPOcOXtmIwO" /></figure><p><strong>Monitoring Your Recovery Instance Status</strong></p><p>At this point, you’ll notice something important that I want to highlight — when I check the recovery instance session, there’s nothing there yet. Don’t worry, this is completely normal! This happens because I haven’t initiated a recovery job at this stage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wt1tHJWVFJleneWS" /></figure><p>Once you see that green ready indicator, you’ll know that your disaster recovery setup is ready and your data is being continuously replicated to AWS. That’s when the real magic happens!</p><p><strong>Recovery/ Failover</strong></p><p>Click on the source server instance on the AWS EDR Console and click on initiate recovery job and select initiate recovery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oz4Jgyjr1WWjFgD3" /></figure><p>It will lead you to the next page where you will select the point in time snapshot you want to use.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OxlWa3A8mAvdoABs" /></figure><p>Select the one you want to use for replication and click on initiate recovery.</p><p>Go to your recovery job history and confirm that job has started</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1OOVP1LyvVnT2Pz3" /></figure><p>Go to EC2 Console and notice that AWS EDR has created a conversion server for you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*w6gttlUlU3TbdGta" /></figure><p>Go to source networks and if you notice this, that means you didn’t create the s3 from the prerequisite step</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SqKiQ2IC_4nmhBqo" /></figure><p>Kindly create an S3 bucket.</p><p>After that go back to the source networks, select the network and click on start replication.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_KP5-0Nm5LGjmTRJ" /></figure><p>Monitor the progress of your recovery job on the recovery job history.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*aPEpFwuQ2FKqdx0K" /></figure><p>Navigate to the EC2 and noticed that AWS EDR created an instance with similar specs as the source server using the launch template and settings you provided.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*XfJsabcP1Mde9t8t" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8X8bjmUiJSwT5-UD" /></figure><p>Check the Recovery Instance used for Failback on AWS EDR console and you will see the instance already created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wMA4UXoowcUh4H5p" /></figure><p>.</p><p><strong>Failback Process (Optional)</strong></p><p>Now, if you want to perform a failback — meaning you want to redirect your user traffic back from the recovery site to your original source site after the disaster is resolved — here’s what I would typically do:</p><p>I would install the</p><pre>AwsReplicationWindowsInstaller.exe</pre><p>on my recovery server to set up the replication agents for the reverse direction. Then I’d perform the handshake process to establish the connection and continue with the failback procedure.</p><p>This essentially reverses the replication flow, allowing me to sync any changes that happened during the disaster back to my original source server, and then switch traffic back to the primary site.</p><p><strong>However, for the purpose of this demonstration, I won’t be walking through the complete failback procedure.</strong></p><p><strong>CleanUp</strong></p><p>Now that we’ve completed our disaster recovery setup and testing, I always make sure to clean up the resources to avoid unnecessary charges.</p><p><strong><em>Stop All Replications</em></strong><em>: </em>First and most importantly, I stop all active replications. This is crucial because replication processes continue running in the background and will keep generating costs. I go to the AWS EDR console and stop replication for each source server I had configured.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ApZ8Ur4nFGxnuSkG" /></figure><p><strong><em>Disconnect and Delete Source Servers</em></strong><em>: </em>First, I go to both my Source Servers and Recovery Instances in the AWS EDR console. I click on each server and select “Disconnect from AWS” then I click “Delete” this will remove all the created disaster recovery resources associated with these servers.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*X7MimZYoXi0oF83p" /></figure><p><strong><em>Clean Up EC2 Resources</em></strong><em>: </em>Next, I head over to the EC2 Console to make sure I’ve removed all related resources. I delete any remaining EC2 instances that were created during the process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*C_ISL4RjBayO5Ftt" /></figure><p>That wraps up our AWS Elastic Disaster Recovery guide!!!!</p><p>Checkout my post on <a href="https://kasnoma.hashnode.dev/step-by-step-guide-on-how-to-setup-aws-elastic-disaster-recovery-service">my hashnode blog</a></p><p>Let’s connect <a href="https://www.linkedin.com/in/mmesoma-okaro">LinkedIn</a> | <a href="https://kasnoma.hashnode.dev/">Hashnode</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7cfbcf93aa69" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building a Data Lake with AWS]]></title>
            <link>https://medium.com/@kasnoma/building-a-data-lake-with-aws-93158d12a751?source=rss-418bce830f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/93158d12a751</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Mmesoma Okaro]]></dc:creator>
            <pubDate>Mon, 20 Jan 2025 11:48:04 GMT</pubDate>
            <atom:updated>2025-01-21T11:42:50.829Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Peepz,</p><p>It officially the Day 3 of the <a href="https://www.linkedin.com/feed/hashtag/?keywords=devopsallstarschallenge&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7284591692521836544">#DevOpsAllStarsChallenge</a> .</p><p><a href="https://www.linkedin.com/feed/hashtag/?keywords=devopsallstarschallenge&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7283233652233170944">#DevOpsAllStarsChallenge</a> is a challenge that aims to equip DevOps engineers with on demand skills required of them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*tlBLswrdsKsIH2h4QCQ6fQ.png" /><figcaption>Project Architecture Diagram</figcaption></figure><h3><strong>Project Overview</strong></h3><p>A data lake is a centralized storage system for large amounts of data, including structured, semi-structured, and unstructured data. Data lakes are used to store data in its original format, and can be used for analytics, machine learning, and other business intelligence.</p><p>In this post I will work you through how to levearge AWS services like AWS Glue and Amazon Athena to run and query the data stored on S3 bucket and also send the processed to S3 bucket</p><h3><strong>Project Structure</strong></h3><p>nba-data-lake/<br>├── policies/<br>│ ├── iam-role.json <br>├── src/<br>│ ├── setup_nba_data_lake.py <br>├── .env<br>├── .gitignore<br>├── cleanup.py<br>├── README.md<br>└── requirements.txt</p><p><strong>Prerequisites</strong></p><p>Before you begin make sure you have these:</p><h3>Prerequisites</h3><p><strong>1. Sportsdata.io Account</strong></p><p>Sign up for a <a href="https://sportsdata.io/">SportsData</a> account and acquire your <strong>NBA API Key</strong> by following their onboarding instructions.</p><p><strong>2. AWS Account</strong></p><p>Set up your AWS account:</p><ul><li>Create a free-tier AWS account <a href="https://signin.aws.amazon.com/signup?request_type=register">here</a>.</li><li>Log in to the AWS Management Console.</li><li>Create a unique IAM user with programmatic access.</li><li>Generate an <strong>Access Key</strong> and <strong>Secret Key</strong> for authentication.</li><li>Initialize the AWS CLI</li></ul><pre>aws configure</pre><p><strong>3. Python Environment</strong></p><p>Ensure Python version <strong>3.7 or higher</strong> is installed:</p><pre>python3 --version<br>pip --version<br>pip install -r requirements.txt</pre><p>If not , download it from the <a href="https://www.python.org/downloads/">official website</a>.</p><p><strong>4. Environment Variables</strong></p><p>Configure the .env file with the following values:</p><pre>AWS_BUCKET_NAME=your_bucket_name<br>SPORTS_DATA_API_KEY=your_api_key<br>NBA_ENDPOINT=https://api.sportsdata.io/v3/nba/scores/json/Players<br>AWS_REGION=your_region</pre><h3><strong>Walkthrough</strong></h3><p>Clone the repository:</p><pre>git clone https://github.com/Kasnoma/NBA-Data-Lake.git<br>cd nba-data-lake</pre><p>Run this command to execute the script:</p><pre>python3 src/setup_nba_data_lake.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*miXQ1T5YCPYIVctskgRNUA.png" /></figure><p>Verify that the resources have been created in your AWS management console:</p><ul><li>S3 Bucket: Confirm the creation of a bucket containing the <strong>raw NBA data</strong> in JSON format under the folder raw-data/nba_player_data.json.</li><li>Glue Database and Table: Ensure the database (glue_nba_data_lake) and table (nba_players) exist in AWS Glue.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-x0a8DkDdlj5mmHYxaGmJA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K9FaIRMROuYBP8X1ctdA5g.png" /></figure><p>Query Data in Amazon Athena:</p><p>Navigate to <strong>Amazon Athena</strong> in the AWS Management Console, and run the following SQL query:</p><pre>SELECT FirstName, LastName, Position, Team<br>FROM nba_players<br>WHERE Position = &#39;PG&#39;;</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ec0OEK7bI2RK0kgvD91C8A.png" /></figure><p><strong>Conclusion</strong></p><p>Transform raw sports data into actionable insights with just a few steps. Feel free to experiment with additional queries and integrate the data lake with advanced analytics tools such as Amazon QuickSight for visualizations.</p><p>Checkout my post on <a href="https://kasnoma.hashnode.dev/building-a-data-lake-with-aws">my hashnode blog</a></p><p>Let’s connect <a href="https://www.linkedin.com/in/mmesoma-okaro">LinkedIn</a> | <a href="https://kasnoma.hashnode.dev/">Hashnode</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=93158d12a751" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Real-Time NBA Game Day Notification System Setup with Event-Driven Architecture]]></title>
            <link>https://medium.com/@kasnoma/hi-peepz-2ff2a0167957?source=rss-418bce830f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ff2a0167957</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-eventbridge]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <dc:creator><![CDATA[Mmesoma Okaro]]></dc:creator>
            <pubDate>Tue, 14 Jan 2025 16:19:51 GMT</pubDate>
            <atom:updated>2025-01-16T09:12:27.714Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Peepz,</p><p>I joined a challenge this new year; <a href="https://www.linkedin.com/feed/hashtag/?keywords=devopsallstarschallenge&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7283233652233170944">#DevOpsAllStarsChallenge</a></p><h4>Brief Overview</h4><p>This project is the Day 1 project of the challenge. <a href="https://www.linkedin.com/feed/hashtag/?keywords=devopsallstarschallenge&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7283233652233170944">#DevOpsAllStarsChallenge</a> is a challenge that aims to equip devops engineers with on demand skills required of them.</p><h4><strong>Project Description</strong></h4><figure><img alt="Architecture Diagram of this Notification Solution" src="https://cdn-images-1.medium.com/max/648/1*HdKBUTowLbe0sKaFpIEo-Q.jpeg" /></figure><p>As sports enthusiasts like me 😌, staying updated with game schedules and scores can be crucial, especially for planning your day around the big games. You can guess the sport I was obsessed with I will answer at the end of the post.</p><p>In this post, we’ll explore how to build an automated <strong>Game Day Notification Solution</strong> using <strong>AWS Serverless Services</strong> like <strong>Amazon EventBridge</strong>, <strong>AWS Lambda</strong>, and <strong>Amazon SNS</strong>. By integrating with an external <strong>NBA API</strong>, this system delivers timely notifications about game schedules, scores, and more, directly to subscribers via email or SMS.</p><p><strong>Project Structure</strong></p><p>game-day-notifications/<br> ├── src/<br> │ ├── game-day-notifications.py<br> ├── iam policies/<br> │ ├── sns_policy.json <br> ├── .gitignore<br> └── README.md</p><p><strong>Features</strong></p><ol><li><strong>Amazon EventBridge:</strong> Automates the triggering of the workflow with rules configured for specific times (e.g., daily or live updates). Reduces manual intervention, ensuring the system operates seamlessly.</li><li><strong>AWS Lambda: </strong>Processes game data fetched from the API and formats it for distribution. Handles logic for categorizing games (e.g., Scheduled, In Progress, Final) and crafting messages.</li><li><strong>Amazon SNS: </strong>Publishes notifications to all subscribed users. Supports multiple communication channels (email, SMS).</li><li><strong>NBA API </strong>:External source for game data, including schedules, live scores, and results. Enables real-time updates, keeping users informed.</li></ol><p>Let’s dive in…</p><p><strong>Prerequisites</strong></p><p>Before you commence this project, you must have the following:</p><p><strong>1. Sportdata.io account</strong>:</p><p>Create a free tier account on <a href="https://sportsdata.io/">SportsData</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*au3argOwgVgQqlVlFvqpTw.png" /></figure><p>Follow the steps to get your NBA API Key.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_oBg_FRTI02LkYkNTFmtqA.png" /></figure><p><strong>2. AWS Credentials:</strong></p><p>If you don’t already have an AWS account you can create a free tier account using this <a href="https://signin.aws.amazon.com/signup?request_type=register">link</a>.</p><p><strong>Project Walkthrough</strong></p><p><strong>SNS</strong></p><p>Creating an SNS Topic</p><p>1. Navigate to SNS on your AWS Management Console.</p><p>2. Click on create topic and select the standard as the topic type.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4-IigmU3zV3u6NvvqbVdeQ.png" /></figure><p>3. Give your topic a unique name copy your SNS ARN (you will need it later) and click create topic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fkU9OzfHuhtAjHghf-4g-w.png" /></figure><p><strong><em>Adding subscribers to the SNS Topics</em></strong></p><p>1. Click the topic you previously created.</p><p>2. Navigate to the subscriptions tab and create subscription.</p><p>3. Set protocol to email and input the email address you want to receive notifications.</p><p>4. Click create subscription.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HQlin9A2hjcaU5TOJgY-ug.png" /></figure><p>5. Go to your email and confirm your subscription.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ptc38HLO310jY9DBrX7zPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*vpmWv9HCAKVqTiOooqH1UA.png" /></figure><p><strong>**IAM**</strong></p><p><em>You will need to create an IAM Role for Lambda and policy for both the SNS.</em></p><p><strong><em>SNS Policy</em></strong></p><p>1. Navigate to IAM on your AWS Management Console.</p><p>2. Click on Policy→ Create Policy</p><p>3. Select Lambda as the AWS service.</p><p>4. Click JSON and paste the JSON policy from sns_policy.json file from the <a href="https://github.com/Kasnoma/game-day-notification-solution.git">githib repo</a></p><p>5. Replace REGION and ACCOUNT_ID with your AWS region and account ID.</p><p>6. Click Next: Review.</p><p>7. Enter a unique name for the policy (e.g., gameday_sns_policy).</p><p>8. Review and click Create Policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*euXbRfAh8Vu9_MswApOX9Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7rrNA60BfU5hCJPI50cR8g.png" /></figure><p><strong><em>Lambda Role</em></strong></p><p>1. Open the IAM service in the AWS Management Console.</p><p>2. Click Roles → Create Role.</p><p>3. Select Lambda as the AWS service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YSDgF1862Qz0VpscyxyAJA.png" /></figure><p>4. Attach the LambdaBasicExecutionRole and the gameday_sns_policy you previously created.</p><p>5. Enter a unique name for the policy (e.g., gameday_lambda_role).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JBDGss1fsl6M_WXojPoQwg.png" /></figure><p><strong>Lambda Function</strong></p><p><em>To create a lambda function;</em></p><p>1. Navigate to Lambda Service on your AWS Management Console.</p><p>2. Click create function.</p><p>3. Select Author from scratch</p><p>4. Give your function a unique name (game-day-notifications) and select the Python 3.x from the dropdown as the runtiime.</p><p>5. Assign the IAM role you previously created to the function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rL5lwoX1ICaZz-_jnjMNZQ.png" /></figure><p>6. Under the Function Code section:</p><p>a.Copy the content of the src/game-day-notifications.py file from the repository.</p><p>b. Paste it into the inline code editor.</p><p>7. Under the Environment Variables section, add the following:</p><p>a. NBA_API_KEY: your NBA API key.</p><p>b. SNS_TOPIC_ARN: the ARN of the SNS topic created earlier.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HcJLGhSKDeqHsAInREATYw.png" /></figure><p>8. Click Create Function</p><p><strong>**EventBridge**</strong></p><p><em>*To setup eventbridge schedule to trigger lambda;*</em></p><p>1. Navigate to EventBridge on your AWS Management Console.</p><p>2. Click Rules → Create Rules.</p><p>3. Select Event Source: Schedule.</p><p>4. Set the cron schedule for when you want updates (e.g., hourly).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MDPhXG0n5kUby1kMPijYbw.png" /></figure><p>5. Under Targets, select the Lambda function (game-day-notifications) and save the rule.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tvbw-8vzixAiolzX8z8NdQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YkOXiVIDAuGQRZWVvbYMyA.png" /></figure><p><strong>**Test**</strong></p><p>1. Open the Lambda function in the AWS Management Console.</p><p>2. Create a test event to simulate execution.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CuysP4B4sqaucA_ZB9stqg.png" /></figure><p>3. Run the function and check CloudWatch Logs for errors.</p><p>4. Verify you received a mail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EY7x5FsUeN5i_mStXvuKOw.png" /></figure><p>Viola!!!</p><p>Oh for the people curious about the sport I was obsessed with, it’s English football.</p><p>Checkout my post on <a href="https://kasnoma.hashnode.dev/">my hashnode blog</a></p><p>Let’s connect <a href="https://www.linkedin.com/in/mmesoma-okaro">LinkedIn</a> | <a href="https://kasnoma.hashnode.dev/">Hashnode</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ff2a0167957" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to set up a Weather Dashboard Application]]></title>
            <link>https://medium.com/@kasnoma/how-to-set-up-a-weather-dashboard-application-7de15b49c8e4?source=rss-418bce830f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/7de15b49c8e4</guid>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Mmesoma Okaro]]></dc:creator>
            <pubDate>Sun, 12 Jan 2025 09:26:34 GMT</pubDate>
            <atom:updated>2025-01-12T09:26:34.851Z</atom:updated>
            <content:encoded><![CDATA[<p>Hi Peepz,</p><p>I joined a challenge this new year; <a href="https://www.linkedin.com/feed/hashtag/?keywords=devopsallstarschallenge&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7283233652233170944">#DevOpsAllStarsChallenge</a></p><h3>Brief Overview</h3><p>This project is the Day 1 project of the challenge. <a href="https://www.linkedin.com/feed/hashtag/?keywords=devopsallstarschallenge&amp;highlightedUpdateUrns=urn%3Ali%3Aactivity%3A7283233652233170944">#DevOpsAllStarsChallenge</a> is a challenge that aims to equip devops engineers with on demand skills required of them.</p><h3>Project Description</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/681/1*yrII8VxyPseC8T20EGm72w.jpeg" /><figcaption>Simple Architecture Diagram for the project</figcaption></figure><p>Whether you’re planning a picnic or deciding what to wear, a weather dashboard can provide essential insights. In this post, I’ll walk you through the development of a Python-based weather dashboard that integrates the OpenWeather API for data retrieval and AWS S3 for storage.</p><p>The Weather Dashboard is a Python application that fetches weather data for specified cities using the OpenWeather API and stores the data in an AWS S3 bucket. It supports dynamic city input (manually listing the cities you want to check their weather condidtions), ensures proper environment variable handling, and logs errors for easy debugging.</p><p><strong>Project Structure</strong></p><p>weather-dashboard/ <br>├── src/ <br>│ ├── __init__.py <br>│ └── weather_dashboard.py <br>├── tests/<br>├── data/ <br>├── .env <br>├── .gitignore <br>├── requirements.txt <br>└── README.md</p><p><strong>Features</strong></p><ul><li><strong>Dynamic City Input</strong>: Users can input cities dynamically instead of relying on hardcoded lists.</li><li><strong>Weather Data Retrieval</strong>: Real-time data is fetched from the OpenWeather API, including temperature, humidity, and weather conditions.</li><li><strong>AWS Integration</strong>: Weather data is stored in an S3 bucket for centralized access and future analysis.</li><li><strong>Error Logging</strong>: All errors are logged into a file, ensuring easier debugging and monitoring.</li><li><strong>Environment Variables</strong>: Sensitive information like API keys and bucket names are securely managed using a .env file.</li><li><strong>Region-Specific Bucket Handling</strong>: The app supports S3 bucket creation in different AWS regions.</li></ul><p><strong>Tech Stack</strong></p><ul><li><strong>Programming Language</strong>: Python</li><li><strong>Libraries Used</strong>: boto3, requests, python-dotenv</li><li><strong>Cloud Service</strong>: AWS S3 for data storage</li><li><strong>API</strong>: OpenWeather API for fetching weather details</li></ul><p><strong>Prerequisites</strong></p><p>Before running this project, ensure you have the following:</p><p>1. Python</p><p>Version 3.7 or higher is required.</p><p>Confirm you have python and pip installed already by running this command:</p><pre>python3 --version</pre><pre>pip --version</pre><p>If you don’t, follow the installation guide on <a href="https://www.python.org/downloads/"><strong>python official page</strong></a></p><p>2. AWS Credentials</p><p>You’ll need your Access Key, Secret Key, default region, and output format.</p><p>If you don’t already have an AWS account you can create a free tier account using this<strong> </strong><a href="https://signin.aws.amazon.com/signup?request_type=register)"><strong>link</strong></a>.</p><p>After your registration, logon and create a unique user</p><p>Create an access key for this user</p><p>Initialize your AWS Cli using this command:</p><pre>aws configure</pre><p>3. OPENWEATHER API KEY</p><p>Sign up at <a href="https://openweathermap.org/"><strong>OpenWeather</strong></a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*khPapDz8Ntvok77bB11a_w.png" /><figcaption>Signup to Openweather platform</figcaption></figure><p>Navigate to your account icon dropdown to generate an API key from your OpenWeather dashboard.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wOon2nAGqWNDbW08JvjGxQ.png" /><figcaption>Generate your API Key</figcaption></figure><p><strong>Walkthrough</strong></p><p>To run this project on your local machine; clone the repository from here: <a href="https://github.com/Kasnoma/weather-dashboard.git">Github Repo</a></p><p>1. Configure environment variables (.env):</p><pre>echo &quot;OPENWEATHER_API_KEY=your_api_key&quot; &gt;&gt; .env</pre><pre>echo &quot;AWS_BUCKET_NAME=your_bucket_name&quot; &gt;&gt; .env</pre><pre>echo &quot;AWS_REGION=your_preferred_region&quot; &gt;&gt; .env</pre><p>2. In your requirements.txt file, put this:</p><pre>echo &quot;boto3==1.26.137&quot; &gt;&gt; requirements.txt </pre><pre>echo &quot;python-dotenv==1.0.0&quot; &gt;&gt; requirements.txt</pre><pre>echo &quot;requests==2.28.2&quot; &gt;&gt; requirements.txt</pre><p>3. Setup a Virtual Environment</p><pre>python3 -m venv weather_venv<br>source weather_venv/bin/activate  # On macOS/Linux<br>weather_venv\Scripts\activate  # On Windows</pre><p>4. Install your dependencies in the requirements.txt file</p><pre>pip install -r requirements.txt</pre><p>5. Some extracts from the weather_dashboard.py file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*C3gLCVSudAGQKaC0_U9gDQ.png" /></figure><p>Ensure that the variables are loaded properly from the .env file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*92ju7uM7AkZIlRjXUYuAhg.png" /></figure><p>This snippet creates the S3 bucket with in the region you specified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oIlF-Hq2gQSkB83NE04O9g.png" /></figure><p>This fetches weather data from the Openweather API based on the user city input and stores it in the specified S3 bucket.</p><p><strong>Run the weather application</strong></p><p>You can run the application using the command below:</p><pre>python3 src/weather_dashboard.py</pre><p><strong>Sample of Expected Result</strong></p><p>Fetching weather for Abuja…</p><p>Temperature: 93.74°F</p><p>Feels like: 89.13°F</p><p>Humidity: 11%</p><p>Conditions: broken clouds</p><p>Successfully saved data for Abuja to S3.</p><p>Weather data for Abuja saved to S3!</p><p>Checkout my post on <a href="https://kasnoma.hashnode.dev/">my hashnode blog</a></p><p>Let’s connect <a href="https://www.linkedin.com/in/mmesoma-okaro">LinkedIn</a> | <a href="https://kasnoma.hashnode.dev/">Hashnode</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7de15b49c8e4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How To Conduct Cloud Security Audit On Your AWS Cloud Using ScoutSuite]]></title>
            <link>https://medium.com/@kasnoma/how-to-conduct-cloud-security-audit-on-your-aws-cloud-using-scoutsuite-eede211d4dc3?source=rss-418bce830f8------2</link>
            <guid isPermaLink="false">https://medium.com/p/eede211d4dc3</guid>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-security]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws-security]]></category>
            <dc:creator><![CDATA[Mmesoma Okaro]]></dc:creator>
            <pubDate>Sat, 09 Mar 2024 09:16:58 GMT</pubDate>
            <atom:updated>2024-03-09T09:16:58.708Z</atom:updated>
            <content:encoded><![CDATA[<p>Before we begin, let’s briefly outline what ScoutSuite entails and how we can utilize this tool to conduct regular scans.</p><p>ScoutSuite is a security auditing tool, available as an open-source tool, which is designed to evaluate the security posture of cloud environments. It also supports multiple cloud platforms. It uses APIs provided by cloud providers to gather configuration data, identify security gaps, and highlight potential risks.</p><p>ScouteSuite supports the following cloud providers:</p><p>Amazon Web Services</p><p>Microsoft Azure</p><p>Oracle Cloud Infrastructure</p><p>Alibaba Cloud</p><p>This article will outline the process of simplifying our security audit process by leveraging this open-source security auditing tool.</p><p>We will be running this scan on a Ubuntu 20.04 virtual machine.</p><p><strong>Prerequisites:</strong></p><p>It is recommended that you have these tools before the installation of ScoutSuite:</p><ol><li>Python 3.6 or later version</li><li>Create a User on AWS and assign it SecurityAudit and ReadOnlyAccess. Also create a new secret key and access key Download and store in a safe place.</li><li>Configure your AWS CLI: You need to configure your AWS CLI</li></ol><p><em>a.</em> <em>Steps to download and configure AWS CLI on Ubuntu 20.04:</em></p><pre>curl &quot;https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip<br>&quot; -o &quot;awscliv2.zip&quot;<br>unzip awscliv2.zip<br>sudo ./aws/install<br>aws - version</pre><p><em>b.</em> <em>Inside your terminal, run the following command</em></p><pre>aws configure</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HXmpaPVHrKUtRuXnt-v1UQ.png" /></figure><p><strong>Installation:</strong></p><p>To create a virtual environment, activate it, and install ScoutSuite using Python pip, you can follow these steps:</p><pre>virtualenv -p python3 venv<br>source venv/bin/activate<br>pip install scoutsuite<br>scout --help</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ifHPUKr4ZPH5lUbVHnbDbg.png" /></figure><p><strong>Scanning:</strong></p><p>Run this command to run ScoutSuite and scan your AWS</p><pre>scout aws</pre><p>Following the scan, ScoutSuite generates a report resembling this one, providing detailed findings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v9TdSxNQ1h_w6nOI2-KI8A.png" /></figure><p>When you click on each service, the report will open and show you the different categories of the findings. Also, it will recommend remediations for each finding.</p><p>In conclusion, leveraging ScoutSuite for conducting regular security audits on your AWS Cloud can significantly enhance the overall security posture of your infrastructure.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eede211d4dc3" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>