How to retreive GreengrassV2 Core Device's AWS IoT Thing name

0

When working with already-configured GreengrassV2 core devices (and therefore the associated AWS IoT Thing), how should one go about the local identification of a physical device that's been registered? The Greengrass CLI (https://docs.aws.amazon.com/greengrass/v2/developerguide/gg-cli-reference.html) has no method to describe how the local device is registered to the cloud, and the AWS CLI greengrassv2 command does not help identify "which physical device corresponds to the registered core-device".

Consider a scenario where someone has 5 unmarked Raspberry Pi's set up as core devices. Each is registered as a Greengrass core device / IoT Thing. How can one best cross-reference which Raspberry Pi corresponds to which core device definition?

I see in a recent documentation update, that in a component lifecycle script, a number of environment variables are automatically set including AWS_IOT_THING_NAME. However, these don't seem to be available outisde of a lifecycle script. Is there a configuration file that stores that information which could easily be accessed, outside of the context of a lifecycle script? Is there a local utility installed that can print out this information?

I feel like there must be some simple way to SSH into a physical device and quickly identify which IoT Thing it is. Or am I wrong?

demandé il y a 3 ans1045 vues
2 réponses
0
Réponse acceptée

Hi,
The correct and the recommended way of knowing the thing name within the Greengrass scope is by using the AWS_IOT_THING_NAME environment variable. However, as you mentioned it already - you can read the effective config file at <greengrass-root>/config/effectiveConfig.yaml to know the thingName under system property outside of Greengrass.

Thanks,
Saranya

AWS
Saranya
répondu il y a 3 ans
profile picture
EXPERT
vérifié il y a 7 jours
0

As a follow-up, I now see that there is an "effective config" file in the Greengrass root directory (/greengrass/v2/config/effectiveConfig.yaml on my system after following the current quick-start installation instructions).

In that YAML file, there is a section system.thingName which shows the currently registered name.

Is this the appropriate place to find this information?

répondu il y a 3 ans
  • Just wondering if you explored this idea of reading the config file?

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions