It starts by using the AWS IoT Device SDK, using either MQTT or HTTP, to publish data from the device to AWS IoT Core. (Or if you want a full OS for your device, Amazon FreeRTOS comes ready to connect to AWS IoT as well.) AWS IoT Core includes a message broker (which is more or less invisible to you, no servers involved) that supports these two protocols. MQTT is a great protocol for IoT but sometimes HTTP is just more convenient. (Websockets is also supported, which we’ll discuss later.)
Your thing can send the message directly with an arbitrary topic name, or you can optionally update the thing “shadow”. The shadow is a component of AWS IoT Core which allows you to store state information about your thing and allow your thing and your back-end to asynchronously communicate about that state. The AWS IoT Device SDK makes it easy for a device to update its shadow. This link is a good primer on AWS IoT device shadows.
Whether via the shadow or some other topic, the message will hit the AWS IoT Core message broker. From there, IoT Rules and IoT Rule Actions take over. IoT Rules use a simplified SQL syntax to select data out of the message and optionally test for some condition (using a WHERE clause) and then triggering an IoT Rule Action. The SQL syntax is a bit limited but there are many built-in functions that extend its functionality.
IoT Rule Actions are triggered by rules and let you invoke a variety of AWS services and pass some data from the thing’s message to that service. Perhaps most commonly, you would trigger a Lambda function. But as you can see from the above diagrams, you can do a lot of other interesting things like send the data to Kinesis, CloudWatch, SNS, or even write directly to DynamoDB, S3, or ElasticSearch. One other interesting option is the Salesforce action… right from IoT Core, you can write data to Salesforce to, for example, trigger customer serivce followup actions in Salesforce when a device sends an error code. The full list of available IoT Rule Actions is here.
Another interesting option: a browser real-time dashboard can also subscribe to updates with MQTT-over-websockets, another protocol supported by AWS IoT. The result here is remarkably low latency… data sent from the thing shows up in the browser fast enough that the perception is completely “immediate”. This SDK for Javascript provides a starting point.
So to summarize, a typical flow might be something like this: