我正在使用AWS android SDK连接到AWS IoT。 以下策略允许我的应用程序成功连接到AWS IoT 除了当我进行此更改
“资源”:“ arn:aws:iot:us-west-2:1234567890xxx:topic / topic1” 我尝试了几乎所有可能的自定义选项,但该策略仅适用于“ *”通配符,即“任何资源和/或任何主题”。
工作示例将android应用成功连接到AWS IoT
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iot:Connect", "Resource": "arn:aws:iot:us-west-2:1234567890xxx:client/mobile-client-master" }, { "Effect": "Allow", "Action": [ "iot:Publish", "iot:Subscribe", "iot:Receive" ], "Resource": "*" } ] }
此Json脚本无法将android应用连接到AWS IoT
{ "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": "iot:Connect", "Resource": "arn:aws:iot:us-west-2:1234567890xxx:client/mobile-client-master" }, { "Effect": "Allow", "Action": [ "iot:Publish", "iot:Subscribe", "iot:Receive" ], "Resource": "arn:aws:iot:us-west-2:1234567890xxx:topic/topic1" } ] }
我尝试了几乎所有可能的自定义选项,但是该策略仅适用于“ *”通配符,即“任何资源和/或任何主题”。
答案 0 :(得分:0)
原因是订阅服务器需要 topicfilter 资源而不是主题
这是一个例子:
import QtLocation 5.12
import QtPositioning 5.12