Lambda get IOT core things list

0

I need to check in a lambda function if a thing (named X) is actually configured. I was thinking on a function like listIotThings and check if X is contained in there.

The use case is to register a device in a mobile app, but should only be allowed if the thing is actually configured. So I go from the mobile app -> API Gateway -> lambda verification.

Any suggestion welcome.

1 Answer
0

You can always use iot with boto 3 and use list_things(**kwargs). Use the attributeName and attributeValue parameters to filter your things. For example, calling ListThings with attributeName=Color and attributeValue=Red retrieves all things in the registry that contain an attribute Color with the value Red . You can also pass thingTypeName (string) -- The name of the thing type used to search for things. It will return along with other attributes like thingArn which you can verify.

https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/iot.html#IoT.Client.list_things

profile pictureAWS
EXPERT
answered a year 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