

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 用於管理 Amazon Neptune 的 IAM 條件金鑰
<a name="iam-admin-condition-keys"></a>

[使用條件金鑰](security-iam-access-manage.md#iam-using-condition-keys)，您可以在 IAM 政策陳述式中指定條件，以便陳述式只在條件成立時才生效。您可以在 Neptune 管理政策陳述式中使用的條件金鑰分為下列類別：
+ [全域條件索引鍵](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html)   –   這些由 定義， AWS 用於 AWS 服務的一般用途。大部分可以用於 Neptune 管理政策陳述式。
+ [管理資源屬性條件金鑰](#iam-rds-property-condition-keys) – [下面](#iam-rds-property-condition-keys)列出的這些金鑰是以管理資源的屬性為基礎。
+ [標籤型存取條件金鑰](#iam-rds-tag-based-condition-keys) – [下面](#iam-rds-tag-based-condition-keys)列出的這些金鑰是以附加至管理資源的 [AWS 標籤](https://docs.aws.amazon.com/general/latest/gr/aws_tagging.html)為基礎。

## Neptune 管理資源屬性條件金鑰
<a name="iam-rds-property-condition-keys"></a>


| 條件索引鍵 | 描述 | Type | 
| --- | --- | --- | 
| rds:DatabaseClass | 依資料庫執行個體類別的類型篩選存取 | String | 
| rds:DatabaseEngine | 依資料庫引擎來篩選存取權限。如需可能的值，請參閱建立資料庫執行個體 API 中的引擎參數 | 字串 | 
| rds:DatabaseName | 依資料庫執行個體上的資料庫使用者定義名稱來篩選存取權限。 | 字串 | 
| rds:EndpointType | 依端點類型篩選存取權限。READER、WRITER、CUSTOM 的其中一個 | String | 
| rds:Vpc | 依此值指定資料庫執行個體是否在 Amazon Virtual Private Cloud (Amazon VPC) 中執行來篩選存取權限。若要指示資料庫執行個體在 Amazon VPC 中執行，請指定 true。 | Boolean | 

## 管理標籤型條件金鑰
<a name="iam-rds-tag-based-condition-keys"></a>

Amazon Neptune 支援在 IAM 政策中使用自訂標籤來指定條件，以透過 [管理 API 參考](api.md) 控制對 Neptune 的存取。

例如，如果您將名為 `environment` 的標籤新增至資料庫執行個體，而此標籤具有 `beta`、`staging` 和 `production` 等值，則您可以建立一個政策，根據該標籤的值限制對執行個體的存取。

**重要**  
如果您使用標記來管理對 Neptune 資源的存取，請務必保護對標籤的存取。您可以建立 `AddTagsToResource` 和 `RemoveTagsFromResource` 動作的政策，來限制對標籤的存取。  
例如，您可以使用下列政策，拒絕使用者可對所有資源新增或移除標籤的能力。然後，您可以建立政策來允許特定使用者新增或移除標籤。  

****  

```
{ "Version":"2012-10-17",		 	 	 
  "Statement":[
    { "Sid": "DenyTagUpdates",
      "Effect": "Deny",
      "Action": [
        "rds:AddTagsToResource",
        "rds:RemoveTagsFromResource"
      ],
      "Resource":"*"
    }
  ]
}
```

下列標籤型條件金鑰僅會在管理政策陳述式中使用管理資源。


**標籤型管理條件金鑰**  

| 條件索引鍵 | 描述 | Type | 
| --- | --- | --- | 
|   [https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requesttag](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-requesttag)  | 根據請求中存在的標籤金鑰值對來篩選存取。 | String | 
|   [https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourcetag](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-resourcetag)  | 根據附加到資源的標籤金鑰值對來篩選存取。 | String | 
|   [https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keyss](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keyss)  | 根據請求中存在的標籤金鑰來篩選存取。 | String | 
| rds:cluster-pg-tag/\$1\$1TagKey\$1 | 依附加到資料庫叢集參數群組的標籤來篩選存取。 | String | 
| rds:cluster-snapshot-tag/\$1\$1TagKey\$1 | 依附加到資料庫叢集快照的標籤來篩選存取。 | String | 
| rds:cluster-tag/\$1\$1TagKey\$1 | 依附加到資料庫叢集的標籤來篩選存取。 | String | 
| rds:db-tag/\$1\$1TagKey\$1 | 依附加到資料庫執行個體的標籤來篩選存取。 | String | 
| rds:es-tag/\$1\$1TagKey\$1 | 依附加到事件訂閱的標籤來篩選存取。 | String | 
| rds:pg-tag/\$1\$1TagKey\$1 | 依附加到資料庫參數群組的標籤來篩選存取。 | String | 
| rds:req-tag/\$1\$1TagKey\$1 | 依限制可用來標記資源的一組標籤金鑰和值來篩選存取。 | String | 
| rds:secgrp-tag/\$1\$1TagKey\$1 | 依附加到資料庫安全群組的標籤來篩選存取。 | String | 
| rds:snapshot-tag/\$1\$1TagKey\$1 | 依附加到資料庫快照的標籤來篩選存取。 | String | 
| rds:subgrp-tag/\$1\$1TagKey\$1 | 依附加至資料庫子網路群組的標籤來篩選存取權限 | String | 