Search code examples
firebasegoogle-cloud-platformgoogle-cloud-functionsload-balancingurl-masking

How to properly create URL Masking for Cloud Functions to create a NEG?


I'm trying to protect my Firebase Cloud Functions with Cloud Armor so I'm trying to setup Load Balancer. I created a Backend and added a Serverless Network Endpoint Group. In this panel, I can select only one cloud function but I have more than one cloud function so I have to use other option which is URL masking.

I'm following this guide: https://cloud.google.com/load-balancing/docs/https/setting-up-https-serverless#using-url-mask

Problem is:

When I try URL masking like this:

us-central1-myproject-a123b.cloudfunctions.net/<function>

It doesn't work like this. I've readed official guides about NEG and URL masking but I really don't understand how can I create a serverless network endpoint group containing all my cloud functions with an URL containing <function>.


Solution

  • As described in the documentation, if the pattern is <your function URL>/<functionName> (that is your case us-central1-myproject-a123b.cloudfunctions.net/<function>), you have to set /<function> in the url mask