nerdexam
Google

PROFESSIONAL-CLOUD-DEVELOPER · Question #229

You are responsible for deploying a new API. That API will have three different URL paths: - https://yourcompany.com/students - https://yourcompany.com/teachers - https://yourcompany.com/classes You n

The correct answer is D. Create three Cloud Functions as three backend services exposed using an HTTPS load balancer.. An HTTPS load balancer with a URL map allows path-based routing rules (e.g., /students → function-A, /teachers → function-B, /classes → function-C) all under a single domain (yourcompany.com). Each Cloud Function is configured as a separate serverless NEG (Network Endpoint Group)

Developing and Deploying Applications

Question

You are responsible for deploying a new API. That API will have three different URL paths:

You need to configure each API URL path to invoke a different function in your code. What should you do?

Options

  • ACreate one Cloud Function as a backend service exposed using an HTTPS load balancer.
  • BCreate three Cloud Functions exposed directly.
  • CCreate one Cloud Function exposed directly.
  • DCreate three Cloud Functions as three backend services exposed using an HTTPS load balancer.

How the community answered

(47 responses)
  • A
    9% (4)
  • B
    2% (1)
  • C
    4% (2)
  • D
    85% (40)

Explanation

An HTTPS load balancer with a URL map allows path-based routing rules (e.g., /students → function-A, /teachers → function-B, /classes → function-C) all under a single domain (yourcompany.com). Each Cloud Function is configured as a separate serverless NEG (Network Endpoint Group) backend service. This is the only option that keeps all three paths on one domain while dispatching to separate function implementations. Three directly-exposed Cloud Functions (B) each get their own unique Cloud Functions URL - you cannot make them appear under the same custom domain path without a load balancer. One function (A or C) would require internal routing logic inside a single function rather than true independent function separation, and cannot cleanly satisfy the path-to-function mapping requirement at the infrastructure level.

Topics

#Cloud Functions#HTTPS Load Balancer#API Deployment#Path-based Routing

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice