首页 > 解决方案 > Create rule in AWS IoT core to insert data into an existing row in DynamoDB

问题描述

When data is sent from my thing to AWS, it will be a string with several values separated by spaces. One of these values is the ID of the device, that I want to use to query the database and insert the data into that row. How can I do this?

标签: amazon-dynamodbrulesaws-iot

解决方案


仅使用单个主题规则可能会很棘手,因为主题规则主要用于 JSON 数据。您可以处理非 json 数据,但您的选择是有限的。您始终可以从主题规则触发 lambda 函数。然后,lambda 函数可以轻松解析消息并写入 DynamoDB。

有关如何在 IoT 主题规则中处理非 JSON 数据的信息,请参阅https://docs.aws.amazon.com/iot/latest/developerguide/binary-payloads.html 。


推荐阅读