Understanding AWS IoT — IoT309
I recently watched an excellent hands on video on AWS IoT from re:Invent 2019. This post is based on the same. Basic flow of the application is as below. We will try to understand the IoT service with this example.
In the above diagram I have added Service namespace. We will go through each of them one by one and what they do. Lets start with IoT core.
IoT core allows us to connect IoT devices to Cloud. It does so by a certificate and IoT policy which gives authority for devices to call AWS APIs. Message broker allows device to publish and consume data from cloud. We can group resources by Type and manage them as a single entity. Device shadow helps in having point in state of device and is used to mimic actual device state. By using rules engine we can do various data transformations and then take actions.
Greengrass allows us to manage, analyze and act on the device generated data locally. Core is a Thing (IoT Thing) which is used to manage all other devices. This device exposes its resources for shared consumption. It consist of device group, Logger, Resources, Subscription, Connector and Function. Function is lambda function that is used to execute runtime tasks locally.
A Subscription is a one directional channel that allows devices to send messages from source to target. If we need back and forth communication then we need to create one more subscription with source and target swapped.
Resource. As mentioned above, core device exposes certain resources that can be consumed by Function or connector. In the demo app we are using local volume to send simulation data from device to IoT core.
We have various types of connector which allows us to connect our 3rd party services with group. We can even deploy container on supported edge devices.
Once we have data in IoT cloud we want to transform, analyze and store it for long time retention. IoT analytics allows us to configure pipeline which does data transformation. Later on we can pass the data to datastore in S3. We also have dataset which allows us to run query (SQL) or analytical function (Notebook on containers)on the data.
IoT Events allows us to detect operation events. Based on the detected event or state of process it can trigger a response. In our demo architecture we have created a Detector model. It is a model of our device or process defined in terms of state.
Now that we understand the basic construct of IoT and Greengrass. We can deploy the CFN from this repo and see the things in action.