

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

# AWS WAF V2 的動作、資源和條件索引鍵
<a name="list_awswafv2"></a>

AWS WAF V2 （服務字首：`wafv2`) 提供下列服務特定的資源、動作和條件內容索引鍵，可用於 IAM 許可政策。

參考資料：
+ 了解如何[設定此服務](https://docs.aws.amazon.com/waf/latest/developerguide/waf-chapter.html)。
+ 檢視[可供此服務使用的 API 操作](https://docs.aws.amazon.com/waf/latest/APIReference/API_Operations_AWS_WAFV2.html)清單。
+ 了解如何[使用 IAM](https://docs.aws.amazon.com/waf/latest/developerguide/waf-auth-and-access-control.html) 許可政策來保護此服務及其資源。

**Topics**
+ [AWS WAF V2 定義的動作](#awswafv2-actions-as-permissions)
+ [AWS WAF V2 定義的資源類型](#awswafv2-resources-for-iam-policies)
+ [AWS WAF V2 的條件索引鍵](#awswafv2-policy-keys)

## AWS WAF V2 定義的動作
<a name="awswafv2-actions-as-permissions"></a>

您可在 IAM 政策陳述式的 `Action` 元素中指定以下動作。使用政策來授予在 AWS中執行操作的許可。在政策中使用動作時，通常會允許或拒絕存取相同名稱的 API 操作或 CLI 命令。不過，在某些情況下，單一動作可控制對多個操作的存取。或者，某些操作需要多種不同的動作。

動作資料表的**存取層級**欄說明動作的分類方式 （列出、讀取、許可管理或標記）。此分類可協助您了解在政策中使用某動作時，該動作授予您的存取層級。如需存取層級的詳細資訊，請參閱[政策摘要中的存取層級](https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_understand-policy-summary-access-level-summaries.html)。

「動作」資料表的**資源類型**欄會指出每個動作是否支援資源層級的許可。如果此欄沒有值，您必須在政策陳述式的 `Resource` 元素中指定政策適用的所有資源 ("\$1")。如果資料欄包含資源類型，則您可以在具有該動作的陳述式中指定該類型的 ARN。如果動作具有一或多個必要資源，呼叫者必須具有對這些資源使用動作的許可。表格中的必要資源會以星號 (\$1) 表示。如果您使用 IAM 政策中的 `Resource` 元素限制資源存取，則每種必要的資源類型必須要有 ARN 或模式。某些動作支援多種資源類型。如果資源類型是選用 (未顯示為必要)，則您可以選擇使用其中一種選用資源類型。

「動作」資料表的**條件索引鍵**欄包含您可以在政策陳述式的 `Condition` 元素中指定的索引鍵。如需有關與服務資源相關聯之條件索引鍵的詳細資訊，請參閱「資源類型」資料表的**條件索引鍵**欄。

動作資料表的**相依動作**欄會顯示成功呼叫動作所需的其他許可。除了 動作本身的許可之外，還可能需要這些許可。當動作指定相依動作時，這些相依性可能適用於針對該動作定義的其他資源，而不只是資料表中列出的第一個資源。

**注意**  
資源條件索引鍵會列在[資源類型](#awswafv2-resources-for-iam-policies)資料表中。您可以在「動作」資料表的**資源類型 (\$1必填) **欄中找到適用於動作的資源類型連結。「資源類型」資料表中的資源類型包括**條件索引鍵**欄，其中包含套用至「動作」資料表中動作的資源條件索引鍵。

如需下表各欄的詳細資訊，請參閱[動作資料表](reference_policies_actions-resources-contextkeys.html#actions_table)。


****  
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/service-authorization/latest/reference/list_awswafv2.html)

## AWS WAF V2 定義的資源類型
<a name="awswafv2-resources-for-iam-policies"></a>

此服務會定義下列資源類型，並可用在 IAM 許可政策陳述式的 `Resource` 元素中。[動作表格](#awswafv2-actions-as-permissions)中的每個動作都代表可使用該動作指定的資源類型。資源類型也能定義您可以在政策中包含哪些條件索引鍵。這些索引鍵都會顯示在「資源類型」資料表的最後一欄。如需下表各欄的詳細資訊，請參閱[資源類型資料表](reference_policies_actions-resources-contextkeys.html#resources_table)。


****  

| 資源類型 | ARN | 條件索引鍵 | 
| --- | --- | --- | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html)  |  arn:\$1\$1Partition\$1:wafv2:\$1\$1Region\$1:\$1\$1Account\$1:\$1\$1Scope\$1/webacl/\$1\$1Name\$1/\$1\$1Id\$1  |   [#awswafv2-aws_ResourceTag___TagKey_](#awswafv2-aws_ResourceTag___TagKey_)   | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_IPSet.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_IPSet.html)  |  arn:\$1\$1Partition\$1:wafv2:\$1\$1Region\$1:\$1\$1Account\$1:\$1\$1Scope\$1/ipset/\$1\$1Name\$1/\$1\$1Id\$1  |   [#awswafv2-aws_ResourceTag___TagKey_](#awswafv2-aws_ResourceTag___TagKey_)   | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_ManagedRuleSet.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_ManagedRuleSet.html)  |  arn:\$1\$1Partition\$1:wafv2:\$1\$1Region\$1:\$1\$1Account\$1:\$1\$1Scope\$1/managedruleset/\$1\$1Name\$1/\$1\$1Id\$1  |  | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_RuleGroup.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_RuleGroup.html)  |  arn:\$1\$1Partition\$1:wafv2:\$1\$1Region\$1:\$1\$1Account\$1:\$1\$1Scope\$1/rulegroup/\$1\$1Name\$1/\$1\$1Id\$1  |   [#awswafv2-aws_ResourceTag___TagKey_](#awswafv2-aws_ResourceTag___TagKey_)   | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_RegexPatternSet.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_RegexPatternSet.html)  |  arn:\$1\$1Partition\$1:wafv2:\$1\$1Region\$1:\$1\$1Account\$1:\$1\$1Scope\$1/regexpatternset/\$1\$1Name\$1/\$1\$1Id\$1  |   [#awswafv2-aws_ResourceTag___TagKey_](#awswafv2-aws_ResourceTag___TagKey_)   | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html)  |  arn:\$1\$1Partition\$1:elasticloadbalancing:\$1\$1Region\$1:\$1\$1Account\$1:loadbalancer/app/\$1\$1LoadBalancerName\$1/\$1\$1LoadBalancerId\$1  |  | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html)  |  arn:\$1\$1Partition\$1:apigateway:\$1\$1Region\$1::/restapis/\$1\$1ApiId\$1/stages/\$1\$1StageName\$1  |  | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html)  |  arn:\$1\$1Partition\$1:appsync:\$1\$1Region\$1:\$1\$1Account\$1:apis/\$1\$1GraphQLAPIId\$1  |  | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html)  |  arn:\$1\$1Partition\$1:cognito-idp:\$1\$1Region\$1:\$1\$1Account\$1:userpool/\$1\$1UserPoolId\$1  |  | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html)  |  arn:\$1\$1Partition\$1:apprunner:\$1\$1Region\$1:\$1\$1Account\$1:service/\$1\$1ServiceName\$1/\$1\$1ServiceId\$1  |  | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html)  |  arn:\$1\$1Partition\$1:ec2:\$1\$1Region\$1:\$1\$1Account\$1:verified-access-instance/\$1\$1VerifiedAccessInstanceId\$1  |  | 
|   [https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html](https://docs.aws.amazon.com/waf/latest/APIReference/API_WebACL.html)  |  arn:\$1\$1Partition\$1:amplify:\$1\$1Region\$1:\$1\$1Account\$1:apps/\$1\$1AppId\$1  |  | 

## AWS WAF V2 的條件索引鍵
<a name="awswafv2-policy-keys"></a>

AWS WAF V2 定義下列條件索引鍵，可用於 IAM 政策的 `Condition`元素。您可以使用這些索引鍵來縮小套用政策陳述式的條件。如需下表各欄的詳細資訊，請參閱[條件索引鍵表](reference_policies_actions-resources-contextkeys.html#context_keys_table)。

若要檢視所有 服務可用的全域條件索引鍵，請參閱[AWS 全域條件內容索引鍵](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html)。


****  

| 條件索引鍵 | 描述 | 類型 | 
| --- | --- | --- | 
|   [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)  | 依每個標籤的允許值集來篩選存取 | 字串 | 
|   [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)  | 依與資源相關聯的標籤值篩選存取權 | 字串 | 
|   [https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-tagkeys](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_condition-keys.html#condition-keys-tagkeys)  | 依請求中是否存在強制性標籤來篩選存取 | ArrayOfString | 
|   [https://docs.aws.amazon.com/waf/latest/developerguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-conditionkeys](https://docs.aws.amazon.com/waf/latest/developerguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-conditionkeys)  | 依 PutLoggingConfiguration API 的日誌目的地 ARN 篩選存取權 | ARN | 
|   [https://docs.aws.amazon.com/waf/latest/developerguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-conditionkeys](https://docs.aws.amazon.com/waf/latest/developerguide/security_iam_service-with-iam.html#security_iam_service-with-iam-id-based-policies-conditionkeys)  | 依記錄組態 API 的日誌範圍篩選存取權 | String | 