I'd like to deploy the same cloud function(s) across multiple regions. Is there an easy way to do it?
Since you haven't said what type of function you want to deploy, I'll assume https function. It doesn't make sense to deploy any other type of (background) function to multiple regions, as each may trigger for each event, which would be fairly chaotic. With https functions, you'll have a different URL for each one
You can deploy two different functions with the same implementation to different regions:
function f(req, res) {
// your https function implementation here
}
exports.f_asia_northeast1 = functions
.region('asia-northeast1')
.https.onRequest(f);
exports.f_us_central1 = functions
.region('us-central1')
.https.onRequest(f);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With