Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 86 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 86
Topic #: 1
[All Professional Cloud Developer Questions]

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?

  • A. When creating your instances, configure a startup script using the gcloud command to determine the project name that indicates the correct environment.
  • B. In each project, configure a metadata key ג€environmentג€ whose value is the environment it serves. Use your deployment tool to query the instance metadata and configure the application based on the ג€environmentג€ value.
  • C. Deploy your chosen deployment tool on an instance in each project. Use a deployment job to retrieve the appropriate configuration file from your version control system, and apply the configuration when deploying the application on each instance.
  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
thewalker
4 months, 1 week ago
Selected Answer: 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.
upvoted 1 times
thewalker
4 months, 1 week ago
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.
upvoted 1 times
...
...
wanrltw
1 year ago
Selected Answer: B
https://cloud.google.com/compute/docs/metadata/setting-custom-metadata#set-custom-project-wide-metadata
upvoted 1 times
...
__rajan__
1 year, 2 months ago
Selected Answer: B
Option B is correct we usually put this details in Environment variable.
upvoted 1 times
...
omermahgoub
1 year, 10 months ago
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.
upvoted 2 times
omermahgoub
1 year, 10 months ago
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.
upvoted 2 times
...
...
zellck
1 year, 11 months ago
Selected Answer: B
B is the answer. https://cloud.google.com/compute/docs/metadata/setting-custom-metadata#set-custom
upvoted 1 times
...
TNT87
2 years ago
https://cloud.google.com/compute/docs/metadata/querying-metadata
upvoted 1 times
TNT87
2 years ago
https://cloud.google.com/compute/docs/metadata/setting-custom-metadata#set-custom
upvoted 1 times
[Removed]
2 years ago
Did you take the exam?
upvoted 1 times
...
...
...
tomato123
2 years, 3 months ago
Selected Answer: B
B is correct
upvoted 2 times
...
nqthien041292
2 years, 7 months ago
Selected Answer: B
Vote B
upvoted 2 times
...
jitu028
2 years, 7 months ago
Answer should be B
upvoted 2 times
...
KillerGoogle
2 years, 9 months ago
D, 'environment' is not in one of the default key https://cloud.google.com/compute/docs/metadata/default-metadata-values
upvoted 3 times
...
GCPCloudArchitectUser
2 years, 9 months ago
For Answer D : Question says minimize steps and adding metadata to each instance seems longer route ?
upvoted 3 times
...
scaenruy
2 years, 10 months ago
I vote B
upvoted 4 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...