Real-time drone telemetry visualization using AWS IoT Core, Lambda, S3, and API Gateway.
Simulator → IoT Core → Lambda (storeTelemetry) → S3
↓
Frontend ← API Gateway ← Lambda (getLatest)
aws s3 mb s3://aegismap-datacd /workshop
./deploy.shThis script will:
- Create IAM role with S3 and CloudWatch permissions
- Create S3 bucket
- Deploy both Lambda functions
- Configure IoT Core rule
- Create API Gateway
- Display your IoT endpoint and API URL
Set environment variables:
export IOT_ENDPOINT=YOUR_IOT_ENDPOINT.iot.REGION.amazonaws.com
export AWS_ACCESS_KEY_ID=YOUR_ACCESS_KEY
export AWS_SECRET_ACCESS_KEY=YOUR_SECRET_KEY
export AWS_SESSION_TOKEN=YOUR_SESSION_TOKEN # if using temporary credentials
export AWS_REGION=us-east-1Get IoT endpoint:
aws iot describe-endpoint --endpoint-type iot:Data-ATSInstall and run:
npm install
npm start- Edit
index.htmland replaceYOUR_API_GATEWAY_URLwith your API Gateway endpoint - Open
index.htmlin a browser - Watch drones move across Nashville in real-time
- Go to S3 Console → Create bucket
aegismap-data
- Create two functions:
aegismap-storeTelemetryandaegismap-getLatest - Use Python 3.11 runtime
- Copy code from
storeTelemetry.pyandgetLatest.py - Add environment variable
BUCKET_NAME=aegismap-data - Attach IAM role with S3 read/write permissions
- Go to IoT Core → Message routing → Rules
- Create rule with SQL:
SELECT * FROM 'aegismap/drones/telemetry' - Add action: Lambda function →
aegismap-storeTelemetry
- Create HTTP API
- Add route:
GET /latest - Integrate with Lambda
aegismap-getLatest - Enable CORS
- Deploy to stage (e.g.,
prod)
Lambda execution role needs:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::aegismap-data",
"arn:aws:s3:::aegismap-data/*"
]
},
{
"Effect": "Allow",
"Action": [
"logs:CreateLogGroup",
"logs:CreateLogStream",
"logs:PutLogEvents"
],
"Resource": "arn:aws:logs:*:*:*"
}
]
}- Real-time drone position updates
- Battery level monitoring
- Survivor detection alerts
- System status dashboard
- Nashville disaster zone visualization
Simulator not connecting:
- Verify IoT endpoint is correct
- Check AWS credentials are valid
- Ensure IoT policy allows publish to
aegismap/drones/telemetry
No data in frontend:
- Check API Gateway URL is correct in
index.html - Verify Lambda has S3 permissions
- Check browser console for CORS errors
Lambda errors:
- Check CloudWatch Logs for both Lambda functions
- Verify S3 bucket name matches environment variable
- Ensure IAM role has necessary permissions