Topic 1 Question 199
You are using Cloud Run to host a web application. You need to securely obtain the application project ID and region where the application is running and display this information to users. You want to use the most performant approach. What should you do?
Use HTTP requests to query the available metadata server at the http://metadata.google.internal/ endpoint with the Metadata-Flavor: Google header.
In the Google Cloud console, navigate to the Project Dashboard and gather configuration details. Navigate to the Cloud Run “Variables & Secrets” tab, and add the desired environment variables in Key:Value format.
In the Google Cloud console, navigate to the Project Dashboard and gather configuration details. Write the application configuration information to Cloud Run's in-memory container filesystem.
Make an API call to the Cloud Asset Inventory API from the application and format the request to include instance metadata.
ユーザの投票
コメント(6)
- 正解だと思う選択肢: A
Definitely A, it's clear in the docs.
https://cloud.google.com/run/docs/container-contract#metadata-server
👍 2micoams2022/12/19 - 正解だと思う選択肢: B
voting B because is not A since thats compute metadata, if you can access you can query project id but not the region necessarily from cloud run but gce is not D since you cannot query project id C is too manual and static so by discard I guess is B
👍 1melisargh2022/12/11 - 正解だと思う選択肢: A
A is the answer.
https://cloud.google.com/run/docs/container-contract#metadata-server Cloud Run container instances expose a metadata server that you can use to retrieve details about your container instance, such as the project ID, region, instance ID or service accounts.
You can access this data from the metadata server using simple HTTP requests to the http://metadata.google.internal/ endpoint with the Metadata-Flavor: Google header: no client libraries are required.
👍 1zellck2022/12/13
シャッフルモード