What is the point of the Thing in the PubSub tutorial?

0

I am new to AWS IoT at a technical level and am struggling with some concepts despite reading the documentation.

It seems that unless you are using Thing Shadow then a Thing is not being used in anyway.

Take the PubSub Java tutorial for example; it makes you create a Thing, but the client side Java code is not publishing to that Thing it is publishing to a Topic. I can view my data in the test MQTT client. The client side code does not know anything about the Thing Name.

I can then delete that Thing and still the client will send data to the MQTT server.

Another example; I can add a Rule and take data from a Topic and send it on to a Lambda function, again the Thing does not feature in anyway in this.

The only time I see that Thing actually coming into play is when you use Thing Shadow. Here when using the client side Java SDK you need to specify the Thing Name.

So my question is: is there any point in having Things if I am not using Thing Shadows, or do most AWS IoT implementations typically use Thing Shadow as a minimum?

user444
已提問 2 年前檢視次數 270 次
1 個回答
2

You are correct that Things can be optional. Identity and authorization are provided by the certificate, Cognito Identity, or custom authentication, where each credential is then associated with an IAM or IoT policy that allows or rejects different IoT actions.

It is best practice to associate a Thing with a certificate. By doing so, you can enforce that the MQTT clientId provided during a connection matches a Thing name, and if using the ThingName as a policy variable that can limit a device's IoT actions publish and subscribe topics. A thing also provides metadata and the ability to use FleetHub to manage devices, ability to enable fleet indexing, and provides a data source of all devices registered with IoT Core.

Technically a thing isn't needed to utilize shadows (classic or named), but as you mentioned, this is where scoping by ThingName can be useful.

AWS
Gavin_A
已回答 2 年前

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

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

回答問題指南