Most Recent Project:
This project is a sports alert system that sends real-time NBA game day score notifications to subscribed users via SMS or Email. It leverages Amazon Web Services (SNS, Lambda, EventBridge) and external NBA APIs to provide sports fans with timely game information. The project demonstrates efficient notification mechanisms and cloud computing best practices.
My Repo:
A sports alert system delivering real-time NBA game day notifications via SMS or Email. Powered by AWS (SNS, Lambda, EventBridge) and external NBA APIs, it keeps fans updated with timely game information.
Fetches live NBA game scores via an external API.
Sends updates to subscribers via SMS/Email using Amazon SNS.
Automated updates using EventBridge.
Security-first design with least privilege IAM roles.
Free account and API key from SportsData.io.
Personal AWS account with basic AWS and Python knowledge.
Cloud: AWS
Core Services: SNS, Lambda, EventBridge
External API: NBA Game API (SportsData.io)
Language: Python 3.x
Security: Least privilege IAM roles
game-day-notifications/
├── src/
│ ├── gd_notifications.py # Main Lambda function code
├── policies/
│ ├── gd_sns_policy.json # SNS publishing permissions
│ ├── gd_eventbridge_policy.json # EventBridge permissions
│ └── gd_lambda_policy.json # Lambda execution role permissions
├── .gitignore
└── README.md # Project documentation
git clone https://github.com/ifeanyiro9/game-day-notifications.git
cd game-day-notifications
Alternatively, manually recreate the structure for learning purposes.
Open the AWS Management Console and navigate to the SNS service.
Click Create Topic and select Standard as the topic type.
Name the topic (e.g., gd_topic) and note the ARN.
Click Create Topic.
Click the topic name from the list.
Navigate to the Subscriptions tab and click Create subscription.
Select a protocol:
Email: Enter a valid email address.
SMS: Enter a valid phone number in international format (e.g., +1234567890).
Click Create Subscription.
Confirm email subscriptions by clicking the confirmation link sent to your inbox.
Open the IAM service in the AWS Management Console.
Navigate to Policies → Create Policy.
Click JSON and paste the JSON policy from gd_sns_policy.json.
Replace REGION and ACCOUNT_ID with your AWS region and account ID.
Click Next: Review and enter a name for the policy (e.g., gd_sns_policy).
Click Create Policy.
Open the IAM service in the AWS Management Console.
Click Roles → Create Role.
Select AWS Service and choose Lambda.
Attach the following policies:
SNS Publish Policy (gd_sns_policy created earlier).
Lambda Basic Execution Role (AWSLambdaBasicExecutionRole).
Enter a name for the role (e.g., gd_role).
Click Create Role and copy the ARN.
Navigate to the Lambda service in AWS.
Click Create Function and select Author from Scratch.
Enter a function name (e.g., gd_notifications).
Choose Python 3.x as the runtime.
Assign the IAM role created earlier.
Under Function Code, copy and paste the content from src/gd_notifications.py.
Add the following environment variables:
NBA_API_KEY: Your NBA API key.
SNS_TOPIC_ARN: The ARN of the SNS topic.
Click Create Function.
Navigate to the EventBridge service.
Go to Rules → Create Rule.
Select Event Source: Schedule and set the cron schedule expression:
0 9-23/4 * * ? *
This schedule runs every 4 hours from 9 AM to 12 AM (9 AM, 1 PM, 5 PM, 9 PM).
Under Targets, select the Lambda function and save the rule.
Resolution
Navigate to the Lambda function in the AWS Lambda console.
Select the Configuration tab.
In the General configuration section, click Edit.
Increase the Timeout value to at least 10 seconds or more, depending on the expected execution time.
Click Save.
Cron Job Expression Explanation
Expression: 0 9-23/4 * * ? *
0: The minute at which the job runs.
9-23/4: Every 4 hours from 9 AM to 11 PM.
*: Any day of the month.
*: Any month.
?: Any day of the week.
*: Any year.
Schedule Details:
The job runs at 9 AM, 1 PM, 5 PM, and 9 PM daily.
Cloud-based notifications using AWS SNS and Lambda.
Securing AWS services with IAM policies.
Automation using EventBridge.
Integrating external APIs into workflows.
Contact button below.