Report Greengrass Component External Facing IP Address

0

Use-case: Automatically build AWS Security groups by reporting the external-facing IP address of an edge device running AWS Greengrass V2. Is there an AWS provided component that does this ?

I see that the IoT Device Defender Component posts some information regarding how many bytes over which ports. We are looking for a component that can report:

  • External facing IP
  • Bandwidth usage (or at least, bandwidth used by the Greengrass software)

Does such a public component exist, or would it have to be a custom-built component ?

2 Answers
0
AWS
answered 2 years ago
  • Does this component report the external ip address of the edge device to the cloud, or just to the local log ?

    All I can see is that it writes the local IP address on the local network, as opposed to the external-facing ip address .

    2022-05-25T14:17:20.372Z [INFO] (pool-1-thread-2) com.aws.greengrass.detector.IpDetectorManager: Acquired host IP addresses. {IpAddresses=[/192.168.1.11]}

  • It reports local connectivity information of Greengrass Core to the cloud, so that client-devices can discover and connect to the core. (For more information: https://github.com/aws-greengrass/aws-greengrass-ip-detector)

    There is no AWS provided component that reports external IP address.

0

We also had a need to know the external-facing (i.e public) IP address. We achieved it by just publishing it to the device's twin, where it's easily looked up. Here's how we did it:

mosquitto_pub -h $GG_HOST --cert $GG_HOME/thingCert.crt --key $GG_HOME/privKey.key --cafile $GG_HOME/rootCA.pem -t '$aws/things/'$GG_THING'/shadow/update' -m "$jsonString"

The $jsonString needed to look like so:

{"state":{"reported":{"key1":"val1" ...  "IP": $IP }}}'

with $IP looked up easily with a call to:

curl -4 ifconfig.co

All bash, and worked for us. Hope this helps.

answered 2 years 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