0
0
GCPcloud~10 mins

URL maps for routing in GCP - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a URL map that directs traffic to a backend service.

GCP
gcloud compute url-maps create my-url-map --default-service [1]
Drag options to blanks, or click blank then click option'
Amy-backend-service
Bmy-firewall-rule
Cmy-instance-group
Dmy-network
Attempts:
3 left
💡 Hint
Common Mistakes
Using an instance group instead of a backend service.
Confusing firewall rules or networks as routing targets.
2fill in blank
medium

Complete the code to add a path matcher to the URL map for routing based on URL paths.

GCP
gcloud compute url-maps add-path-matcher my-url-map --default-service my-backend-service --path-matcher-name [1] --path-rules "/images/*=image-backend,/videos/*=video-backend"
Drag options to blanks, or click blank then click option'
Adefault-matcher
Bbackend-service
Cpath-matcher-1
Durl-map
Attempts:
3 left
💡 Hint
Common Mistakes
Using reserved or generic names that do not identify the path matcher.
Confusing the path matcher name with backend service names.
3fill in blank
hard

Fix the error in the command to create a URL map with a host rule.

GCP
gcloud compute url-maps create my-url-map --default-service my-backend-service --host-rules [1]
Drag options to blanks, or click blank then click option'
A"hosts=example.com,pathMatcher=path-matcher-1"
Bhosts=example.com,pathMatcher=path-matcher-1
C"host=example.com,pathMatcher=path-matcher-1"
Dhost=example.com,pathMatcher=path-matcher-1
Attempts:
3 left
💡 Hint
Common Mistakes
Not quoting the host rule string.
Using 'host' instead of 'hosts' in the key.
4fill in blank
hard

Fill both blanks to define a URL map with a host rule and a path matcher.

GCP
gcloud compute url-maps create my-url-map --default-service [1] --host-rules "hosts=[2],pathMatcher=path-matcher-1"
Drag options to blanks, or click blank then click option'
Adefault-backend
Bexample.com
Cmy-backend-service
Dtest.com
Attempts:
3 left
💡 Hint
Common Mistakes
Using a domain name as the default service.
Using an incorrect or unrelated hostname in the host rule.
5fill in blank
hard

Fill all three blanks to add a path matcher with path rules to an existing URL map.

GCP
gcloud compute url-maps add-path-matcher my-url-map --path-matcher-name [1] --default-service [2] --path-rules "/api/*=[3]"
Drag options to blanks, or click blank then click option'
Aapi-matcher
Bapi-backend
Cbackend-api
Ddefault-backend
Attempts:
3 left
💡 Hint
Common Mistakes
Using inconsistent backend service names between default and path rules.
Choosing generic or unrelated names for the path matcher.