Bird
0
0

You wrote this URL map snippet but get an error when deploying:

medium📝 Debug Q6 of 15
GCP - Cloud Load Balancing
You wrote this URL map snippet but get an error when deploying:

{
"hostRules": [{"hosts": ["example.com"], "pathMatcher": "pm1"}],
"pathMatchers": [{"name": "pm1", "defaultService": "backend-default", "pathRules": [{"paths": "/home", "service": "backend-home"}]}]
}

What is the error?
A"service" should be "backendService"
B"paths" should be an array, not a string
C"hostRules" must include "defaultService"
D"pathMatcher" name must be "default"
Step-by-Step Solution
Solution:
  1. Step 1: Check 'paths' field format

    The 'paths' field must be an array of strings, but here it is a single string.
  2. Step 2: Validate other fields

    Other fields like 'service' and 'pathMatcher' are correct; 'hostRules' does not require 'defaultService'.
  3. Final Answer:

    "paths" should be an array, not a string -> Option B
  4. Quick Check:

    Paths must be array format [OK]
Quick Trick: Paths always use array brackets [] [OK]
Common Mistakes:
  • Using string instead of array for paths
  • Wrong key names for backend service
  • Adding unnecessary defaultService in hostRules

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More GCP Quizzes