Google Cloud IAM中缺少Cloud Function用户代理角色

乔·洛里

我正在一个Google Cloud项目中处理一系列Cloud Functions,由于某种原因,我突然收到此错误:

Deployment failure:
Missing necessary permission resourcemanager.projects.getIamPolicy for [email protected] on resource projects/la-cloud-functions. Please grant [email protected] the Cloud Functions Service Agent role. You can do that by running 'gcloud iam service-accounts add-iam-policy-binding projects/la-cloud-functions --member=service-1092904037961@gcf-admin-robot.iam.gserviceaccount.com --role=Cloud Functions Service Agent'

当我尝试运行修订的命令时,除了格式错误的错误响应(您不能拥有--role=Cloud Functions Service Agent-应该是--role=roles/cloudfunctions.serviceAgent)之外,还包括:

gcloud iam service-accounts add-iam-policy-binding projects/la-cloud-functions --member=service-1092904037961@gcf-admin-robot.iam.gserviceaccount.com --role=roles/cloudfunctions.serviceAgent

我收到此错误:

The requested URL <code>/v1/projects/la-cloud-functions/serviceAccounts/projects/la-cloud-functions:getIamPolicy?alt=json</code> was not found on this server.

最后,尝试通过控制台分配Cloud Functions Server Agent角色给了我另一个惊喜-该角色从列表中丢失了,应该在服务管理下:

在此处输入图片说明

我尝试通过使用以下命令重新启用Cloud Functions API来重置服务帐户:

gcloud services enable cloudfunctions.googleapis.com

但同样,没有成功。

任何人都对如何解决此问题并使Cloud Functions Service Agent角色再次可用有任何想法?

TIA-乔

约翰·汉利

请尝试以下步骤解决此问题:

禁用云功能API:

gcloud services disable cloudfunctions.googleapis.com --project la-cloud-functions

等待约一分钟,以完成禁用。

使用CLI或IAM下的GCP控制台删除云功能成员帐户。

gcloud projects remove-iam-policy-binding la-cloud-functions --member="serviceAccount:[email protected]" --role="roles/cloudfunctions.serviceAgent"

等一下 然后,验证该成员已在IAM下的GCP控制台中删除。

启用Cloud Functions API:

gcloud services enable cloudfunctions.googleapis.com --project la-cloud-functions

返回GCP控制台。您应该找到一个新的Google Cloud Functions Service代理成员。

注意:

您使用错误的命令添加cloudfunctions.serviceAgent这是正确的命令:

gcloud projects add-iam-policy-binding la-cloud-functions --member="serviceAccount:[email protected]" --role="roles/cloudfunctions.serviceAgent"

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

使用不在IAM中的用户创建的Google Cloud Resource

在Google Cloud IAM中跟踪用户权限

代理Google Cloud端点

Google Cloud Platform中另一个用户的IAM权限重复

Google Cloud Function:支持Google Cloud KMS

Google Cloud Function + Python

Google Cloud IAM权限问题

无法通过 Google Cloud Platform 中的 api 为角色/编辑器用户添加用户

Python中的Google Cloud Function:TypeError:post_tweet()缺少1个必需的位置参数:“ context”

Google Cloud-Google Cloud功能的出口IP / NAT /代理

从Cloud Function(Python)写入Google Cloud Storage

在Google Cloud Function中运行gsutil命令

在 Google Cloud Function 中包含 NLTK

在Google Cloud Function中调用Promise函数

使用Cloud IAM限制对Google Cloud Platform中App Engine的访问

google-cloud:0.18.0-alpha 中缺少类

Google Cloud Translate API中缺少“ translate.js”

想要通过terraform针对服务帐户分配多个Google Cloud IAM角色

Google Cloud Logging API-某些日志条目的审核日志中缺少身份验证(用户)信息

无法调用 Google Cloud Function

Google Cloud Function部署失败

限制对Google Cloud Function的访问

未能创建 Google Cloud Function

服务帐户角色以部署Google Cloud功能

如何使用Google Cloud IAM角色使用Google OAuth进行基于角色的Web应用程序控制

在哪里启动 Google Cloud SQL 代理?

在Google Cloud Datastore和Google Cloud Bigtable中存储用户事件历史记录

如何通过 Pandas 从 Google Cloud Function 中的 Google Cloud Storage 访问 csv 文件?

Google Cloud:如何为服务用户添加角色到单个存储桶?