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?

質問済み 3年前1045ビュー
2回答
0
承認された回答

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
回答済み 3年前
profile picture
エキスパート
レビュー済み 7日前
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?

回答済み 3年前
  • Just wondering if you explored this idea of reading the config file?

ログインしていません。 ログイン 回答を投稿する。

優れた回答とは、質問に明確に答え、建設的なフィードバックを提供し、質問者の専門分野におけるスキルの向上を促すものです。

質問に答えるためのガイドライン

関連するコンテンツ