Amazon DocumentDB API 权限 操作、资源和条件参考 - Amazon DocumentDB
Amazon Web Services 文档中描述的 Amazon Web Services 服务或功能可能因区域而异。要查看适用于中国区域的差异,请参阅中国的 Amazon Web Services 服务入门

本文属于机器翻译版本。若本译文内容与英语原文存在差异,则一律以英文原文为准。

Amazon DocumentDB API 权限 操作、资源和条件参考

设置时,请使用以下各节作为参考使用策略管理访问并编写可附加到 IAM 身份的权限策略(基于身份的策略)。

以下列出了每项Amazon DocumentDB B API 操作。列表中包括您可授权执行该操作的相应操作,Amazon您可以授予权限的资源以及您可以针对细粒度访问控制包含的条件键。您需要在策略的 Action 字段中指定操作、在策略的 Resource 字段中指定资源值、在策略的 Condition 字段中指定条件。有关条件的更多信息,请参阅“在策略中指定条件”。

您可以使用Amazon在您的 Amazon DocumentDB 策略中使用范围的条件键来表达条件。有关 Amazon 范围内的键的完整列表,请参阅《IAM 用户指南》https://docs.amazonaws.cn/IAM/latest/UserGuide/reference_policies_elements.html#AvailableKeys中的可用键

您可以使用 IAM policy simulator 测试 IAM 策略。它会自动提供资源列表和每个资源所需的参数Amazon操作,包括Amazon DocumentDB B 操作。IAM 策略模拟器确定您指定的每项操作所需的权限。有关 IAM policicy simulator 的信息,请参阅使用 IAM 策略模拟器测试 IAM 策略在里面IAM 用户指南.

注意

要指定操作,请在 API 操作名称之前使用 rds: 前缀 (例如,rds:CreateDBInstance)。

下面列出了 Amazon RDS API 操作及其相关操作、资源和条件键。

Support 资源级权限的Amazon DocumentDB B 操作

资源级权限提供了指定允许用户对哪些资源执行操作的能力。Amazon DocumentDB 部分支持资源级权限。这意味着对于某些 Amazon DocumentDB 操作,您可以控制何时允许用户执行操作(基于必须满足的条件)或是允许用户使用的特定资源。例如,您可以向用户授予仅修改特定实例的权限。

以下列出Amazon DocumentDB API 操作及其相关操作、资源和条件键。

对于某些管理功能,Amazon DocumentDB 使用与 Amazon RDS 共享的操作技术。

Amazon DocumentDB API 操作和操作 资源 条件键

AddTagsToResource

rds:AddTagsToResource

实例

arn:aws:rds:region:account-id:db:db-instance-name

rds:db-tag

子网组

arn:aws:rds:region:account-id:subgrp:subnet-group-name

rds:subgrp-tag

ApplyPendingMaintenanceAction

rds:ApplyPendingMaintenanceAction

实例

arn:aws:rds:region:account-id:db:db-instance-name

rds:db-tag

CopyDBClusterSnapshot

rds:CopyDBClusterSnapshot

集群快照

arn:aws:rds:region:account-id:cluster-snapshot:cluster-snapshot-name

rds:cluster-snapshot-tag

CreateDBCluster

rds:CreateDBCluster

Cluster

arn:aws:rds:region:account-id:cluster:db-cluster-name

rds:cluster-tag

集群参数组

arn:aws:rds:region:account-id:cluster-pg:cluster-parameter-group-name

rds:cluster-pg-tag

子网组

arn:aws:rds:region:account-id:subgrp:subnet-group-name

rds:subgrp-tag

创建数据库ClusterParameterGroup

rds:CreateDBClusterParameterGroup

集群参数组

arn:aws:rds:region:account-id:cluster-pg:cluster-parameter-group-name

rds:cluster-pg-tag

创建数据库ClusterSnapshot

rds:CreateDBClusterSnapshot

Cluster

arn:aws:rds:region:account-id:cluster:db-cluster-name

rds:cluster-tag

集群快照

arn:aws:rds:region:account-id:cluster-snapshot:cluster-snapshot-name

rds:cluster-snapshot-tag

CreateDBInstance

rds:CreateDBInstance

实例

arn:aws:rds:region:account-id:db:db-instance-name

rds:DatabaseClass

rds:db-tag

Cluster

arn:aws:rds:region:account-id:cluster:db-cluster-name

rds:cluster-tag

创建数据库SubnetGroup

rds:CreateDBSubnetGroup

子网组

arn:aws:rds:region:account-id:subgrp:subnet-group-name

rds:subgrp-tag

DeleteDBInstance

rds:DeleteDBInstance

实例

arn:aws:rds:region:account-id:db:db-instance-name

rds:db-tag

deletedBSubnetGroup

rds:DeleteDBSubnetGroup

子网组

arn:aws:rds:region:account-id:subgrp:subnet-group-name

rds:subgrp-tag

describedBClusterParameterGroups

rds:DescribeDBClusterParameterGroups

集群参数组

arn:aws:rds:region:account-id:cluster-pg:cluster-parameter-group-name

rds:cluster-pg-tag

describedBClusterParameters

rds:DescribeDBClusterParameters

集群参数组

arn:aws:rds:region:account-id:cluster-pg:cluster-parameter-group-name

rds:cluster-pg-tag

DescribeDBClusters

rds:DescribeDBClusters

Cluster

arn:aws:rds:region:account-id:cluster:db-cluster-instance-name

rds:cluster-tag

describedBClusterSnapshotAttributes

rds:DescribeDBClusterSnapshotAttributes

集群快照

arn:aws:rds:region:account-id:cluster-snapshot:cluster-snapshot-name

rds:cluster-snapshot-tag

describedBSubnetGroups

rds:DescribeDBSubnetGroups

子网组

arn:aws:rds:region:account-id:subgrp:subnet-group-name

rds:subgrp-tag

DescribePendingMaintenanceActions

rds:DescribePendingMaintenanceActions

实例

arn:aws:rds:region:account-id:db:db-instance-name

rds:DatabaseClass

rds:db-tag

FailoverDBCluster

rds:FailoverDBCluster

Cluster

arn:aws:rds:region:account-id:cluster:db-cluster-instance-name

rds:cluster-tag

ListTagsForResource

rds:ListTagsForResource

实例

arn:aws:rds:region:account-id:db:db-instance-name

rds:db-tag

子网组

arn:aws:rds:region:account-id:subgrp:subnet-group-name

rds:subgrp-tag

ModifyDBCluster

rds:ModifyDBCluster

Cluster

arn:aws:rds:region:account-id:cluster:db-cluster-name

rds:cluster-tag

集群参数组

arn:aws:rds:region:account-id:cluster-pg:cluster-parameter-group-name

rds:cluster-pg-tag

ModifyDBClusterParameterGroup

rds:ModifyDBClusterParameterGroup

集群参数组

arn:aws:rds:region:account-id:cluster-pg:cluster-parameter-group-name

rds:cluster-pg-tag

ModifyDBClusterSnapshotAttribute

rds:ModifyDBClusterSnapshotAttribute

集群快照

arn:aws:rds:region:account-id:cluster-snapshot:cluster-snapshot-name

rds:cluster-snapshot-tag

ModifyDBInstance

rds:ModifyDBInstance

实例

arn:aws:rds:region:account-id:db:db-instance-name

rds:DatabaseClass

rds:db-tag

RebootDBInstance

rds:RebootDBInstance

实例

arn:aws:rds:region:account-id:db:db-instance-name

rds:db-tag

RemoveTagsFromResource

rds:RemoveTagsFromResource

实例

arn:aws:rds:region:account-id:db:db-instance-name

rds:db-tag

子网组

arn:aws:rds:region:account-id:subgrp:subnet-group-name

rds:subgrp-tag

resetDBClusterParameterGroup

rds:ResetDBClusterParameterGroup

集群参数组

arn:aws:rds:region:account-id:cluster-pg:cluster-parameter-group-name

rds:cluster-pg-tag

已恢复 DBClusterFromSnapshot

rds:RestoreDBClusterFromSnapshot

Cluster

arn:aws:rds:region:account-id:cluster:db-cluster-instance-name

rds:cluster-tag

集群快照

arn:aws:rds:region:account-id:cluster-snapshot:cluster-snapshot-name

rds:cluster-snapshot-tag

已恢复 DBClusterToPointInTime

rds:RestoreDBClusterToPointInTime

Cluster

arn:aws:rds:region:account-id:cluster:db-cluster-instance-name

rds:cluster-tag

子网组

arn:aws:rds:region:account-id:subgrp:subnet-group-name

rds:subgrp-tag

不Support 资源级权限的Amazon DocumentDB B 操作

您可以使用 IAM 策略中的所有 Amazon DocumentDB 操作来授予或拒绝用户使用该操作的权限。但是,并非所有 Amazon DocumentDB 操作都支持资源级权限,这使您能够指定可以在哪些资源上执行操作。以下 Amazon DocumentDB API 操作目前不支持资源级权限。因此,要在 IAM 策略中使用这些操作,您必须授予用户使用所有资源的权限,方法是使用*的通配Resource你的陈述中的元素。

  • rds:DescribeDBClusterSnapshots

  • rds:DescribeDBInstances