我们开发了一个基于给定需求的云功能,并与第一代进行了初步验证,结果很好。但所需的修改不多,需要额外的处理时间。因此,我们不得不转向
下面是gcloud函数部署命令。
gcloud functions deploy gen2-function \
--entry-point gen2 --runtime python37 --trigger-http --allow-unauthenticated \
--service-account=<> --region=<> --project=<> --timeout=3600s --gen2
这个命令成功地部署了函数和内部云运行服务,但是它最终失败了,出现了以下错误
[INFO] A new revision will be deployed serving with 100% traffic.
ERROR: (gcloud.functions.deploy) PERMISSION_DENIED: Permission 'run.services.setIamPolicy' denied on resource 'projects/<project>/locations/<region>/services/gen2-function' (or resource may not exist).
当我们检查云运行时,服务名"gen2-function“确实存在。
有人能指点这个吗?
发布于 2022-08-11 06:49:08
部署函数的帐户缺少权限run.services.setIamPolicy
。指定命令参数--allow-unauthenticated
需要该权限。
该权限位于角色roles/run.admin
中。
请参阅关于如何在帐户中添加角色的本文档:
https://stackoverflow.com/questions/73315795
复制相似问题