How to get IoT Thing Group name from a Thing's name?

0

I am trying to retrieve the thing group that a thing is part of as a step during our handling of the MQTT payloads.

I have a rule set up that triggers a lambda to processes the payload data and sends it to my external service. As part of that I want to redirect/handle certain groups differently, but I haven't been able to find information on how I can get the group name a thing belongs to in a lambda (or before that point). The only identifier I have to start with is the thing's name.