How petdroo/aws-sensor-pipeline works
This repository implements an AWS sensor-data ingestion pipeline. S3 objects arrive as SQS-notified events, the Lambda handler validates and parses CSV records, flags statistical anomalies, and writes metrics to PostgreSQL; structured logs report processing and anomalies. A separate initializer creates the database schema and grants the ingestion user access. Terraform files indicate deployment, storage, networking, and monitoring components, but their resource wiring was not excerpted, so those relationships are shown only where code supports them or as unverified dashed links.
Main entry points: handler.py CSV processor · rds.tf RDS configuration · db_init.py Schema initializer · lambda.tf Lambda deployment
Components 15
Ingestion and analysis
- CSV processor
src/handler.py - Sensor metrics
src/handler.py - JSON logger
src/logger.py
Database setup
- Schema initializer
src/db_init.py
AWS infrastructure
- Lambda deployment
terraform/workloads/lambda.tf - S3 configuration
terraform/workloads/s3.tf - SQS configuration
terraform/workloads/sqs.tf - RDS configuration
terraform/workloads/rds.tf - VPC configuration
terraform/workloads/vpc.tf - Monitoring setup
terraform/workloads/monitoring.tf - Bootstrap stack
bootstrap/main.tf
Other components
- SQS events
- S3 objects
- PostgreSQL
- RDS IAM auth
Connections 15
- SQS events → CSV processor: invokes
- CSV processor → S3 objects: reads objects
src/handler.py - CSV processor → Sensor metrics: inserts rows
src/handler.py - CSV processor → RDS IAM auth: requests token
src/handler.py - CSV processor → JSON logger: logs events
src/handler.py - Schema initializer → PostgreSQL: creates schema
src/db_init.py - Schema initializer → JSON logger: logs status
src/db_init.py - CSV processor → PostgreSQL: connects
src/handler.py - S3 configuration → S3 objects: configures
- SQS configuration → SQS events: configures
- Lambda deployment → CSV processor: deploys
- RDS configuration → PostgreSQL: configures
- VPC configuration → RDS configuration: supports networking
- Monitoring setup → Lambda deployment: monitors
- Bootstrap stack → RDS configuration: supports provisioning