发送反馈
授予 App Engine 访问权限的角色
bookmark_border bookmark
使用集合让一切井井有条
根据您的偏好保存内容并对其进行分类。
角色决定了哪些服务和操作可供某一用户账号或服务账号使用。以下类型的角色可授予对 App Engine 的访问权限:
基本角色 :适用于项目中的所有服务和资源,包括但不限于 App Engine。例如,具有 Editor 角色的账号可以更改 App Engine 设置以及 Cloud Storage 设置。
预定义 App Engine 角色 ,提供对 App Engine 的精细访问权限。Google Cloud 项目中的每项服务都具有自己的预定义角色。例如,仅具有 App Engine Deployer 角色的账号可以部署 App Engine 应用,但无法在 Cloud Storage 中查看或创建对象。此类账号还需要具有特定的 Cloud Storage 预定义角色 才能在 Cloud Storage 中创建或查看对象。
自定义角色 :根据您指定的权限列表提供精细访问权限。
在处理需求不太复杂的小型项目时,您可以使用基本角色。如需实现更精细的访问权限控制,请使用预定义角色。
基本角色
基本角色适用于项目中的所有服务和资源。例如,具有 Editor 角色的账号可以更改 App Engine 设置以及 Cloud Storage 设置。
角色
Google Cloud 控制台权限
工具权限
Owner
如需创建 App Engine 应用,必须具有此角色。该角色拥有 Viewer 和 Editor 的所有权限,还可以查看已部署的源代码、邀请用户、更改用户角色以及删除应用。
如需创建 App Engine 应用,必须具有此角色。还可以部署应用代码和更新所有配置。
Editor
该角色可以查看应用信息和修改应用设置。
该角色可以部署应用代码以及更新索引/队列/Cron。
Viewer
该角色可以查看应用信息。
该角色可以请求日志
预定义 App Engine 角色
Role
Permissions
App Engine Admin
(roles/appengine.appAdmin
)
Read/Write/Modify access to all application configuration and settings.
To deploy new versions, a principal must have the
Service Account User
(roles/iam.serviceAccountUser
) role on the assigned App Engine
service account , and the Cloud Build Editor
(roles/cloudbuild.builds.editor
), and Cloud Storage Object Admin
(roles/storage.objectAdmin
) roles on the project.
Lowest-level resources where you can grant this role:
appengine.applications.get
appengine.applications.listRuntimes
appengine.applications.update
appengine.instances.*
appengine.instances.delete
appengine.instances.enableDebug
appengine.instances.get
appengine.instances.list
appengine.memcache.addKey
appengine.memcache.flush
appengine.memcache.get
appengine.memcache.update
appengine.operations.*
appengine.operations.get
appengine.operations.list
appengine.runtimes.actAsAdmin
appengine.services.*
appengine.services.delete
appengine.services.get
appengine.services.list
appengine.services.update
appengine.versions.create
appengine.versions.delete
appengine.versions.get
appengine.versions.list
appengine.versions.update
artifactregistry.projectsettings.get
resourcemanager.projects.get
resourcemanager.projects.list
App Engine Creator
(roles/appengine.appCreator
)
Ability to create the App Engine resource for the project.
Lowest-level resources where you can grant this role:
appengine.applications.create
resourcemanager.projects.get
resourcemanager.projects.list
App Engine Viewer
(roles/appengine.appViewer
)
Read-only access to all application configuration and settings.
Lowest-level resources where you can grant this role:
appengine.applications.get
appengine.applications.listRuntimes
appengine.instances.get
appengine.instances.list
appengine.operations.*
appengine.operations.get
appengine.operations.list
appengine.services.get
appengine.services.list
appengine.versions.get
appengine.versions.list
artifactregistry.projectsettings.get
resourcemanager.projects.get
resourcemanager.projects.list
App Engine Code Viewer
(roles/appengine.codeViewer
)
Read-only access to all application configuration, settings, and deployed
source code.
Lowest-level resources where you can grant this role:
appengine.applications.get
appengine.applications.listRuntimes
appengine.instances.get
appengine.instances.list
appengine.operations.*
appengine.operations.get
appengine.operations.list
appengine.services.get
appengine.services.list
appengine.versions.get
appengine.versions.getFileContents
appengine.versions.list
artifactregistry.projectsettings.get
resourcemanager.projects.get
resourcemanager.projects.list
App Engine Managed VM Debug Access
(roles/appengine.debugger
)
Ability to read or manage v2 instances.
appengine.applications.get
appengine.applications.listRuntimes
appengine.instances.*
appengine.instances.delete
appengine.instances.enableDebug
appengine.instances.get
appengine.instances.list
appengine.operations.*
appengine.operations.get
appengine.operations.list
appengine.services.get
appengine.services.list
appengine.versions.get
appengine.versions.list
resourcemanager.projects.get
resourcemanager.projects.list
App Engine Deployer
(roles/appengine.deployer
)
Read-only access to all application configuration and settings.
To deploy new versions, you must also have the
Service Account User
(roles/iam.serviceAccountUser
) role on the assigned App Engine
service account , and the Cloud
Build Editor (roles/cloudbuild.builds.editor
), and Cloud Storage Object Admin
(roles/storage.objectAdmin
) roles on the project.
Cannot modify existing versions other than deleting versions that are not receiving traffic.
Lowest-level resources where you can grant this role:
appengine.applications.get
appengine.applications.listRuntimes
appengine.instances.get
appengine.instances.list
appengine.operations.*
appengine.operations.get
appengine.operations.list
appengine.services.get
appengine.services.list
appengine.versions.create
appengine.versions.delete
appengine.versions.get
appengine.versions.list
artifactregistry.projectsettings.get
artifactregistry.repositories.deleteArtifacts
artifactregistry.repositories.downloadArtifacts
artifactregistry.repositories.uploadArtifacts
resourcemanager.projects.get
resourcemanager.projects.list
App Engine Memcache Data Admin
(roles/appengine.memcacheDataAdmin
)
Can get, set, delete, and flush App Engine Memcache items.
appengine.applications.get
appengine.memcache.addKey
appengine.memcache.flush
appengine.memcache.get
appengine.memcache.update
resourcemanager.projects.get
resourcemanager.projects.list
App Engine Service Admin
(roles/appengine.serviceAdmin
)
Read-only access to all application configuration and settings.
Write access to module-level and version-level settings. Cannot deploy a new version.
Lowest-level resources where you can grant this role:
appengine.applications.get
appengine.applications.listRuntimes
appengine.instances.delete
appengine.instances.get
appengine.instances.list
appengine.operations.*
appengine.operations.get
appengine.operations.list
appengine.services.*
appengine.services.delete
appengine.services.get
appengine.services.list
appengine.services.update
appengine.versions.delete
appengine.versions.get
appengine.versions.list
appengine.versions.update
artifactregistry.projectsettings.get
resourcemanager.projects.get
resourcemanager.projects.list
App Engine 预定义角色可为您提供更精细的访问权限控制选项。
这些角色仅提供对 App Engine 的访问权限。如果您的项目包含其他服务,例如 Cloud Storage 或 Cloud SQL,您将需要分配其他角色 才能启用对其他服务的访问权限。
App Engine 预定义角色对比
下表对各个预定义 App Engine 角色所拥有的权限进行了全面比较。
能力
App Engine Admin
App Engine Service Admin
App Engine Deployer
App Engine Viewer
App Engine Code Viewer
列出所有服务、版本和实例
是
是
是
是
是
查看所有应用、服务、版本和实例设置
是
是
是
是
是
查看运行时指标,例如资源使用情况、负载信息和错误信息
是
是
是
是
是
查看应用源代码
否
否
否
否
是
部署应用的新版本
有(如果您还授予了 Service Account User 角色)
否
有(如果您还授予了 Service Account User 角色)
否
否
拆分或迁移流量
是
是
无***
否
否
启动和停止版本
是
是
否
否
否
删除版本
是
是
是
否
否
删除整个服务
是
是
否
否
否
使用 SSH 连接到柔性环境中的虚拟机实例
是
否
否
否
否
关停实例
是
否
否
否
否
停用和重新启用 App Engine 应用
是
否
否
否
否
使用具有 login:admin 限制的处理程序(仅限于第一代 运行时环境)
是
否
否
否
否
更新调度规则
是
否
否
否
否
更新 DoS 设置
是
否
否
否
否
更新 Cron 时间表
否
否
否
否
否
更新默认 Cookie 过期时间
是
否
否
否
否
更新引荐来源网址
是
否
否
否
否
更新 Email API 授权发件人
是
否
否
否
否
如需详细了解每个角色所授予的特定 IAM 权限,请参阅 Admin API 的角色 部分。
建议在部署应用时使用的角色
对于仅负责部署应用新版本的账号,我们建议您授予以下角色:
App Engine Deployer 角色 (roles/appengine.deployer
)
Service Account User 角色 (roles/iam.serviceAccountUser
)
Service Account User 角色 可让该账号在部署过程中模拟默认的 App Engine 服务账号。
如果账号使用 gcloud
命令进行部署,也请添加以下角色:
Storage Object Admin (roles/storage.objectAdmin
)
Cloud Build Editor (roles/cloudbuild.builds.editor
)
如需访问存储在 Datastore 中的数据或更新索引,请启用 Cloud Datastore Index Admin 角色 (roles/datastore.indexAdmin
)。
注意 :如果您已向账号授予 App Engine Admin 角色,则无需向其授予 App Engine Deployer 角色,因为 Admin 角色拥有与 Deployer 角色相同的相关权限,并拥有额外的管理权限。我们建议向仅负责部署新版本的账号授予 App Engine Deployer 角色。
如需详细了解如何授予所需权限,请参阅创建用户账号 。
部署与流量路由职责分离
许多组织倾向于将部署应用版本的任务与逐渐增加新创建版本流量的任务分开,并通过不同的工作职能来完成这些任务。App Engine Deployer 和 App Engine Service Admin 角色能够实现这种分离:
App Engine Deployer 和 Service Account User 角色 - 账号只能部署新版本以及删除不再处理流量的旧版本。拥有这些角色的账号将无权为任何版本配置流量,也无权更改调度规则或身份验证网域等应用级设置。
App Engine Service Admin 角色 - 账号无权部署应用的新版本,也无权更改应用级设置。但是,这些账号有权更改现有服务和版本的属性,包括更改可以处理流量的版本。App Engine Service Admin 角色非常适合运营/IT 部门用于逐渐增加新部署版本的流量。
注意 :具有 App Engine Deployer 角色的账号可以通过部署具有相同名称的新版本(使用 --version
标志)覆盖传送流量的版本。
预定义角色的局限性
任何 App Engine 预定义角色均不会授予以下权限:
查看和下载应用日志。
在 Google Cloud 控制台中查看 Monitoring 图表。
启用和停用结算功能。
在 Cloud Security Scanner 中运行安全扫描。
访问存储在 Datastore、任务队列、Cloud Search 或其他任何 Cloud Platform 存储产品中的配置或数据。
发送反馈
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可 获得了许可,并且代码示例已根据 Apache 2.0 许可 获得了许可。有关详情,请参阅 Google 开发者网站政策 。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2025-02-26。
需要向我们提供更多信息?
[[["易于理解","easyToUnderstand","thumb-up"],["解决了我的问题","solvedMyProblem","thumb-up"],["其他","otherUp","thumb-up"]],[["很难理解","hardToUnderstand","thumb-down"],["信息或示例代码不正确","incorrectInformationOrSampleCode","thumb-down"],["没有我需要的信息/示例","missingTheInformationSamplesINeed","thumb-down"],["翻译问题","translationIssue","thumb-down"],["其他","otherDown","thumb-down"]],["最后更新时间 (UTC):2025-02-26。"],[],[]]