我正在使用AWS android SDK连接到AWS IoT . 以下策略允许我的应用成功连接到AWS IoT,除非我进行此更改
“资源”:“arn:aws:iot:us-west-2:1234567890xxx:topic / topic1”我几乎尝试了所有可能的自定义选项,但该策略仅适用于“*”外卡,表示“任何资源和/或任何主题“ .
Working example successfully connects android app to 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": "*"
}
]
}
This Json script fails to connect the android app to 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"
}
]
}
我已经尝试了几乎所有可能的自定义选项,但该策略仅适用于“*”外卡,这意味着“任何资源和/或任何主题” .