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! Go to 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)
Hi @dumpalap ,
I'm not quite sure what you meant by adding path rules "dynamically".
But if the intent is to edit the URL map to add or change the path rules, you might find this command useful:
gcloud compute url-maps edit <map>
The command opens the map in a text editor. Make the necessary changes and save them.
Doc: https://cloud.google.com/sdk/gcloud/reference/compute/url-maps/edit
Hi @kumards ,
Thanks for the response. I have gone thru the command which you have given. This opens a editor to add the rules. My scenario will run in a release pipeline and I can not take an approach of interactive editor.
One option I am thinking is edit the yaml content in command line and import it. But want to check if there is any better way.
Regards,
Pradeep
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)
Hi @kumards ,
Thanks for providing the details. I am trying with client library and it looks like we can achieve this with some tweaking. But I am keep getting the error in update action.
Action:
"Required field 'resource.fingerprint' not specified". Details: "[{'message': "Required field 'resource.fingerprint' not specified", 'domain': 'global', 'reason': 'required'}]">
My JSON request is having fingerprint in it. please see the below screen print.
Please let me know if you have any clue ?
Regards,
Pradeep
Hi @kumards , please ignore my earlier message.