Complete the code to specify the protocol used by the HTTP(S) Load Balancer.
load_balancer = compute.loadBalancers().insert(project=project_id, body={"protocol": "[1]"})The HTTP(S) Load Balancer uses the HTTP protocol at Layer 7 to route requests.
Complete the code to define the backend service for the HTTP(S) Load Balancer.
backend_service = compute.backendServices().insert(project=project_id, body={"name": "my-backend", "protocol": "[1]"})The backend service for an HTTP(S) Load Balancer must use the HTTP protocol to handle Layer 7 traffic.
Fix the error in the URL map configuration for routing HTTP requests.
url_map = compute.urlMaps().insert(project=project_id, body={"defaultService": "[1]"})The correct key for specifying the backend service in a URL map is 'backendService' in camelCase.
Fill both blanks to create a health check configuration for the HTTP(S) Load Balancer.
health_check = compute.healthChecks().insert(project=project_id, body={"type": "HTTP", "port": [1], "requestPath": "[2]"})HTTP health checks typically use port 80 and a path like '/healthz' to verify backend health.
Fill all three blanks to define a URL map with path matcher and host rule for the HTTP(S) Load Balancer.
url_map = compute.urlMaps().insert(project=project_id, body={"hostRules": [{"hosts": ["[1]"], "pathMatcher": "[2]"}], "pathMatchers": [{"name": "[3]", "defaultService": backend_service_url}]})The host rule uses the domain 'example.com', and the path matcher name must match between hostRules and pathMatchers, here 'path-matcher-1'.