I would like to know the organization ID of my current project in GCP.
gcloud projects describe PROJECT_ID
will show the parent
which can be the organization, but if the parent is a folder
, the organization ID does not appear.
I could recurse up the parent hierarchy of the folders using gcloud resource-manager folders describe FOLDER_ID
, but that is a hassle. It is also impossible if I do not have organization-level permissions.
Yet I do have access to organization IDs: gcloud organizations list
shows several organizations, though not their mapping to projects.
How can I achieve this?