The IoT Rule Engine routes incoming weather telemetry messages from IoT devices directly to the S3 data lake for storage and processing.
This rule automatically:
weatherPlatform/telemetry/*
topicsitea-weather-data-lake-storage
)Navigate to AWS IoT Core Console
Go to Message routing → Rules
Click “Create rule”
Configure rule settings:
WeatherTelemetryToS3Rule
Route weather telemetry data to S3 data lake
fcj_workshop1
- FCJ Workshop 1
SQL statement:
SELECT * FROM 'weatherPlatform/telemetry/+'
Rule actions → Add action:
itea-weather-data-lake-storage-yourname
(use your unique bucket name)raw-data/weatherPlatform/telemetry/${location}/${timestamp()}.json
Create or select IAM role:
IoTRuleToS3Role
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject"
],
"Resource": "arn:aws:s3:::itea-weather-data-lake-storage-yourname/raw-data/*"
}
]
}
SELECT * FROM 'weatherPlatform/telemetry/+'
SELECT *
: Captures the entire message payloadFROM 'weatherPlatform/telemetry/+'
: Matches all topics under telemetry (+ is wildcard)raw-data/weatherPlatform/telemetry/${location}/${timestamp()}.json
Result structure:
itea-weather-data-lake-storage-yourname/
└── raw-data/
└── weatherPlatform/
└── telemetry/
├── itea-lab-room-a/
│ ├── 1696118400000.json
│ └── 1696118460000.json
└── outdoor-station-1/
├── 1696118400000.json
└── 1696118460000.json
Use IoT Core Message Client:
weatherPlatform/telemetry/test-location
{
"deviceId": "test-device-01",
"timestamp": "2024-01-15T10:30:00Z",
"temperature": 25.5,
"humidity": 60.2,
"location": "test-location"
}
raw-data/weatherPlatform/telemetry/test-location/{timestamp}.json
Important: Replace itea-weather-data-lake-storage-yourname
with your actual unique bucket name in both the S3 action and IAM policy.
This rule ensures all weather device messages are automatically stored in the data lake, ready for AWS Glue processing.
After creating the rule, verify:
The IoT Rule Engine now automatically routes all weather telemetry to your S3 data lake for storage and further processing.