I want to list the IOT things on a UI logged in with AWS Cognito. A user can create an IOT thing and should be able to see the IOT thing created by that user only and not by other users.
1 Answers
There are couple of ways to do that, one way would be creating an IoT group for each user and whenever the user add new IoT device, it should be added to that group. In this way you can then get the list of all things which are in the same group using AWS IoT SDKs. For example, by using AWS SDK for Python (Boto) you can get the list of things in an specific group using list_things_in_thing_group command, you can find more information here.
The other way would be using name/value pair for each IoT thing, say name: [user]. You can then filter things with this pair and list the things that created by specific user.
The third way would be saving the name of IoT devices created by each user in databases (like DynamoDB, RDS,...) and list them on UI.
Although, for all of these ways, you should consider the correct policy for users.