AWS IoT 的影子和作业是一种简单而有效的 IoT 设备管理方式,可以帮助用户轻松跟踪设备的状态和控制设备。以下是针对 AWS IoT 影子和作业的策略示例。
策略语法:
{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Action": [
"iot:Connect",
"iot:Publish",
"iot:Subscribe",
"iot:Receive",
"iot:GetThingShadow",
"iot:UpdateThingShadow",
"iot:DeleteThingShadow",
"iot:StartNextPendingJobExecution",
"iot:DescribeJobExecution",
"iot:GetPendingJobExecutions",
"iot:UpdateJobExecution"
],
"Resource": [
"arn:aws:iot:::thing/",
"arn:aws:iot:::job/",
"arn:aws:iot:::thing/shadow/*",
"arn:aws:iot:::topicfilter/$aws/things//shadow/*"
]
}]
}
其中:
我们可以使用 AWS IoT 控制台或 AWS CLI 来为设备创建这些策略。修改 Resource 部分的 ARN 来匹配您的设备。以下是示例中一个 ARN 的示例:
arn:aws:iot:us-east-1:123456789012:thing/MyThingName
如果要访问该设备的作业,则将
上一篇:AWSIotMqttManager:失败:连接失败。MqttException(0)-java.io.IOException:已连接
下一篇:AWSIoTPythonSDK publishTimeoutException -> AWSIoTPythonSDK 发布超时异常