From aws-dev-toolkit
Deep-dive into AWS IoT architecture, device connectivity, edge computing, and fleet management. This skill should be used when the user asks to "design an IoT solution", "connect devices to AWS", "set up MQTT messaging", "configure IoT rules", "provision a device fleet", "use Greengrass at the edge", "build a device shadow", "set up IoT security", "manage OTA updates", "store telemetry data", "create IoT topic rules", "configure fleet provisioning", or mentions IoT Core, MQTT, Greengrass, Device Shadow, IoT Rules Engine, IoT Events, IoT SiteWise, fleet indexing, or device certificates.
npx claudepluginhub aws-samples/sample-claude-code-plugins-for-startups --plugin aws-dev-toolkitThis skill uses the workspace's default tool permissions.
Specialist guidance for AWS IoT. Covers IoT Core (MQTT, shadows, rules engine), Greengrass v2 edge compute, fleet provisioning, security, data storage patterns, and fleet management.
Searches, retrieves, and installs Agent Skills from prompts.chat registry using MCP tools like search_skills and get_skill. Activates for finding skills, browsing catalogs, or extending Claude.
Checks Next.js compilation errors using a running Turbopack dev server after code edits. Fixes actionable issues before reporting complete. Replaces `next build`.
Guides code writing, review, and refactoring with Karpathy-inspired rules to avoid overcomplication, ensure simplicity, surgical changes, and verifiable success criteria.
Share bugs, ideas, or general feedback.
Specialist guidance for AWS IoT. Covers IoT Core (MQTT, shadows, rules engine), Greengrass v2 edge compute, fleet provisioning, security, data storage patterns, and fleet management.
aws-docs MCP tools to verify current IoT Core limits, Greengrass component versions, and service quotas| Requirement | Recommendation | Why |
|---|---|---|
| Devices sending telemetry to cloud | IoT Core (MQTT) | Persistent connections, sub-second latency, bidirectional, scales to millions of concurrent connections |
| Request/response from constrained devices | IoT Core (HTTPS) | Stateless, no persistent connection needed, but higher latency and no server-to-device push |
| Browser or mobile app to IoT backend | IoT Core (MQTT over WebSocket) | Works through firewalls/proxies, uses IAM or Cognito auth instead of X.509 certificates |
| Edge preprocessing before cloud upload | Greengrass v2 | Reduces bandwidth cost and cloud ingestion volume by filtering/aggregating at the edge |
| Local device control when internet is down | Greengrass v2 | Local MQTT broker keeps device-to-device communication working during cloud disconnection |
| Industrial OPC-UA data collection | IoT SiteWise | Purpose-built for industrial protocols, asset modeling, and time-series with SiteWise Edge gateway |
| State machine on device events | IoT Events | Detector models react to patterns across multiple devices without custom Lambda logic |
| Time-series telemetry storage | Timestream | Purpose-built for time-series with automatic tiering (memory to magnetic), built-in interpolation and aggregation functions |
| Device metadata and state lookups | DynamoDB | Single-digit ms latency for key-value access to device config, state, and registry data |
| Bulk telemetry archival | S3 | Cheapest storage for raw telemetry; query with Athena when needed |
| Telemetry search and dashboards | OpenSearch | Full-text search and Kibana/OpenSearch Dashboards for operational visibility |
Use MQTT for device-to-cloud communication unless there is a specific reason not to. MQTT uses persistent TCP connections with minimal overhead (2-byte header minimum), supports QoS 0 (at most once) and QoS 1 (at least once), and enables server-initiated push to devices via subscriptions.
Use HTTPS only for devices that wake up, send a single reading, and sleep (battery-powered sensors with cellular connectivity). HTTPS does not support subscriptions, so the device cannot receive commands without polling. Every request incurs TLS handshake overhead.
Use for browser-based dashboards and mobile apps that need real-time device data. Authenticates with IAM credentials or Cognito identity pools instead of X.509 certificates. Works through corporate proxies and firewalls that block raw TCP on port 8883.
Design topics as a hierarchy with device identity and data type segments. This enables fine-grained IoT policy access control and targeted rules engine subscriptions.
{org}/{environment}/{device-type}/{device-id}/{data-category}
Examples:
acme/prod/temperature-sensor/sensor-001/telemetry
acme/prod/temperature-sensor/sensor-001/alerts
acme/prod/temperature-sensor/sensor-001/commands
acme/prod/temperature-sensor/+/telemetry # Rule subscribes to all sensors
${iot:Connection.Thing.ThingName} to restrict each device to its own topics+ (single-level) and # (multi-level) wildcards in rules and subscriptions, never in publish topicsFor high-volume telemetry that goes directly to rules engine actions without needing the message broker, use the $aws/rules/<rule-name> topic prefix. Basic Ingest skips the message broker publish cost ($1.00 per million messages), saving significant cost at scale. The tradeoff: messages sent via Basic Ingest cannot be received by other MQTT subscribers.
Device Shadow maintains a JSON document of desired and reported state for each device. Use shadows when cloud applications need to read or set device state regardless of whether the device is currently connected.
reported state from the device, desired state from the cloud application. The delta field tells the device what to change.The rules engine evaluates SQL statements against incoming MQTT messages and routes matching data to AWS service actions. Every production deployment should have at least one rule for data ingestion and error handling.
SELECT temperature, humidity, timestamp() as ts, topic(4) as device_id
FROM 'acme/prod/temperature-sensor/+/telemetry'
WHERE temperature > 0 AND temperature < 150
topic(n) extracts the nth level from the topic string (1-indexed)timestamp() adds server-side UTC timestampWHERE clause filters before action execution, reducing downstream processing costSELECT * sparingly; extract only the fields needed to minimize action payload size| Data Destination | Rule Action | When to Use |
|---|---|---|
| Real-time processing | Lambda | Custom transformation, enrichment, or fan-out logic |
| Time-series storage | Timestream | Telemetry that needs time-range queries and aggregation |
| Key-value lookups | DynamoDB / DynamoDBv2 | Device metadata, latest state, configuration |
| Streaming analytics | Kinesis Data Streams | High-throughput ingestion for real-time analytics pipelines |
| Bulk archival | S3 | Raw telemetry archival for compliance or batch analytics |
| Notifications | SNS | Alert routing to email, SMS, or HTTP endpoints |
| Decoupled processing | SQS | Buffer messages for downstream consumers that process at their own rate |
| State machine triggers | IoT Events | Multi-device event correlation and complex event processing |
| Republish | IoT Core republish | Route to another MQTT topic for device-to-device via cloud |
| Search and dashboards | OpenSearch | Operational dashboards and full-text search over telemetry |
Every rule must have an error action. Without one, failed rule actions silently drop data with no notification and no retry. Configure error actions to route failures to S3 or SQS for later reprocessing.
See references/rules-engine-patterns.md for detailed SQL examples and error action configuration.
Use IoT SiteWise instead of raw IoT Core + custom storage when the workload involves industrial equipment with OPC-UA data sources, asset hierarchies, and time-series metrics that need automatic aggregation (min, max, avg, count over time windows).
Use IoT Events when device telemetry needs to trigger state-machine logic across multiple devices or time windows, and the logic is too complex for simple IoT Rules Engine WHERE clauses.
| Scenario | Method | Why |
|---|---|---|
| Factory installs unique certs per device | JITP (Just-in-Time Provisioning) | Simplest: device connects, CA is recognized, thing is auto-created. Requires trusted manufacturing chain. |
| Factory installs unique certs, need custom validation | JITR (Just-in-Time Registration) | Lambda hook validates additional attributes before activating the certificate |
| Cannot install unique certs during manufacturing | Fleet Provisioning by Claim | Devices share a claim certificate, exchange it for a unique identity on first boot. Use pre-provisioning Lambda hook to validate serial numbers against an allow-list. |
| End user or installer provisions device | Fleet Provisioning by Trusted User | Mobile app generates temporary credentials for the device. Highest security for consumer devices. |
${iot:Connection.Thing.ThingName} policy variables.See references/security-provisioning.md for provisioning templates, certificate management, and IoT policy examples.
IoT policies control what MQTT topics a device can publish/subscribe to and what shadows/jobs it can access. Always use policy variables to scope per-device.
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iot:Connect",
"Resource": "arn:aws:iot:REGION:ACCOUNT:client/${iot:Connection.Thing.ThingName}"
},
{
"Effect": "Allow",
"Action": "iot:Publish",
"Resource": "arn:aws:iot:REGION:ACCOUNT:topic/acme/prod/*/${iot:Connection.Thing.ThingName}/*"
},
{
"Effect": "Allow",
"Action": "iot:Subscribe",
"Resource": "arn:aws:iot:REGION:ACCOUNT:topicfilter/acme/prod/*/${iot:Connection.Thing.ThingName}/*"
}
]
}
Use custom authorizers when devices cannot use X.509 certificates (e.g., legacy devices with token-based auth or OAuth). The authorizer is a Lambda function that validates the token and returns an IoT policy document. Custom authorizers add latency (Lambda cold start) and cost (per-invocation), so prefer X.509 certificates for new device designs.
s3://bucket/year=2026/month=04/day=06/hour=12/device-id.jsonGreengrass v2 uses a component model where each capability is a deployable unit (recipe + artifacts). Components can be:
Use Stream Manager for reliable edge-to-cloud data transfer. It handles buffering, batching, bandwidth management, and automatic retry. Supports export to Kinesis Data Streams, S3, IoT Analytics, and IoT SiteWise.
See references/greengrass-patterns.md for component recipes, deployment configurations, and stream manager setup.
thingName:sensor-* AND shadow.reported.firmware:v2.1 AND connectivity.connected:false finds all disconnected sensors on old firmware.| Resource | Default Limit | Notes |
|---|---|---|
| Maximum concurrent connections | 500,000 per account | Requestable increase |
| Maximum MQTT message size | 128 KB | Hard limit |
| Maximum publishes per second (per account) | 20,000 | Requestable increase |
| Maximum inbound publishes per second (per connection) | 100 | Per-device throttle |
| Persistent session expiry | 1 hour (default), up to 7 days | Configure per client |
| Maximum rules per account | 1,000 | Requestable increase |
| Maximum actions per rule | 10 | Hard limit |
| Maximum shadow document size | 8 KB (classic), 8 KB (named) | Hard limit |
| Named shadows per thing | 10 | Hard limit |
| Fleet provisioning templates per account | 256 | Requestable increase |
| Thing groups depth | 7 levels | Hard limit |
iot:* can publish to any topic, read any shadow, and trigger any job. Use policy variables (${iot:Connection.Thing.ThingName}) to scope each device to its own resources.devices/telemetry makes it impossible to apply per-device access control, filter rules by device type, or subscribe to a specific device's data. Use hierarchical topics with device identity segments.For detailed operational guidance, consult:
references/rules-engine-patterns.md -- Rule SQL examples for common routing patterns, error action configuration, topic structure best practices, and Basic Ingest setupreferences/security-provisioning.md -- X.509 certificate management, fleet provisioning templates (JITP, bulk, by claim), IoT policies with variables, and custom authorizer setupreferences/greengrass-patterns.md -- Greengrass v2 component recipes, deployment configurations, stream manager setup, and local MQTT bridge configurationlambda -- Lambda functions as IoT rule actions and Greengrass componentsstep-functions -- Orchestrating multi-step device provisioning and remediation workflowsdynamodb -- Device metadata storage design, partition key strategy, TTL configurations3 -- Telemetry archival, lifecycle policies, Athena integration for batch queriesmessaging -- SQS/SNS integration with IoT rules for decoupled processing and alertingobservability -- CloudWatch metrics, alarms, and dashboards for IoT fleet monitoringiam -- IAM roles for IoT rules engine actions, Greengrass token exchange, and fleet provisioningnetworking -- VPC endpoints for IoT Core, private connectivity for Greengrass core devicessecurity-review -- Security audit of IoT policies, certificate management, and Device Defender configurationWhen recommending an IoT architecture, include:
| Component | Choice | Rationale |
|---|---|---|
| Protocol | MQTT v5 over TLS 8883 | Bidirectional, persistent, low overhead |
| Authentication | X.509 per-device certificates via AWS Private CA | Hardware-bound identity, scalable revocation |
| Provisioning | Fleet Provisioning by Claim with pre-provisioning hook | Devices cannot be provisioned in factory |
| Topic Structure | {org}/prod/{type}/{device-id}/{category} | Per-device access control, rule targeting |
| Telemetry Ingestion | IoT Rules Engine to Timestream (Basic Ingest) | Cost-effective time-series storage |
| Device State | Named Shadows (config + diagnostics) | Offline-tolerant desired/reported sync |
| Edge Compute | Greengrass v2 with Stream Manager | Local filtering, buffered cloud upload |
| Fleet Management | Jobs (OTA) + Fleet Indexing + Device Defender | Update, query, and audit the fleet |
| Alerting | IoT Events detector model to SNS | Multi-device state correlation |
Include estimated monthly cost range using the cost-check skill.