Passing messages between AWS IoT and SQS queue using Lambdas written in Rust
AWS IoT Core provides a convenient way to connect your IoT devices like ESP32 to the cloud. Typically MQTT protocol is used for that.
Let’s suppose everything is setup on AWS IoT side and you can see messages from IoT Test console. Next we would like to transfer those MQTT messages to some other service that can actually do something useful with them. AWS SQS queues can be used for that.
Let’s create a rule that triggers a Lambda function every time if something is sent to a topic
floor/1/room/3/temperature. Actually let’s receive all temperatures from all floors and rooms.
Rule query statement for doing it looks like this:
SELECT *, topic() as topic FROM 'floor/+/room/+/temperature'.
We cannot just do
SELECT * FROM 'floor/+/room/+/temperature'
because then we lose information about topic which can be quite valuable.
Let’s say temperature message itself is like this:
Continue reading →