GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice question 14 of 35
You are developing an application that will be launched on Compute Engine instances into multiple distinct projects, each corresponding to the…
Full set: 265 questionsThe most efficient and scalable solution is to use project-wide custom metadata. By setting a metadata key-value pair (e.g., environment: production) at the project level, all Compute Engine instances within that project automatically inherit this metadata. An application or a startup script on any instance can then query the metadata server to retrieve the value of the "environment" key. This approach minimizes configuration steps because the metadata is set only once per project, rather than for each individual instance, and it decouples the configuration from potentially brittle conventions like project naming.
A. This is less robust than using dedicated metadata. It creates a dependency on project naming conventions, which might change or not be consistently applied, making the solution brittle.
C. This option is incomplete. It describes a deployment process but fails to address the core problem of how the deployment tool will determine which environment's configuration to apply.
D. This approach is less efficient than using project-wide metadata. It requires configuring the metadata for every single instance at launch, which is more steps and more error-prone than setting it once for the entire project.
1. Official Google Cloud Documentation - Storing and retrieving metadata:
Source: Google Cloud Documentation, "About VM metadata".
Reference: In the "Types of metadata" section, it states: "You can set custom metadata for a project and for an instance. Metadata that you set at the project level is available to all of the virtual machine (VM) instances in that project." This directly supports the efficiency and inheritance model of option B.
Link: https://cloud.google.com/compute/docs/metadata/overview#custom-metadata
2. Official Google Cloud Documentation - Setting custom project-wide metadata:
Source: Google Cloud Documentation, "Set custom metadata".
Reference: The section "Set project-wide custom metadata" provides the gcloud compute project-info add-metadata command. This demonstrates the single action required per project, confirming that it minimizes configuration steps for an entire environment, as required by the question.
Link: https://cloud.google.com/compute/docs/metadata/set-custom-metadata#set-project-wide-custom-metadata
Keep practicing
Take the free GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice test
Ten exam-style questions with answers and explanations, plus the exam facts and study guides.
More questions
Other GOOGLE-PROFESSIONAL-CLOUD-DEVELOPER practice questions
- Question 1You have an application controlled by a managed instance group. When you deploy a new ver…
- Question 2Your service adds text to images that it reads from Cloud Storage. During busy times of t…
- Question 3You have been tasked with planning the migration of your company’s application from on-pr…
- Question 4You plan to make a simple HTML application available on the internet. This site keeps inf…
- Question 5HipLocal's APIs are showing occasional failures, but they cannot find a pattern. They wan…
- Question 6Your company has created an application that uploads a report to a Cloud Storage bucket. …
