[英]Permissions to start, update AWS IOT job
我的 AWSIotTopic class 中有 onMessage function,它在创建 AWS IoT 作业时启动 AWS 作业(监听主题 $aws/things/%s/jobs/notify-next)。 我无法从本地 java 应用程序更改工作状态。 当我将策略附加到具有所有权限的注册证书时,即:
"Action": "*",
"Resource": "*"
我的申请有效,我可以更改工作状态。 我必须添加哪些权限才能更改工作状态?
"Effect": "Allow",
"Action": [
"iot:UpdateJobExecution",
"iot:StartNextPendingJobExecution"
],
"Resource": "arn:aws:iot:eu-west-2:125960935295:thing/thingID"
}
以上权限不允许启动和更新作业
我解决了。 除了iot:Subscribe
主题 notify-next 之外,还需要添加iot:Receive
。 在设备上执行作业的所有权限:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "iot:Subscribe",
"Resource": "arn:aws:iot:<region>:<awsID>:topicfilter/$aws/things/<deviceID>/jobs/notify-next"
},
{
"Effect": "Allow",
"Action": "iot:Receive",
"Resource": "arn:aws:iot:<region>:<awsID>:topic/$aws/things/<deviceID>/jobs/notify-next"
},
{
"Effect": "Allow",
"Action": "iot:Publish",
"Resource": "arn:aws:iot:<region>:<awsID>:topic/some"
},
{
"Effect": "Allow",
"Action": "iot:Connect",
"Resource": "arn:aws:iot:<region>:<awsID>:client/<deviceID>"
},
{
"Effect": "Allow",
"Action": [
"iot:UpdateJobExecution",
"iot:StartNextPendingJobExecution"
],
"Resource": "arn:aws:iot:<region>:<awsID>:thing/<deviceID>"
}
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.