google-cloud-platformdnsgoogle-cloud-functionscustom-domain

Point custom domain to GCP cloud function without Firebase


Has anyone found a way to point a custom domain to a GCP cloud function without using Firebase? I have a series of cloud functions in a repo already configured to work with Cloud Build CI/CD. Everything is running great, all I need to add is the vanity domain to mask the default trigger URLs. The last thing I want to do is restructure the whole project to fit in with Firebase's sugary way of doing things just to enable this one little thing.

This is straightforward to do in AWS without having to resort to their "easy to use" abstraction products like EB, so I'm not sure why GCP wouldn't expose this more clearly if it's possible.


Solution

  • Looks like there is a way, load balancing to a Cloud Function backend was made possible last year.

    https://cloud.google.com/blog/products/networking/better-load-balancing-for-app-engine-cloud-run-and-functions

    You need to create a serverless endpoint network group in the process but no big deal.

    Would be great if the docs pointed one down this road as well, as opposed to just using Firebase hosting.