IoT Core and device identity
Send telemetry with MQTT
AWS IoT Core connects devices and applications using a message broker. MQTT is a publish/subscribe protocol: a producer publishes a payload to a topic, and authorized subscribers receive matching messages. Example: device sensor-a publishes temperature in Celsius to warehouse/sensor-a/telemetry. Include a stable event ID, capture timestamp and schema version in the payload. AWS IoT Core supports MQTT QoS 0 and 1: QoS 0 may lose messages and QoS 1 can deliver duplicates. Neither establishes exactly-once business processing.
Authenticate and authorize separately
A typical device uses mutual TLS with its own X.509 certificate and protected private key. A thing record describes a device; it is not itself a credential. Provision devices with unique identities using an appropriate enrollment workflow, such as fleet provisioning templates. Attach an IoT policy limiting Connect, Publish, Subscribe and Receive to the intended client and topic resources; Subscribe uses topic filters whereas Receive uses topics. Never share a production private key or log it. Test replacement credentials before revoking old ones; account for offline devices and certificate expiry.
Shadows, rules and fleet visibility
A device shadow stores state independently of the connection: desired is requested state, reported is the device observation, and delta represents differences. For a read-only dashboard use reported temperature/status and its timestamp; a stale shadow does not prove a device is online. IoT rules can filter or route incoming telemetry to supported destinations using authorized actions. IoT Device Management helps organize and observe fleets. Use separate permissions for read-only telemetry and administrative operations; this chapter has no real fleet commands.
Inspect a synthetic message
The lab uses JSON envelopes with topic, QoS and payload fields, not wire-level MQTT packets. Accept only the enrolled device’s topic and valid event data; deduplicate by device and event ID, not arrival time. A replay with identical ID but conflicting content needs quarantine rather than silent replacement. Try the wrong topic, revoked identity and duplicate event. This validates local logic, not TLS, broker behavior or AWS policy evaluation.
{ "device": "sensor-a", "capacity": 2, "messages": [ { "topic": "warehouse/sensor-a/telemetry", "qos": 1, "payload": { "id": "e1", "schema": 1, "captured": 100, "celsius": 4 } }, { "topic": "warehouse/sensor-a/telemetry", "qos": 1, "payload": { "id": "e2", "schema": 1, "captured": 101, "celsius": 5 } } ], "sizing": { "devices": 10, "bytes": 200, "seconds": 1800, "batch": 100 }, "cost": { "infrastructure": 200, "link": 80, "storage": 20, "gb": 50, "rate": 0.1 }}Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
IoT Core and device identity — knowledge check
Compare placement, device identity and disconnected telemetry recovery.
What does MQTT QoS 1 permit?
What is the safer fleet identity approach?
Which shadow field describes observed state?
What should a device with a scoped publish policy be allowed to publish?
What should happen to two different payloads with the same event ID?