AWS IoT 中心 SQL:意外字符“$”

AWS IoT hub SQL: Unexpected character '$'

我想借助本教程在 Amazon AWS 上设置 atIoT core 的即时注册: https://aws.amazon.com/de/blogs/iot/just-in-time-registration-of-device-certificates-on-aws-iot/ 如果注册成功,则向主题推送一条mqtt消息 $aws/events/certificates/registered/ 所以要添加设备并将证书设置为活动状态,我想添加一个规则来触发 lambda。

我尝试通过 aws cli 设置规则,但出现与管理控制台中相同的错误。

SELECT * FROM $aws/events/certificates/registered/#

我收到此错误:"An error occurred (SqlParseException) when calling the CreateTopicRule operation: Unexpected character '$'"

您需要将主题用单引号引起来:

SELECT * FROM '$aws/events/certificates/registered/#'