Serverless data ingestion system built with AWS Lambda, DynamoDB, and S3. Provides a REST API for storing arbitrary JSON data and automated weekly summary generation.
- REST API endpoint for ingesting JSON data
- Automatic data persistence to DynamoDB with UUID and timestamp
- Weekly scheduled summary generation
- Automated S3 storage for summary reports
- Infrastructure fully defined as code with AWS CDK
- Configure AWS credentials:
aws configure- Run setup script:
./setup.sh./deploy.shThis script will:
- Validate AWS credentials
- Bootstrap CDK (if needed)
- Synthesize template
- Deploy all resources
Run automated validation tests:
./test-deployment.shThis script will:
- Retrieve CDK stack outputs
- POST test data to the API
- Verify data in DynamoDB
- Trigger summary Lambda manually
- Validate S3 summary file creation
- Test API error handling
Send JSON data to the API endpoint:
curl -X POST ${endpoint}/data \
-H "Content-Type: application/json" \
-d '{
"sensor_id": "sensor-001",
"temperature": 23.5,
"humidity": 60,
"timestamp": "2025-10-29T10:00:00Z"
}'Response:
{
"success": true,
"message": "Data saved successfully",
"id": "550e8400-e29b-41d4-a716-446655440000",
"timestamp": 1730217600000
}aws dynamodb scan --table-name data-table --limit 5aws lambda invoke \
--function-name cce-summary-function \
--payload '{}' \
response.json
cat response.jsonSummary format:
{
"periodStart": "2025-10-22T00:00:00Z",
"periodEnd": "2025-10-29T00:00:00Z",
"totalItems": 150,
"generatedAt": 1730217600000
}Ingest JSON data into the system.
Response (Success):
{
"success": true,
"message": "Data saved successfully",
"id": "uuid-string",
"timestamp": 1730217600000
}Response (Error):
{
"success": false,
"error": "Error message"
}To remove all AWS resources
./destroy.shCurrent implementation is for demonstration. For production deployment, consider:
- Add API authentication
- Implement request throttling and rate limiting
- Add input validation
- Enable DynamoDB encryption if required
- Enable AWS WAF for API Gateway
- Implement proper logging and monitoring
- Use AWS Secrets Manager for sensitive configuration
