What is AWSIOTDataPlaneBuilder?

0

Hi repost community,

I'm looking to populate AWS IOT core device shadow in a lambda function. I'm looking to use Device Shadow REST API. After looking around, it looks like I need to add "Authorization" header myself. Then I looked into documentation which suggested me to look into AWS SDK. Finally I found AWSIOTDataPlaneBuilder which does have a bunch of shadow methods I need. But there's no documentations or example for this.

  1. So what is AWSIOTDataPlaneBuilder? Is this supposed to be used?
  2. if not, is any example for REST API calling to device shadow(from cloud with auth header)? All I found is MQTT examples.
Xicheng
已提問 2 年前檢視次數 232 次
1 個回答
1
已接受的答案

Hi,

when using a Lambda function to update the thing shadow you need to add permission to the Lambda execution role to update the thing shadow: "Action": "iot:UpdateThingShadow".

When you use an AWS SDK to interact with the thing shadow you don't need to add an authorization header. You call the UpdateThingShadow API with the language of your choice. Assuming you are using Java because you mention AWSIOTDataPlaneBuilder the UpdateShadow method is documented at https://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/iotdata/AWSIotData.html.

AWS IoT Core provides a control plane and a data plane. The control plane is used to create/update/delete your IoT resources like things, policies, rules, etc. The data plane is used for data in your case sending data to the thing shadow.

Cheers,

Philipp

AWS
專家
已回答 2 年前

您尚未登入。 登入 去張貼答案。

一個好的回答可以清楚地回答問題並提供建設性的意見回饋,同時有助於提問者的專業成長。

回答問題指南