【问题标题】:Appengine gcloud deploy using custom service accountAppengine gcloud 使用自定义服务帐户部署
【发布时间】:2021-10-24 19:46:51
【问题描述】:

我想将 API 部署到应用引擎,但最终使用了错误的服务帐户。 我在 gitlab 中使用这 3 条 cmd 行:

 - gcloud auth activate-service-account --key-file /tmp/$CI_PIPELINE_ID.json
 - gcloud config set account NameOfServiceAccount.com
 - gcloud app deploy

我得到的是

target service account:      [App Engine default service account]
Do you want to continue (Y/n)?  
Beginning deployment of service [lettering-back]...
╔════════════════════════════════════════════════════════════╗
╠═ Uploading 2 files to Google Cloud Storage                ═╣
╚════════════════════════════════════════════════════════════╝
File upload done.
ERROR: (gcloud.app.deploy) PERMISSION_DENIED: You do not have permission to act as

【问题讨论】:

    标签: google-app-engine google-cloud-platform gcloud


    【解决方案1】:

    要部署新版本,成员必须拥有服务帐户用户 App Engine 默认服务上的 (roles/iam.serviceAccountUser) 角色 帐户和 Cloud Build 编辑器 (roles/cloudbuild.builds.editor) 和云存储对象管理员 (roles/storage.objectAdmin) 角色 项目。

    更具体地说,对于您的错误消息,您需要在您的服务帐户上使用 roles/iam.serviceAccountUser,其密钥是您放置在 /tmp/$CI_PIPELINE_ID.json 的密钥

    参考:https://cloud.google.com/appengine/docs/standard/python/roles#predefined_roles 处的第一行表格

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-09-09
      • 1970-01-01
      • 1970-01-01
      • 2022-11-15
      • 2019-10-20
      • 2020-03-22
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多