<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Evan</title>
    <description>The latest articles on DEV Community by Evan (@asciikeyboard).</description>
    <link>https://dev.to/asciikeyboard</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2666339%2F39cd7bab-2b19-4a3c-a0f0-164905273eb6.jpeg</url>
      <title>DEV Community: Evan</title>
      <link>https://dev.to/asciikeyboard</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/asciikeyboard"/>
    <language>en</language>
    <item>
      <title>Creating a Datalake in AWS for NBA analytics!</title>
      <dc:creator>Evan</dc:creator>
      <pubDate>Sun, 12 Jan 2025 04:31:39 +0000</pubDate>
      <link>https://dev.to/asciikeyboard/creating-a-datalake-in-aws-for-nba-analytics-1ai4</link>
      <guid>https://dev.to/asciikeyboard/creating-a-datalake-in-aws-for-nba-analytics-1ai4</guid>
      <description>&lt;p&gt;Hey there 👋🏼 thanks for stopping by! Today, I will be teaching you how to automatically spin up an AWS S3 bucket, create a Glue database and fetch NBA data to store in the bucket. From there we will utilize AWS Athena to query the data. Stick around to learn more on AWS S3, Glue, Athena and Python!&lt;/p&gt;

&lt;h2&gt;
  
  
  Purpose
&lt;/h2&gt;

&lt;p&gt;The purpose of this article is to walk you through how to leverage AWS tools and technologies to fetch, store and visualize data. The technologies that will be used in this article include: GitHub, AWS (S3, Athena, Glue) and Python.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://discord.gg/hUe7Gbdk" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=RAkMac2QgjM" rel="noopener noreferrer"&gt;YouTube Video from Alicia&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/asciikeyboard/nba-datalake" rel="noopener noreferrer"&gt;My GitHub Repo&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; (or your favorite text editor)&lt;br&gt;
&lt;a href="https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&amp;amp;all-free-tier.sort-order=asc&amp;amp;awsf.Free%20Tier%20Types=*all&amp;amp;awsf.Free%20Tier%20Categories=*all" rel="noopener noreferrer"&gt;AWS Free Tier Account&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/login" rel="noopener noreferrer"&gt;GitHub Account&lt;/a&gt;&lt;br&gt;
&lt;a href="//sportsdata.io"&gt;SportsData.io&lt;/a&gt; Account and API key&lt;br&gt;
Knowledge of Git, Linux commands, APIs and AWS&lt;/p&gt;
&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

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

&lt;p&gt;1. Clone the repo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```
git clone https://github.com/asciikeyboard/nba-datalake.git
cd nba-datalake
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2. Log into the AWS console and launch CloudShell&lt;/p&gt;

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

&lt;p&gt;3. Create the Python file&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the CLI, type
&lt;code&gt;nano setup_nba_data_lake.py&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Copy and paste the contents from the &lt;strong&gt;setup_nba_data_lake.py&lt;/strong&gt; file in the &lt;strong&gt;src&lt;/strong&gt; folder in GitHub into the CloudShell terminal&lt;/li&gt;
&lt;li&gt;Press ^X to exit, press Y to save the file, press enter to confirm the file name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4. Create the environment variables file&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;In the CLI, type &lt;code&gt;nano .env&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Paste the following info into the file and update with &lt;strong&gt;your API key&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SPORTS_DATA_API_KEY=your_sportsdata_api_key
NBA_ENDPOINT=https://api.sportsdata.io/v3/nba/scores/json/Players
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Press ^X to exit, press Y to save the file, press enter to confirm the file name&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5. Install dotenv in CloudShell and run the script&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Type &lt;code&gt;pip install python-dotenv&lt;/code&gt; and hit enter&lt;/li&gt;
&lt;li&gt;Once dotenv is installed, run the python script &lt;code&gt;python3 setup_nba_data_lake.py&lt;/code&gt;. You should see the following output if successful:
&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu0r4xb4mkz1c4z0albjt.png" alt="Successful Python script" width="501" height="162"&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;6. Verify resources are in AWS&lt;br&gt;
In IT there is a phrase that goes like this "trust but verify". That's what we are going to do now.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search for &lt;strong&gt;S3&lt;/strong&gt; in the AWS console and check to see if your bucket is there&lt;/li&gt;
&lt;li&gt;Next, search for &lt;strong&gt;Athena&lt;/strong&gt; in the AWS console and run a query against the newly populated data:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELECT FirstName, LastName, Position, Team
FROM nba_players
WHERE Position = 'PG';
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The result should look like this: &lt;/p&gt;

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

&lt;h2&gt;
  
  
  Recap
&lt;/h2&gt;

&lt;p&gt;Now, you have successfully created a Python script that automagically creates an S3 bucket and Glue database with NBA data. You then learned how to leverage Amazon Athena to visualize that data. You are well on your way to becoming a cloudy! &lt;/p&gt;

</description>
      <category>devopsallstarschallenge</category>
      <category>aws</category>
      <category>python</category>
      <category>automation</category>
    </item>
    <item>
      <title>Creating a Subscriber Service for NBA Games using AWS technologies!</title>
      <dc:creator>Evan</dc:creator>
      <pubDate>Thu, 09 Jan 2025 21:35:18 +0000</pubDate>
      <link>https://dev.to/asciikeyboard/creating-a-subscriber-service-for-nba-games-using-aws-technologies-44pi</link>
      <guid>https://dev.to/asciikeyboard/creating-a-subscriber-service-for-nba-games-using-aws-technologies-44pi</guid>
      <description>&lt;p&gt;Hey there 👋🏼 thanks for stopping by! Today, I will be teaching you how to create a subscriber service in AWS to pull real-time NBA game data and send it via email or SMS. Stick around to learn more on AWS, APIs and more!&lt;/p&gt;

&lt;h2&gt;
  
  
  Purpose
&lt;/h2&gt;

&lt;p&gt;The purpose of this article is to walk you through how to leverage AWS to create a subscriber service that utilizes an API and allows users to subscribe for NBA game information. The technologies that will be used in this article include: GitHub, AWS (Lamba, EventBridge, SNS) and Python.&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://discord.gg/hUe7Gbdk" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=09WfkKc0x_Q&amp;amp;t=372s" rel="noopener noreferrer"&gt;YouTube Video from Ifeanyi&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/asciikeyboard/gd-notifications" rel="noopener noreferrer"&gt;My GitHub Repo&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; (or your favorite text editor)&lt;br&gt;
&lt;a href="https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&amp;amp;all-free-tier.sort-order=asc&amp;amp;awsf.Free%20Tier%20Types=*all&amp;amp;awsf.Free%20Tier%20Categories=*all" rel="noopener noreferrer"&gt;AWS Free Tier Account&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/login" rel="noopener noreferrer"&gt;GitHub Account&lt;/a&gt;&lt;br&gt;
Knowledge of Git, Linux commands, APIs and AWS&lt;/p&gt;
&lt;h2&gt;
  
  
  Architecture
&lt;/h2&gt;

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

&lt;p&gt;1. Clone the repo&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;```
git clone https://github.com/asciikeyboard/gd-notifications.git
cd gd-notifications
```
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;2. Create AWS SNS Topic and Subscriber&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login to AWS console &lt;/li&gt;
&lt;li&gt;Search for &lt;strong&gt;SNS&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Topics&lt;/strong&gt; in left-hand menu

&lt;ul&gt;
&lt;li&gt;Select &lt;strong&gt;Create topic&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Type = &lt;strong&gt;Standard&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Name = &lt;strong&gt;gd-topic&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Select &lt;strong&gt;Create subscription&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Protocol = &lt;strong&gt;email&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Endpoint = &lt;strong&gt;email address&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;It should look something like this :]&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ieon5vrc555n9dtfqm8.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9ieon5vrc555n9dtfqm8.png" alt="Subscription in AWS console" width="785" height="260"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login to your email

&lt;ul&gt;
&lt;li&gt;Confirm subscription&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It should look something like this :]&lt;br&gt;
&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu22qf4aglcurm7p5kwyv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fu22qf4aglcurm7p5kwyv.png" alt="Subscription confirmation email" width="689" height="206"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3. Create IAM Policy for SNS Topic&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open &lt;strong&gt;IAM&lt;/strong&gt; in AWS console&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Policies&lt;/strong&gt; in left-hand menu&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Create policy&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Service = &lt;strong&gt;SNS&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Change Policy editor to JSON format&lt;/li&gt;
&lt;li&gt;Navigate to Git repo and copy code from &lt;strong&gt;gd_sns_policy.json&lt;/strong&gt; file within the &lt;strong&gt;policies&lt;/strong&gt; folder&lt;/li&gt;
&lt;li&gt;Paste this code into the Policy editor in the AWS console&lt;/li&gt;
&lt;li&gt;Update the &lt;strong&gt;ARN&lt;/strong&gt; on line 7 of the code with your gd-topic ARN&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Next&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Set the &lt;strong&gt;Policy Name&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Policy name = &lt;strong&gt;gd_sns_policy&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Create Policy&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;4. Create the IAM Role SNS Topic&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Navigate to IAM page&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Roles&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Create role&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Trusted entity type = &lt;strong&gt;AWS service&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Use case = &lt;strong&gt;Lambda&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Next&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Search for "&lt;strong&gt;gd_sns_policy&lt;/strong&gt;" and select the checkbox&lt;/li&gt;
&lt;li&gt;Search for "&lt;strong&gt;AWSLambdaBasicExecutionRole&lt;/strong&gt;" and select the checkbox&lt;/li&gt;
&lt;li&gt;Role name = &lt;strong&gt;gd_lamba_role&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Create role&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;5. Create the Lambda function&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search for &lt;strong&gt;Lambda&lt;/strong&gt; in the AWS console&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Create function&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Select &lt;strong&gt;Author from scratch&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Function name = &lt;strong&gt;gd_notifications&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Runtime = &lt;strong&gt;Python 3.13&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Select the &lt;strong&gt;Change default execution role&lt;/strong&gt; dropdown and change &lt;strong&gt;Execution role&lt;/strong&gt; to &lt;strong&gt;Use an existing role&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Existing role = &lt;strong&gt;gd_lambda_role&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Create function&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Copy code from "&lt;strong&gt;gd_notifications.py&lt;/strong&gt;" file in Git and paste into "&lt;strong&gt;lambda_function.py&lt;/strong&gt;" within AWS console&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Deploy&lt;/strong&gt; from left-hand menu&lt;/li&gt;
&lt;li&gt;Change from &lt;strong&gt;Code&lt;/strong&gt; to &lt;strong&gt;Configuration&lt;/strong&gt; menu and add the following &lt;strong&gt;Environment Variables&lt;/strong&gt;:

&lt;ul&gt;
&lt;li&gt;NBA_API_KEY = your API key&lt;/li&gt;
&lt;li&gt;SNS_TOPIC_ARN = your SNS topic ARN&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Save&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;6. Understanding the lambda_function python script&lt;br&gt;
&lt;strong&gt;For a detailed breakdown please reference the &lt;a href="https://dev.to**url**"&gt;YouTube video from Ifeanyi&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Here's an overview of what the script does: 
1. Retrieves environment variables.
2. Adjusts the current time to Central Time (UTC-6).
3. Fetches NBA game data from the external API.
4. Formats the game data.
5. Publishes the formatted data to the specified SNS topic.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;7. Leverage EventBridge to run a scheduled lambda function&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Search for &lt;strong&gt;EventBridge&lt;/strong&gt; in the AWS console&lt;/li&gt;
&lt;li&gt;Select &lt;strong&gt;Create rule&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Name = &lt;strong&gt;gd_rule&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Rule type = &lt;strong&gt;schedule&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Select &lt;strong&gt;Continue in EventBridge scheduler&lt;/strong&gt;
&lt;/li&gt;

&lt;li&gt;Select &lt;strong&gt;Recurring schedule&lt;/strong&gt; under the &lt;strong&gt;Schedule Pattern&lt;/strong&gt; option&lt;/li&gt;

&lt;li&gt;Input &lt;strong&gt;Cron expression variables&lt;/strong&gt;

&lt;ul&gt;
&lt;li&gt;Minutes = &lt;strong&gt;0&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Hours = &lt;strong&gt;9-23/2,0-2/2&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Day of the month = *&lt;/li&gt;
&lt;li&gt;Month = *&lt;/li&gt;
&lt;li&gt;Day of the week = &lt;strong&gt;?&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Year = *&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;Set Flexible time window &lt;strong&gt;off&lt;/strong&gt;
&lt;/li&gt;

&lt;li&gt;Select &lt;strong&gt;Next&lt;/strong&gt;
&lt;/li&gt;

&lt;li&gt;Target detail = &lt;strong&gt;AWS Lambda Invoke&lt;/strong&gt;
&lt;/li&gt;

&lt;li&gt;Lambda functions = &lt;strong&gt;gd_notifications&lt;/strong&gt;
&lt;/li&gt;

&lt;li&gt;Select &lt;strong&gt;Next&lt;/strong&gt;
&lt;/li&gt;

&lt;li&gt;Select &lt;strong&gt;Next&lt;/strong&gt;
&lt;/li&gt;

&lt;li&gt;Select &lt;strong&gt;Create schedule&lt;/strong&gt;
&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  Review
&lt;/h2&gt;

&lt;p&gt;Now you have successfully created a scheduled SNS Topic to retrieve NBA game data and send that to a subscriber. Pretty neat!&lt;/p&gt;

</description>
      <category>devopsallstarschallenge</category>
      <category>devops</category>
      <category>aws</category>
      <category>api</category>
    </item>
    <item>
      <title>Creating a Weather Dashboard using AWS S3 buckets and OpenWeather API</title>
      <dc:creator>Evan</dc:creator>
      <pubDate>Mon, 06 Jan 2025 20:52:06 +0000</pubDate>
      <link>https://dev.to/asciikeyboard/creating-a-weather-dashboard-using-aws-s3-buckets-and-openweather-api-2l5</link>
      <guid>https://dev.to/asciikeyboard/creating-a-weather-dashboard-using-aws-s3-buckets-and-openweather-api-2l5</guid>
      <description>&lt;p&gt;!!! Fair warning this is my first Dev.To post so it won't be the prettiest thing ツ &lt;/p&gt;

&lt;h2&gt;
  
  
  Purpose
&lt;/h2&gt;

&lt;p&gt;The purpose of this post is to outline the steps I took to create a Weather Dashboard utilizing AWS, OpenWeather, GitHub, VS Code, etc.&lt;/p&gt;

&lt;p&gt;This is a part of the #DevOpsAllStarsChallenge hosted by a few Cloud Engineers and DevOps folks that are trying to help others get involved. It's a pretty neat community and I highly recommend you take a look at the &lt;a href="https://discord.gg/hUe7Gbdk" rel="noopener noreferrer"&gt;Discord&lt;/a&gt; if you're interested!&lt;/p&gt;

&lt;h2&gt;
  
  
  Resources
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://discord.gg/hUe7Gbdk" rel="noopener noreferrer"&gt;Discord&lt;/a&gt;&lt;br&gt;
&lt;a href="https://www.youtube.com/watch?v=A95XBJFOqjw&amp;amp;t=196s" rel="noopener noreferrer"&gt;YouTube Video from Shae&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Tools Needed
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://code.visualstudio.com/download" rel="noopener noreferrer"&gt;VS Code&lt;/a&gt; (or your favorite text editor)&lt;br&gt;
&lt;a href="https://aws.amazon.com/free/?all-free-tier.sort-by=item.additionalFields.SortRank&amp;amp;all-free-tier.sort-order=asc&amp;amp;awsf.Free%20Tier%20Types=*all&amp;amp;awsf.Free%20Tier%20Categories=*all" rel="noopener noreferrer"&gt;AWS Free Tier Account&lt;/a&gt;&lt;br&gt;
&lt;a href="https://openweathermap.org/" rel="noopener noreferrer"&gt;OpenWeather Account&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/login" rel="noopener noreferrer"&gt;GitHub Account&lt;/a&gt;&lt;br&gt;
Knowledge of Git, Linux commands, APIs and AWS&lt;/p&gt;

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

&lt;p&gt;Aside from installing the necessary software and packages (such as VS Code, Python, pip, etc.), the next few things are necessary in order to properly pull from the OpenWeather API and dump that data into an AWS S3 bucket.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Create API key in OpenWeather&lt;/strong&gt;&lt;br&gt;
Create an account with OpenWeather, select "API Keys" and generate an API key. This will be used later in the .env file within the Git repo.&lt;/p&gt;

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

&lt;p&gt;&lt;strong&gt;Create IAM user in AWS, assign group, permissions and generate Access Key&lt;/strong&gt;&lt;br&gt;
This step is imperative in order to allow the python script to function. The script goes out and creates the S3 bucket using the user credentials and the secret key. For further explanation, please reference the &lt;a href="https://docs.aws.amazon.com/iam/" rel="noopener noreferrer"&gt;AWS IAM user documentation&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;I have created the user "weather-data", assigned the user to a group, and given the group permissions of "AmazonS3FullAccess". This gives the user the necessary permissions to create an S3 bucket.&lt;/p&gt;

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

&lt;h2&gt;
  
  
  Spinning Up the Weather Dashboard
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Clone the repo
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/asciikeyboard/weather-dashboard.git
cd weather-dashboard
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Create a .env file with your OpenWeather API key and AWS credentials.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;touch .env
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now it is up to you to use vim, nano, or your favorite text editor to make the necessary modifications to the .env file.&lt;/p&gt;

&lt;p&gt;Below you will see the different variables necessary. The blurred variables should never be shared as these are sensitive keys/IDs.&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Run the python script
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;python3 src/weather_dashboard.py
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The output should look similar to this:&lt;/p&gt;

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

&lt;p&gt;"Trust but verify" ... so let's check AWS and boom - the data is in the newly created S3 bucket!&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Now delete the S3 bucket to ensure you don't get billed!&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;This project is a nice way to get introduced to common DevOps tools such as GitHub, Python, AWS, etc. This repo allows a user to pull weather data from an API and upload it to a S3 bucket in Amazon. There are plenty of customizations that could be made. Feel free to explore!&lt;/p&gt;

</description>
      <category>devops</category>
      <category>devopsallstarschallenge</category>
      <category>aws</category>
      <category>api</category>
    </item>
  </channel>
</rss>
