GCP - Cloud Load BalancingWhich of the following is the correct JSON snippet to define a host rule in a GCP URL map?A{"pathMatchers": [{"hosts": ["example.com"], "pathMatcher": "pm1"}]}B{"hostRules": [{"paths": ["/home"], "backendService": "bs1"}]}C{"hostRules": [{"hosts": ["example.com"], "pathMatcher": "pm1"}]}D{"backendServices": [{"hosts": ["example.com"], "pathMatcher": "pm1"}]}Check Answer
Step-by-Step SolutionSolution:Step 1: Understand host rule structureHost rules map hosts to path matchers. The correct key is 'hostRules' with 'hosts' and 'pathMatcher' fields.Step 2: Check JSON keys and values{"hostRules": [{"hosts": ["example.com"], "pathMatcher": "pm1"}]} correctly uses 'hostRules' with 'hosts' array and 'pathMatcher' string. Others misuse keys or fields.Final Answer:Correct host rule JSON snippet -> Option CQuick Check:Host rule syntax = {"hostRules": [{"hosts": ["example.com"], "pathMatcher": "pm1"}]} [OK]Quick Trick: Host rules use 'hosts' and 'pathMatcher' keys [OK]Common Mistakes:Using 'paths' instead of 'hosts'Confusing 'backendService' with host ruleMisnaming keys like 'pathMatchers'
Master "Cloud Load Balancing" in GCP9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepVisualTryChallengeProjectRecallTime
More GCP Quizzes Cloud Functions - Function deployment and testing - Quiz 15hard Cloud IAM Advanced - Custom roles creation - Quiz 3easy Cloud IAM Advanced - VPC Service Controls - Quiz 7medium Cloud IAM Advanced - Policy troubleshooter - Quiz 10hard Cloud Load Balancing - SSL certificates management - Quiz 2easy Cloud Monitoring and Logging - Error Reporting - Quiz 4medium Cloud Monitoring and Logging - Log-based metrics - Quiz 14medium Cloud Run - Request-based auto scaling - Quiz 5medium Cloud SQL and Databases - Why managed databases matter - Quiz 9hard Cloud SQL and Databases - Backup and restore - Quiz 9hard