Posts

Showing posts with the label google-cloud-shell

Which region is a google cloudshell in?

Which region is a google cloudshell in? Given a google cloudshell, is there a way of finding out which region it is in? Many thanks, Max p.s. I know that I can poke around to find the IP address and geolocate it, for example this curl freegeoip.net/xml/$(curl ifconfig.co) claims that the machine is in Vaduz, Liechtenstein. However I would somewhat expect that there is something like an IP address that I can curl to get the cloudconfig and that that would contain the region and availability zone. curl freegeoip.net/xml/$(curl ifconfig.co) 1 Answer 1 Since Cloud Shell runs as a GCP VM, you can view your assigned region by running curl -H "Metadata-Flavor: Google" metadata/computeMetadata/v1/instance/zone inside the Cloud Shell session. This is documented in https://cloud.google.com/compute/docs/storing-retrieving-metadata. In general, it's worth keeping in mind that Cloud Shell is gl...