Google Professional Cloud Network Engineer Question 414
Single answerGoogle Cloud PlatformYou are configuring a Google Cloud HTTP(S) Load Balancer for a web application that serves two types of content: static assets (e.g., images, CSS files) and dynamic content (e.g., API responses). The static assets are stored in a Cloud Storage bucket, while the dynamic content is served by a backend service hosted on Compute Engine instances. You need to configure URL maps to ensure requests to '/static/*' are routed to the Cloud Storage bucket, and all other requests are routed to the Compute Engine backend service. Which type of URL map configuration should you use?
- A
Create a URL map with a default backend service pointing to the Compute Engine instances and a path matcher for '/static/*' pointing to the Cloud Storage bucket.
- B
Create two separate URL maps: one for the Cloud Storage bucket and another for the Compute Engine instances, and configure the load balancer to use both URL maps.
- C
Create a URL map with a default backend service pointing to the Cloud Storage bucket and a path matcher for '/static/*' pointing to the Compute Engine instances.
- D
Create a URL map with a single backend service pointing to the Compute Engine instances and use Cloud Functions to serve static assets from the Cloud Storage bucket.
Show answer and explanation
Correct answer: A
Explanation
To configure the HTTP(S) Load Balancer for this scenario, you need to create a single URL map that specifies routing rules. The default backend service should handle dynamic content, while a path matcher for '/static/*' should route requests to the Cloud Storage bucket. This ensures that traffic is properly distributed based on the content type.
- A. Correct.
This is the correct answer. A URL map can use a default backend service for all traffic and define path matchers for specific routes (e.g., '/static/*') to override the default behavior.
- B. Incorrect.
This is incorrect. You cannot use multiple URL maps in a single load balancer. Each load balancer uses one URL map to determine how requests are routed.
- C. Incorrect.
This is incorrect. The default backend service should point to the Compute Engine instances, not the Cloud Storage bucket, since dynamic content is served more broadly.
- D. Incorrect.
This is incorrect. A single backend service cannot handle both the dynamic content and static assets in this scenario, and Cloud Functions are not necessary for serving static assets from a Cloud Storage bucket.