Exam Professional Cloud Developer All QuestionsBrowse all questions from this exam
Question 86

You are developing an application that will be launched on Compute Engine instances into multiple distinct projects, each corresponding to the environments in your software development process (development, QA, staging, and production). The instances in each project have the same application code but a different configuration. During deployment, each instance should receive the application's configuration based on the environment it serves. You want to minimize the number of steps to configure this flow. What should you do?

    Correct Answer: B

    The most efficient approach is to configure a metadata key named 'environment' in each project, with a value corresponding to the environment it serves (e.g., development, QA, staging, or production). This allows the deployment tool to query the instance metadata and configure the application based on the 'environment' value. This setup minimizes the number of steps required, as the metadata key only needs to be set once per project, rather than for each instance, and simplifies the configuration flow.

Discussion
scaenruyOption: B

I vote B

KillerGoogleOption: D

D, 'environment' is not in one of the default key https://cloud.google.com/compute/docs/metadata/default-metadata-values

GCPCloudArchitectUserOption: B

For Answer D : Question says minimize steps and adding metadata to each instance seems longer route ?

omermahgoubOption: B

Option A, configuring a startup script using the gcloud command to determine the project name, is not a feasible solution because it requires additional steps to be taken during instance launch. Option C, deploying a deployment tool on an instance in each project and using a deployment job to retrieve the appropriate configuration file, is not a feasible solution because it requires additional steps to be taken during instance launch and involves the use of a separate deployment tool. Option D, configuring an instance custom-metadata key named "environment" during each instance launch, is not a feasible solution because it requires additional steps to be taken during instance launch.

omermahgoub

Answer is B You can configure a metadata key named "environment" in each project, with a value corresponding to the environment it serves (development, QA, staging, or production). Then, you can use your deployment tool to query the instance metadata and configure the application based on the "environment" value. This allows you to minimize the number of steps to configure the flow, as you only need to set the "environment" value in each project and use your deployment tool to query the metadata.

tomato123Option: B

B is correct

nqthien041292Option: B

Vote B

jitu028Option: B

Answer should be B

thewalkerOption: D

The best answer is D. During each instance launch, configure an instance custom-metadata key named ‘environment’ whose value is the environment the instance serves. Use your deployment tool to query the instance metadata, and configure the application based on the ‘environment’ value. Here's why: Simplicity and Efficiency: This approach is the most straightforward and efficient. It leverages existing Compute Engine features (custom metadata) and avoids the need for additional scripts or deployment tools. Centralized Configuration: Custom metadata is associated with the instance itself, making it a centralized and reliable source of environment information. Flexibility: Your deployment tool can easily query the instance metadata during deployment, allowing you to dynamically configure the application based on the environment.

thewalker

Let's analyze why the other options are less ideal: A. Startup script using gcloud command: While startup scripts can be used, they require additional code and complexity. They also rely on the project name, which might not be the most reliable way to determine the environment. B. Metadata key ‘environment’ in each project: This approach requires configuring the metadata key in each project, which can be tedious and error-prone. It also doesn't provide a centralized way to manage environment information. C. Deployment tool on an instance in each project: This approach introduces additional complexity and overhead. It requires deploying and managing a separate deployment tool in each project, which can be challenging to maintain.

wanrltwOption: B

https://cloud.google.com/compute/docs/metadata/setting-custom-metadata#set-custom-project-wide-metadata

RajanOption: B

Option B is correct we usually put this details in Environment variable.

zellckOption: B

B is the answer. https://cloud.google.com/compute/docs/metadata/setting-custom-metadata#set-custom

TNT87

https://cloud.google.com/compute/docs/metadata/querying-metadata

TNT87

https://cloud.google.com/compute/docs/metadata/setting-custom-metadata#set-custom

[Removed]

Did you take the exam?