

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

# IAM JSON 政策元素參考
<a name="reference_policies_elements"></a>

JSON 政策文件由元素組成。這些元素按照在政策中使用的大致順序列出。元素的順序不會有影響，例如，`Resource` 元素可排在 `Action` 元素之前。您不需要指定政策中的任何 `Condition` 元素。如需進一步了解 JSON 政策文件的一般結構和目的，請參閱 [JSON 政策概觀](access_policies.md#access_policies-json)。

部分 JSON 政策元素會相互排斥。這表示您不能建立同時使用兩個元素的政策。例如，您不能在同一政策陳述式中同時使用 `Action` 與 `NotAction`。相互排斥的其他組合包括 `Principal`/`NotPrincipal` 以及 `Resource`/`NotResource`。

政策中所包含的具體內容因服務而異，取決於服務所提供的動作、內含的資源類型等。當您針對特定服務編寫政策時，參考該服務的範例將會有所幫助。若需要支援 IAM 之所有服務的清單，以及探討這些服務的 IAM 和政策的文件連結，請參閱 [AWS 使用 IAM 的 服務](reference_aws-services-that-work-with-iam.md)。

 當您建立或編輯 JSON 政策時，IAM 可以執行政策驗證以協助您建立有效的政策。IAM 會識別 JSON 語法錯誤，而 IAM Access Analyzer 會提供額外的政策檢查及建議，協助您進一步改良政策。若要進一步了解政策驗證的資訊，請參閱 [IAM 政策驗證](access_policies_policy-validator.md)。若要進一步了解 IAM Access Analyzer 政策檢查和可動作的建議，請參閱 [IAM Access Analyzer 政策驗證](https://docs.aws.amazon.com/IAM/latest/UserGuide/access-analyzer-policy-validation.html)。

**Topics**
+ [Version](reference_policies_elements_version.md)
+ [Id](reference_policies_elements_id.md)
+ [Statement](reference_policies_elements_statement.md)
+ [Sid](reference_policies_elements_sid.md)
+ [Effect](reference_policies_elements_effect.md)
+ [Principal](reference_policies_elements_principal.md)
+ [NotPrincipal](reference_policies_elements_notprincipal.md)
+ [Action](reference_policies_elements_action.md)
+ [NotAction](reference_policies_elements_notaction.md)
+ [Resource](reference_policies_elements_resource.md)
+ [NotResource](reference_policies_elements_notresource.md)
+ [Condition](reference_policies_elements_condition.md)
+ [變數和標籤](reference_policies_variables.md)
+ [支援的資料類型](reference_policies_elements_datatypes.md)