Getting an instances ID from within an instance

#1

Is there any way that from within any given instance I can work out what its instance ID is?

#2

Found out how in the end - for anyone else:

/var/run/cloud-init/instance-data.json

You can also do:

EXT_HOSTNAME=$(grep -oP '^ID=\K.+$' /var/run/scw-metadata.cache).pub.cloud.scaleway.com
ping -c4 $EXT_HOSTNAME