我想办法做到这一点
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iot:Connect"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"iot:Subscribe"
],
"Resource": [
"arn:aws:iot:us-east-1:xxxxxxxx:topicfilter/TOPICS-TEST*"
]
},
{
"Effect": "Allow",
"Action": [
"iot:Receive"
],
"Resource": [
"*"
]
},
{
"Effect": "Allow",
"Action": [
"iot:Publish"
],
"Resource": [
"arn:aws:iot:us-east-1:xxxxxxxx:topic/TOPICS-TEST/*"
]
}
]
}
之前的策略将允许接收来自AWS物联网核心的通知,连接,只推送到子主题
TOPICS-TEST/ ...
并订阅
TOPICS-TEST/...
我用的是
...:topicfilter/...
用于发布。应该是
...:topic/...
.