Google Cloud Professional Cloud Developer — Question 154
Your application is composed of a set of loosely coupled services orchestrated by code executed on Compute Engine. You want your application to easily bring up new Compute Engine instances that find and use a specific version of a service. How should this be configured?
Answer options
- A. Define your service endpoint information as metadata that is retrieved at runtime and used to connect to the desired service.
- B. Define your service endpoint information as label data that is retrieved at runtime and used to connect to the desired service.
- C. Define your service endpoint information to be retrieved from an environment variable at runtime and used to connect to the desired service.
- D. Define your service to use a fixed hostname and port to connect to the desired service. Replace the service at the endpoint with your new version.
Correct answer: A
Explanation
Option A is correct because using metadata allows instances to dynamically retrieve the necessary endpoint information at runtime, facilitating updates to the service version. The other options do not provide the same level of flexibility, as labels and environment variables may not be as suitable for dynamic service discovery, while a fixed hostname restricts the ability to update services without additional configuration.