Reputation: 140
Even though it was not documented here, I think the GOOGLE_CLOUD_PROJECT
environment variable used to be defined inside the container but it is not anymore
I can even find it referenced in code here:
project := os.Getenv("GOOGLE_CLOUD_PROJECT")
Where can I find my project id?
Upvotes: 4
Views: 3721
Reputation: 15266
If we look at Container instance metadata server, which is in the Cloud Run docs, we see an explicit reference to this being the mechanism to determine your own environment including Project Id and service accounts.
Upvotes: 5