Amazon DocumentDB API 权限: 操作、资源和条件参考
在设置使用策略管理访问和编写您可附加到 IAM 身份的权限策略(基于身份的策略)时,可以使用以下内容作为参考。
下面列出了每个 Amazon DocumentDB API 操作。此列表中包含您为了执行该操作可授予权限的相应操作、您可以授予权限的 AWS 资源以及您可以针对细化访问控制而包含的条件键。您需要在策略的 Action 字段中指定操作、在策略的 Resource 字段中指定资源值、在策略的 Condition 字段中指定条件。有关条件的更多信息,请参阅“在策略中指定条件”。
您可以在 Amazon DocumentDB 策略中使用 AWS 范围的条件键来表达条件。有关 AWS 范围内的键的完整列表,请参阅 https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#AvailableKeys 中的IAM 用户指南可用键。
您可以使用 IAM 策略模拟器测试 IAM 策略。它将自动提供每个 AWS 操作 (包括 Amazon DocumentDB 操作) 所需的资源和参数的列表。IAM 策略模拟器确定您指定的每个操作所需的权限。有关 IAM 策略模拟器的信息,请参阅 中的IAM使用 IAM 策略模拟器测试 策略。IAM 用户指南
注意
要指定操作,请在 API 操作名称之前使用 rds: 前缀 (例如,rds:CreateDBInstance)。
下面列出了 Amazon RDS API 操作及其相关操作、资源和条件键。
支持资源级权限的 Amazon DocumentDB 操作
资源级权限提供指定允许用户对哪些资源执行操作的能力。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
|
CreateDBClusterParameterGroup rds:CreateDBClusterParameterGroup
| 集群参数组 arn:aws:rds:region:account-id:cluster-pg:cluster-parameter-group-name
| rds:cluster-pg-tag
|
CreateDBClusterSnapshot 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
|
CreateDBSubnetGroup 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
|
RestoreDBClusterFromSnapshot 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
|
RestoreDBClusterToPointInTime 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
|
不支持资源级权限的 Amazon DocumentDB 操作
您可以使用一个 IAM 策略中的所有 Amazon DocumentDB操作授予或拒绝用户对该操作的使用权限。但是,并非所有 Amazon DocumentDB 操作都支持资源级权限 (这使您能够指定可对其执行操作的资源)。以下 Amazon DocumentDB API 操作当前不支持资源级权限。因此,要在 IAM 策略中使用这些操作,您必须通过对语句中的 Resource 元素使用 * 通配符,来向用户授予对操作使用所有资源的权限。