我希望 Firestore DB 和我的 Firebase 函数都位于 EU3 区域
目前firestore数据库是EU3 firebase 函数自动部署到 US1
有办法改变吗?
最佳答案
创建 Firebase 项目时,您必须选择 Cloud Firestore 和/或实时数据库的区域。一旦创建了这些资源,就无法更改它们。
您的 Cloud Functions 的区域在代码中指定 - 默认情况下为 us-central1
。您可以像这样轻松更改它( see docs ):
// Example of a Cloud Function trigger for a delete event in RTDB:
functions
.runWith({ memory: '512MB', timeoutSeconds: 30 })
.region('europe-west1') // this specifies the region
.database.ref('/documents/{documentId}/users')
.onDelete(...);
要查看哪些区域可用,have a look here in the docs .
对于您的情况,如果您想在靠近数据库的位置执行 Cloud Functions,请将区域更改为 europe-west1
。
关于firebase - 为什么我的项目 firestore 是 eu3,但 firebase 云功能位置是 US1?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/72110100/