使用 IAM 进行访问权限控制

本页面介绍了 Infrastructure Manager 角色和权限。

Infra Manager 使用 Identity and Access Management (IAM) 来控制 对服务的访问权限。如需授予使用 Infra Manager 部署资源的权限,请将所需的 Infra Manager IAM 角色 分配给您用于调用 Infra Manager 的 服务账号。如需详细了解如何向服务账号授予 权限,请参阅 管理对服务账号的访问权限

查看 Infra Manager 部署、修订版本和 IAM 政策不需要服务帐号。如需查看 Infra Manager,请向用户、群组或服务帐号授予访问权限。

如需部署或查看 Terraform 配置中定义的 Google Cloud 资源,您需要向服务帐号授予特定于这些资源的 权限。这些权限是本页面列出的 Infra Manager 权限之外的权限。如需查看所有 角色及其包含的权限的列表,请参阅 Identity and Access Management 基本角色和预定义角色参考文档

Infra Manager 预定义角色

IAM 提供的 预定义角色可以授予 对特定 Google Cloud 资源的访问权限,并防止对其他资源进行未经授权的访问 。

下表列出了 Infra Manager IAM 角色及其具备的权限:

角色 说明 权限
Infra Manager Admin (roles/config.admin) 对于用户,对 Infra Manager 资源拥有完全控制权 config.deployments.create
config.deployments.delete
config.deployments.deleteState
config.deployments.get
config.deployments.getIamPolicy
config.deployments.getLock
config.deployments.getState
config.deployments.list
config.deployments.lock
config.deployments.setIamPolicy
config.deploymentgroups.create
config.deploymentgroups.update
config.deploymentgroups.delete
config.deploymentgroups.get
config.deploymentgroups.list
config.deploymentgroups.provision
config.deploymentgroups.deprovision
config.deploymentgrouprevisions.get
config.deploymentgrouprevisions.list
config.deployments.unlock
config.deployments.update
config.deployments.updateState
config.automigrationconfig.get
config.automigrationconfig.update
config.previews.create
config.previews.delete
config.previews.get
config.previews.list
config.previews.export
config.previews.upload
config.locations.get
config.locations.list
config.operations.cancel
config.operations.delete
config.operations.get
config.operations.list
config.resources.get
config.resources.list
config.resourcechanges.get
config.resourcechanges.list
config.resourcedrifts.get
config.resourcedrifts.list
config.revisions.get
config.revisions.getState
config.revisions.list
config.artifacts.import
config.terraformversions.get
config.terraformversions.list
resourcemanager.projects.get
resourcemanager.projects.list
Infra Manager Service Agent (roles/config.agent) 提供对服务帐号的访问权限,以便使用 Infra Manager,包括部署、修订版本、日志记录和 Terraform 状态文件。 storage.buckets.get
storage.buckets.list
storage.buckets.create
storage.buckets.update
storage.buckets.delete
storage.objects.get
storage.objects.list
storage.objects.create
storage.objects.update
storage.objects.delete
logging.logEntries.create
config.deployments.getState
config.deployments.updateState
config.deployments.deleteState
config.deployments.getLock
config.previews.upload
config.artifacts.import
config.revisions.getState
cloudbuild.connections.list
cloudbuild.repositories.accessReadToken
cloudbuild.repositories.list
cloudquotas.quotas.get
monitoring.timeSeries.list
Infra Manager Service Account (roles/cloudconfig.serviceAgent) 当您启用 Infra Manager API 时,Infra Manager 服务帐号会自动在项目中创建并获得适用于项目中资源的此角色。Infra Manager 服务帐号仅在创建、管理或删除部署和修订版本时需要执行操作时使用此角色。 cloudbuild.builds.get
cloudbuild.builds.list
cloudbuild.builds.create
cloudbuild.builds.update
cloudbuild.workerpools.use
iam.serviceAccounts.actAs
iam.serviceAccounts.getAccessToken
logging.logEntries.create
logging.logEntries.route
serviceusage.services.use
storage.buckets.get
storage.buckets.list
storage.buckets.create
storage.buckets.update
storage.buckets.delete
storage.objects.get
storage.objects.list
storage.objects.create
storage.objects.update
storage.objects.delete
Infra Manager Viewer (roles/config.viewer) 读取部署、修订版本和 IAM 政策。 config.deployments.get
config.deployments.getIamPolicy
config.deployments.list
config.deploymentgroups.get
config.deploymentgroups.list
config.deploymentgrouprevisions.get
config.deploymentgrouprevisions.list
config.previews.get
config.previews.list
config.locations.get
config.locations.list
config.operations.get
config.operations.list
config.resources.get
config.resources.list
config.revisions.get
config.revisions.list
config.terraformversions.get
config.terraformversions.list
resourcemanager.projects.get
resourcemanager.projects.list

除了 Infra Manager 预定义角色之外, 基本 Viewer 和 Owner 角色也 包含与 Infra Manager 相关的权限。 但是,我们建议您尽可能授予预定义角色,以便符合 最小权限原则

下表列出了基本角色以及它们包含的 Infra Manager IAM 角色。

角色 包含的角色
Viewer roles/config.viewer
所有者 roles/config.admin

权限

REST API 参考文档中列出了调用者调用每个方法必须具备的权限。

后续步骤