google-cloud-platform - GCP IAM : Binding role to Service Account fails

标签 google-cloud-platform google-iam

我已经从 GCP 控制台创建了一个 ServiceAccount 和一个自定义角色。

然而,当尝试关联它们时,失败如下:

gcloud projects add-iam-policy-binding my-project \
  --member serviceAccount:cloudrun-poc@my-project.iam.gserviceaccount.com \
  --role roles/MyCustomRole
ERROR: Policy modification failed. For a binding with condition, run "gcloud alpha iam policies lint-condition" to identify issues in condition.
ERROR: (gcloud.projects.add-iam-policy-binding) INVALID_ARGUMENT: Role roles/ClusterUpscaler is not supported for this resource.

有什么想法吗?

最佳答案

您可能需要 create角色 MyCustomRole 在尝试分配它之前。不知道它提示角色 ClusterUpscaler 是什么,但该项目中可能没有集群......此外,自定义角色通常具有类似的名称 projects/{project-id}/roles/{角色名称}。它们也可以被列出:

gcloud iam list-grantable-roles //cloudresourcemanager.googleapis.com/projects/PROJECT_ID

关于google-cloud-platform - GCP IAM : Binding role to Service Account fails,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58086499/

相关文章:

javascript - 如何在 Google Cloud Compute node.js getVMs 中使用正则表达式进行过滤

python - 云函数将 CSV 发送到云存储

azure - 从 Google 服务帐户模拟 Azure 服务主体

google-cloud-platform - 如何允许团队成员使用我的 Google Cloud Speech-to-Text API 帐户?

linux - Compute Engine Linux 用户及其与服务帐号的关系

airflow - 使用受 IAP 保护的应用验证 Google Composer http 调用任务

postgresql - 数据库部署和 Kubernetes 的重新创建策略会发生什么?

javascript - 如何使用 Google Cloud Function 高效删除旧的 Firebase Cloud 文档?

google-cloud-platform - SFTPoperator 获取多个文件

google-cloud-platform - Terraform:如何在不锁定自己的情况下使用 iam_policy