- Python
- AWS S3
- AWS RDS (PostgreSQL)
- AWS Lambda
- AWS API Gateway
- boto3, psycopg2, pandas
- GitHub Actions
- pgAdmin
- Go to Kaggle Log Analysis Dataset and download the log file.
- Login to your AWS Console and open the S3 service.
- Create a new bucket and name it.
- Open the bucket > Upload > Add files > Choose your downloaded file > Upload
- Go to AWS Console > RDS > Create database
- Engine: PostgreSQL
- Templates: Free Tier
- DB instance identifier: log-db
- Username: postgres
- Password: StrongPassword
- Enable public access: Yes
- VPC security group: Allow PostgreSQL port 5432
- Create database
- Go to postgresql.org and download the .exe file for setting up pgAdmin.
- In pgAdmin, run a query to create the table.
- Launch an EC2 and update it.
- Install boto3, psycopg2, pandas, using pip after enabling python virtual environment.
- Create a script etl_to_rds.py (availble in this repo).
- Run the script.
- Go to AWS Lambda > Create function.
- Name: your-function-name
- Runtime: Python 3.12
- Role: Create new role with basic Lambda permissions
- Set environment variables (in Lambda console Configuration → Environment variables).
- DB_HOST = your-rds-endpoint
- DB_NAME = your-db-name
- DB_USER = your-db-username
- DB_PASS = YourStrongPassword
- Create a lambda_function.py file (availble in this repo) and install the required library (psycopg2-binary) in the same folder.
- Zip the contents and name it as lambda_deploy.zip.
- Go to AWS Lambda Console → Your Function → Code → Upload from → .zip file → choose lambda_deploy.zip → Deploy
- In Lambda console Test → Configure test { "queryStringParameters": { "period": "hour" } } → event Run and check output.
- Search “API Gateway” in AWS search bar → click it.
- Click Create API → Choose HTTP API → Click Build
- Under add integration, choose Lambda and select your function.
- Configure routes → Add route → Method: GET → Resource path: /stats
- Configure stages → Stage name: default (keep default) → Click Create
- Go to API Gateway → Create API Keys
- Go to Usage Plans → Create Usage Plans → Add API stage → Choose your API → Choose the stage (default) → Attach the API Key you created





