google-cloud-platform - 其他项目桶上的云函数存储触发

标签 google-cloud-platform google-cloud-storage google-cloud-functions

无法在其他项目下的存储桶上创建云函数触发器。

Deploying function (may take a while - up to 2 minutes)...failed.

ERROR: (gcloud.functions.deploy) OperationError: code=7, message=Insufficient permissions to (re)configure a trigger (permission denied for bucket ing-auto). Please, give owner permissions to the editor role of the bucket and try again.



对于云功能中使用的服务帐户,拥有对存储桶所在项目的所有者访问权限。

IE
有两个项目project-a和project-b。
云函数需要在中创建项目-a .
谷歌存储桶在项目-b 中。
服务帐号用户 服务用户 是项目-a 的一部分,拥有项目-b 的所有者访问权限,将用于执行云功能。
gcloud functions deploy hello_gcs --runtime python37 --trigger-resource bucket-from-other-project-xxx --trigger-event goog
le.storage.object.finalize

我能够在同一项目的存储桶上创建云函数存储触发器

最佳答案

这不可能。引用 Google Cloud Functions documentation :

Cloud Functions can only be triggered by Cloud Storage buckets in the same Google Cloud Platform project.



作为一种可能的解决方法,您可以将 Cloud Function 部署为 HTTP triggered .然后,在存储桶所属的项目中,部署另一个由 Cloud Storage 事件触发的 Cloud Function,并在其代码中进行 HTTP 调用以触发第一个 Cloud Function。

关于google-cloud-platform - 其他项目桶上的云函数存储触发,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55726854/

相关文章:

google-compute-engine - Google Compute Engine 磁盘快照与可重用镜像

python-3.x - 谷歌云功能错误与轮子和pywin32

kubernetes - 如何获取 StatefulSet Kubernetes 的副本数

google-app-engine - 正在提供的 Google App Engine 旧版本静态文件

google-cloud-platform - 将谷歌云功能从一个项目迁移到GCP中的另一个项目?

amazon-s3 - 将s3数据迁移到谷歌云存储

google-cloud-storage - 如何在已部署到Google Container Engine的容器中使用Google Cloud Storage?

google-cloud-storage - 无法创建存储桶

javascript - Firebase 云功能 - 连接错误

google-cloud-platform - 这些 Firebase Google Cloud Function `DEBUG` 严重性日志意味着什么?