QuestionQ43

VerifiedIntegrating applications with Google Cloud services

You are using Cloud Run to host a web application. You need to securely retrieve the application project ID and the region in which the application is running, then display this information to users. You want the most performant approach. What should you do?

Explanation

Cloud Run’s instance metadata server supplies runtime details including the project ID and region. Accessing http://metadata.google.internal/ with the Metadata-Flavor: Google header retrieves this information directly from within the running container, without requiring a separate Google Cloud API call or manually maintained configuration.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!