Project Overview
This project is a real-time alert system designed to deliver NBA game day score notifications to subscribed users through SMS or email. It utilizes Amazon SNS, AWS Lambda with Python, Amazon EventBridge, and NBA APIs to keep sports fans updated with the latest game information. The project highlights key cloud computing principles and demonstrates an efficient notification framework.
Features
- Fetches live NBA game scores using an external API. (sportdata.io)
- Sends formatted score updates to subscribers via SMS/Email using Amazon SNS.
- Scheduled automation for regular updates using Amazon EventBridge.
- Designed with security in mind, following the principle of least privilege for IAM roles.
Technical Architecture
Technologies Used
- Cloud Provider: AWS
- Core Services: SNS, Lambda, EventBridge
- External API: NBA Game API (SportsData.io)
- Programming Language: Python 3.x
- IAM Security: Least privilege policies for Lambda, SNS, and EventBridge.
Project Structure
game-day-notifications/
├── src/
│ ├── game_day_notifications.py # Main Lambda function code
├── policies/
│ ├── game_day_sns.json # SNS publishing permissions
│ ├── game_day_eventbridge_policy.json # EventBridge to Lambda permissions
│ └── gd_lambda_policy.json # Lambda execution role permissions
├── .gitignore
└── README.md # Project documentation
Setup Instructions
- Create an SNS Topic.
- Add Subscriptions to the SNS Topic and select the email endpoint. Make sure to confirm email subscription
- Create the SNS Publish Policy for SNS Topic in the IAM (To grant necessary permissions to the Lambda Function to publish messages to the SNS topic)
- Create an IAM Role for Lambda that allows the Lambda function to call AWS services on your behalf and add permission policies -the newly created custom policy “NBA_policy” created and AWS managed policy “AWSLambdaBasicExecutionRole”
- Deploy the Lambda Function and attach the newly created role.
- Set Up Automation with Eventbridge
- Test the System and verify the notifications are sent to the subscriber
- Project Output:
Lesson Learned
- Designing a notification system with AWS SNS and Lambda.
- Securing AWS services with least privilege IAM policies.
- Automating workflows using EventBridge.
- Integrating external APIs into cloud-based workflows.
Challenges Encountered
- Error fetching API Keys from the environment variable
- Time out error during Lambda execution
Top comments (0)