Is there a way to query some ENV variables from the terminal of the Compute VM itself for the service account used by that VM?
This is what I'm looking for but for the Service Account attached to the VM: https://cloud.google.com/shell/docs/how-cloud-shell-works#zone_selection
The details on the service accounts assigned to the Compute Engine instance are available from the Metadata Server. This information can be accessed using the CLI curl from inside the VM.
curl -s "http://metadata.google.internal/computeMetadata/v1/instance/service-accounts/default/email" -H "Metadata-Flavor: Google"