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
asked 2 years ago264 views
1 Answer
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
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions