Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

HTTPS Load Balancer add host path rules using gcloud

Hi All,

I have a requirement to create / updated the HTTPS load balancer dynamically with different host path rules (Serverless NEG as backends)

 

I have created a url-map for the 1st time using below command 

gcloud compute url-maps add-path-matcher test-lb --path-matcher-name=test-path-match --default-service=my-neg-be --path-rules="/path_1=my-neg-be,/path_1/*=my-neg-be" --new-hosts=test.mydomain.com

Now I wanted to add subsequent path rules dynamically using gcloud during a deployment. So have I am unable to find a gcloud command qcloud command which can be used to add subsequent path rules.

Just want to check if anyone have thoughts around this. thank you.

 

Regards,

Pradeep

Solved Solved
0 6 3,892
1 ACCEPTED SOLUTION

Thanks for clarifying the requirement, Pradeep! I agree that the interactive approach offered by `gcloud compute url-maps edit` won't be useful for automated/programmatic updates. I wonder whether you could use a client library  (examples: https://cloud.google.com/compute/docs/reference/rest/v1/urlMaps/update#examples)

View solution in original post