使用 IAM 进行访问权限控制

借助 Identity and Access Management (IAM),您可以授予对特定资源的访问权限。如需授予对资源的访问权限,您可以向用户授予特定角色,从而给予用户某些权限。

所需的角色

每种 Workload Manager API 方法都需要必要的 IAM 权限。您可以通过为用户、群组或服务账号授予角色来分配权限。如需了解如何授予对资源的访问权限,请参阅管理访问权限

下表列出了 Workload Manager IAM 角色以及这些角色授予的权限。

Role Permissions

(roles/workloadmanager.admin)

Full access to Workload Manager all resources.

compute.acceleratorTypes.list

compute.diskTypes.list

compute.machineTypes.list

compute.networks.list

compute.projects.get

compute.regions.list

compute.subnetworks.list

compute.zones.list

dns.managedZones.list

iam.serviceAccounts.list

monitoring.timeSeries.list

orgpolicy.policy.get

resourcemanager.projects.get

resourcemanager.projects.getIamPolicy

resourcemanager.projects.list

serviceusage.quotas.get

serviceusage.services.get

storage.buckets.list

storage.objects.list

workloadmanager.*

  • workloadmanager.actuations.create
  • workloadmanager.actuations.delete
  • workloadmanager.actuations.get
  • workloadmanager.actuations.list
  • workloadmanager.deployments.create
  • workloadmanager.deployments.delete
  • workloadmanager.deployments.get
  • workloadmanager.deployments.list
  • workloadmanager.discoveredprofiles.get
  • workloadmanager.discoveredprofiles.getHealth
  • workloadmanager.discoveredprofiles.list
  • workloadmanager.evaluations.create
  • workloadmanager.evaluations.delete
  • workloadmanager.evaluations.get
  • workloadmanager.evaluations.list
  • workloadmanager.evaluations.run
  • workloadmanager.evaluations.update
  • workloadmanager.executions.delete
  • workloadmanager.executions.get
  • workloadmanager.executions.list
  • workloadmanager.insights.export
  • workloadmanager.insights.listSapSystems
  • workloadmanager.insights.write
  • workloadmanager.locations.get
  • workloadmanager.locations.list
  • workloadmanager.operations.cancel
  • workloadmanager.operations.delete
  • workloadmanager.operations.get
  • workloadmanager.operations.list
  • workloadmanager.results.list
  • workloadmanager.rules.list

(roles/workloadmanager.deploymentAdmin)

Full access to Workload Manager deployment resources.

compute.acceleratorTypes.list

compute.diskTypes.list

compute.machineTypes.list

compute.networks.list

compute.projects.get

compute.regions.list

compute.subnetworks.list

compute.zones.list

dns.managedZones.list

iam.serviceAccounts.list

monitoring.timeSeries.list

resourcemanager.projects.get

resourcemanager.projects.getIamPolicy

resourcemanager.projects.list

serviceusage.quotas.get

serviceusage.services.get

storage.buckets.list

storage.objects.list

workloadmanager.actuations.*

  • workloadmanager.actuations.create
  • workloadmanager.actuations.delete
  • workloadmanager.actuations.get
  • workloadmanager.actuations.list

workloadmanager.deployments.*

  • workloadmanager.deployments.create
  • workloadmanager.deployments.delete
  • workloadmanager.deployments.get
  • workloadmanager.deployments.list

workloadmanager.locations.*

  • workloadmanager.locations.get
  • workloadmanager.locations.list

workloadmanager.operations.*

  • workloadmanager.operations.cancel
  • workloadmanager.operations.delete
  • workloadmanager.operations.get
  • workloadmanager.operations.list

(roles/workloadmanager.deploymentViewer)

Read-only access to Workload Manager deployment resources.

resourcemanager.projects.get

resourcemanager.projects.list

workloadmanager.actuations.get

workloadmanager.actuations.list

workloadmanager.deployments.get

workloadmanager.deployments.list

(roles/workloadmanager.evaluationAdmin)

Full access to Workload Manager evaluation resources.

orgpolicy.policy.get

resourcemanager.projects.get

resourcemanager.projects.list

workloadmanager.evaluations.*

  • workloadmanager.evaluations.create
  • workloadmanager.evaluations.delete
  • workloadmanager.evaluations.get
  • workloadmanager.evaluations.list
  • workloadmanager.evaluations.run
  • workloadmanager.evaluations.update

workloadmanager.executions.*

  • workloadmanager.executions.delete
  • workloadmanager.executions.get
  • workloadmanager.executions.list

workloadmanager.locations.*

  • workloadmanager.locations.get
  • workloadmanager.locations.list

workloadmanager.operations.*

  • workloadmanager.operations.cancel
  • workloadmanager.operations.delete
  • workloadmanager.operations.get
  • workloadmanager.operations.list

workloadmanager.results.list

workloadmanager.rules.list

(roles/workloadmanager.evaluationViewer)

Read-only access to Workload Manager evaluation resources.

orgpolicy.policy.get

resourcemanager.projects.get

resourcemanager.projects.list

workloadmanager.evaluations.get

workloadmanager.evaluations.list

workloadmanager.executions.get

workloadmanager.executions.list

workloadmanager.results.list

workloadmanager.rules.list

(roles/workloadmanager.insightWriter)

The role used to write data to WLM data warehouse.

workloadmanager.insights.write

(roles/workloadmanager.serviceAgent)

Gives Workload Manager Service Agent access to CAI export functions and Cloud Monitoring.

cloudasset.assets.exportAccessPolicy

cloudasset.assets.exportIamPolicy

cloudasset.assets.exportOSInventories

cloudasset.assets.exportOrgPolicy

cloudasset.assets.exportResource

cloudasset.assets.listAccessPolicy

cloudasset.assets.listIamPolicy

cloudasset.assets.listOSInventories

cloudasset.assets.listOrgPolicy

cloudasset.assets.listResource

cloudasset.assets.searchAllResources

config.deployments.create

config.deployments.delete

config.deployments.get

config.deployments.list

config.deployments.update

config.locations.*

  • config.locations.get
  • config.locations.list

config.operations.*

  • config.operations.cancel
  • config.operations.delete
  • config.operations.get
  • config.operations.list

config.resources.list

config.revisions.get

config.revisions.list

monitoring.metricDescriptors.get

monitoring.metricDescriptors.list

monitoring.monitoredResourceDescriptors.*

  • monitoring.monitoredResourceDescriptors.get
  • monitoring.monitoredResourceDescriptors.list

monitoring.timeSeries.list

serviceusage.services.use

workloadmanager.insights.export

workloadmanager.insights.listSapSystems

(roles/workloadmanager.viewer)

Read-only access to Workload Manager all resources.

orgpolicy.policy.get

resourcemanager.projects.get

resourcemanager.projects.list

workloadmanager.actuations.get

workloadmanager.actuations.list

workloadmanager.deployments.get

workloadmanager.deployments.list

workloadmanager.discoveredprofiles.*

  • workloadmanager.discoveredprofiles.get
  • workloadmanager.discoveredprofiles.getHealth
  • workloadmanager.discoveredprofiles.list

workloadmanager.evaluations.get

workloadmanager.evaluations.list

workloadmanager.executions.get

workloadmanager.executions.list

workloadmanager.results.list

workloadmanager.rules.list

(roles/workloadmanager.worker)

The role used by Workload Manager application runners to read and update workloads.

orgpolicy.policy.get

resourcemanager.projects.get

resourcemanager.projects.list

workloadmanager.actuations.*

  • workloadmanager.actuations.create
  • workloadmanager.actuations.delete
  • workloadmanager.actuations.get
  • workloadmanager.actuations.list

workloadmanager.deployments.*

  • workloadmanager.deployments.create
  • workloadmanager.deployments.delete
  • workloadmanager.deployments.get
  • workloadmanager.deployments.list

workloadmanager.discoveredprofiles.*

  • workloadmanager.discoveredprofiles.get
  • workloadmanager.discoveredprofiles.getHealth
  • workloadmanager.discoveredprofiles.list

workloadmanager.evaluations.*

  • workloadmanager.evaluations.create
  • workloadmanager.evaluations.delete
  • workloadmanager.evaluations.get
  • workloadmanager.evaluations.list
  • workloadmanager.evaluations.run
  • workloadmanager.evaluations.update

workloadmanager.executions.*

  • workloadmanager.executions.delete
  • workloadmanager.executions.get
  • workloadmanager.executions.list

workloadmanager.insights.write

workloadmanager.results.list

workloadmanager.rules.list

(roles/workloadmanager.workloadViewer)

The role used to view the workload related data.

resourcemanager.projects.get

resourcemanager.projects.list

workloadmanager.discoveredprofiles.*

  • workloadmanager.discoveredprofiles.get
  • workloadmanager.discoveredprofiles.getHealth
  • workloadmanager.discoveredprofiles.list

(roles/workloadmanager.serviceAgent)

向 Workload Manager Service Agent 授予对 CAI 导出函数和 Cloud Monitoring 的访问权限。

cloudasset.assets.exportAccessPolicy

cloudasset.assets.exportIamPolicy

cloudasset.assets.exportOSInventories

cloudasset.assets.exportOrgPolicy

cloudasset.assets.exportResource

cloudasset.assets.listAccessPolicy

cloudasset.assets.listIamPolicy

cloudasset.assets.listOSInventories

cloudasset.assets.listOrgPolicy

cloudasset.assets.listResource

cloudasset.assets.searchAllResources

config.deployments.create

config.deployments.delete

config.deployments.get

config.deployments.list

config.deployments.update

config.locations.*

  • config.locations.get
  • config.locations.list

config.operations.*

  • config.operations.cancel
  • config.operations.delete
  • config.operations.get
  • config.operations.list

config.resources.list

config.revisions.get

config.revisions.list

monitoring.metricDescriptors.get

monitoring.metricDescriptors.list

monitoring.monitoredResourceDescriptors.*

  • monitoring.monitoredResourceDescriptors.get
  • monitoring.monitoredResourceDescriptors.list

monitoring.timeSeries.list

serviceusage.services.use

workloadmanager.insights.export

workloadmanager.insights.listSapSystems

如需详细了解 Workload Manager API,请参阅 Workload Manager API 参考文档

后续步骤