From 4513d7de0a02cd440f7be2bb5786a43ad3208ffc Mon Sep 17 00:00:00 2001 From: Ben Swenka Date: Wed, 14 Feb 2024 12:12:48 -0700 Subject: [PATCH] Updated path matchers to be more user friendly, added better test examples in README.md --- blueprints/networking/psc-glb-and-armor/README.md | 9 ++++++++- blueprints/networking/psc-glb-and-armor/consumer.tf | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/blueprints/networking/psc-glb-and-armor/README.md b/blueprints/networking/psc-glb-and-armor/README.md index 78277647..fb2ba241 100644 --- a/blueprints/networking/psc-glb-and-armor/README.md +++ b/blueprints/networking/psc-glb-and-armor/README.md @@ -84,7 +84,14 @@ __Congratulations__! You have successfully deployed an HTTP Load Balancer with C You can simply invoke the service by calling - curl -H "Authorization: Bearer $(gcloud auth print-identity-token)" -H "Content-Type: application/json" http://$LB_IP + Check the default path: + curl -H "Authorization: Bearer $(gcloud auth print-identity-token)" -H "Content-Type: application/json" http://$LB_IP/anything + + Specifically call the producer A path: + curl -H "Authorization: Bearer $(gcloud auth print-identity-token)" -H "Content-Type: application/json" http://$LB_IP/anything/a/* + + Specifically call the producer B path: + curl -H "Authorization: Bearer $(gcloud auth print-identity-token)" -H "Content-Type: application/json" http://$LB_IP/anything/b/* ## Cleaning up your environment diff --git a/blueprints/networking/psc-glb-and-armor/consumer.tf b/blueprints/networking/psc-glb-and-armor/consumer.tf index 19e56321..cae72245 100644 --- a/blueprints/networking/psc-glb-and-armor/consumer.tf +++ b/blueprints/networking/psc-glb-and-armor/consumer.tf @@ -89,12 +89,12 @@ resource "google_compute_url_map" "default" { default_service = google_compute_backend_service.backend-a.id path_rule { - paths = ["/b/*"] + paths = ["/anything/b/*"] service = google_compute_backend_service.backend-b.id } path_rule { - paths = ["/*"] + paths = ["/anything/a/*"] service = google_compute_backend_service.backend-a.id } }