Policies and IAM
IoT policy scope
Section titled “IoT policy scope”Use least-privilege IoT policy
AWS IoT Core policy — least-privilege MQTT permissions scoped to a device's Thing name and topic namespace. statements for device operations:
iot:Connectscoped to the device ThingName identityiot:Publishscoped to the device topic namespace only
Recommended topic pattern:
devices/{Thing_Name}/telemetrydevices/{Thing_Name}/events
IoT Rules IAM role
Section titled “IoT Rules IAM role” IoT Rules
AWS IoT Rules — route incoming MQTT messages to Lambda and CloudWatch Logs for ingest and verification. write routed payloads to
CloudWatch Logs
Amazon CloudWatch Logs — stores IoT rule output for Phase 1 verification (`/aws/iot/esp32-demo/telemetry` and `/events`). for verification and
troubleshooting. The IAM role for rule delivery is created by the
CloudFormation bootstrap
stack. Keep role
permissions restricted to logs write operations, at minimum:
logs:CreateLogGrouplogs:CreateLogStreamlogs:PutLogEvents
Browser access boundary
Section titled “Browser access boundary”The dashboard browser should not query DYNAMODB
Amazon DynamoDB — persists telemetry and event records after Lambda ingest in Phase 2. directly. Data is intentionally fronted through API Gateway
Amazon API Gateway — exposes HTTP routes for latest telemetry and recent events. The browser reads data through API Gateway, not DynamoDB directly. and LAMBDA
AWS Lambda — processes IoT rule payloads and serves query API logic behind API Gateway. so:
- data access can be validated and filtered at the API layer
- table internals remain private from client-side code
- IAM
AWS Identity and Access Management — controls roles and permissions for IoT Rules, Lambda, and other services. complexity stays server-side