

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

# 中的宣告政策 AWS Organizations
<a name="orgs_manage_policies_declarative_policies"></a>

宣告政策可讓您集中設定和管理 AWS 服務 及其功能。這些政策如何影響繼承它們的 OUs 和帳戶，取決於您套用的宣告政策類型 AWS Organizations。檢閱本節中的主題，以了解宣告政策的相關術語和概念。

宣告政策可讓您集中宣告和強制執行整個組織 AWS 服務 大規模指定 所需的組態。連接後，當服務新增新功能或 APIs時，一律會維護組態。使用宣告式政策來防止不合規的動作。例如，您可以封鎖對整個組織的 Amazon VPC 資源的公有網際網路存取。

使用宣告政策的主要優點如下：
+ **易用性**：您可以使用 AWS Organizations 和 AWS Control Tower 主控台中的 AWS 服務 幾個選項，或使用 AWS CLI & AWS SDKs 的幾個命令，強制執行 的基準組態。
+ **設定一次並忘記**：即使服務引入新功能或 APIs， AWS 服務 的基準組態也會一律維持。將新帳戶新增至組織或建立新主體和資源時，也會維護基準組態。
+ **透明度**：帳戶狀態報告可讓您檢閱範圍內帳戶宣告政策支援的所有屬性的目前狀態。您也可以建立可自訂的錯誤訊息，這可協助管理員將最終使用者重新導向至內部 wiki 頁面，或提供描述性訊息，以協助最終使用者了解動作失敗的原因。

## 宣告政策的運作方式
<a name="orgs_manage_policies_declarative_policies-how-work"></a>

在服務的控制平面中強制執行宣告政策，這是與[授權政策的重要區別，例如服務控制政策 (SCPs) 和資源控制政策 RCPs)](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_manage_policies_authorization_policies.html)。雖然授權政策會規範對 APIs存取，但宣告政策會直接在服務層級套用，以強制執行持久的意圖。這可確保始終強制執行基準組態，即使服務引入了新功能或 APIs。

下表有助於說明此區別，並提供一些使用案例。


****  

|  | 服務控制政策 | 資源控制政策 | 宣告式政策 | 
| --- | --- | --- | --- | 
| 為什麼？ | 集中大規模定義和強制執行主體 （例如 IAM 使用者和 IAM 角色） 的一致存取控制。 | 集中定義和強制執行大規模資源的一致存取控制 | 集中定義和強制執行大規模 AWS 服務的基準組態。 | 
| 如何？ | 透過在 API 層級控制主體的可用存取許可上限。 | 透過控制 API 層級之資源的可用存取許可上限。 | 透過強制執行 的所需組態， AWS 服務 而不使用 API 動作。 | 
| 管理服務連結角色？ | 否 | 否 | 是 | 
| 範例 政策 | [拒絕成員帳戶離開組織](https://github.com/aws-samples/service-control-policy-examples/blob/main/Privileged-access-controls/Deny-member-accounts-from-leaving-your-AWS-organization.json) | [限制只能存取資源的 HTTPS 連線](https://github.com/aws-samples/resource-control-policy-examples/blob/main/Restrict-resource-access-patterns/Restrict-access-to-only-HTTPS-connections-to-your-resources.json) | [允許的影像設定](orgs_manage_policies_ec2_syntax.md#ec2-policy-ec2-ami-allowed-images) | 

在您[建立](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_policies_create.html#create-declarative-policy-procedure)並[連接](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_policies_attach.html)宣告政策之後，它會在您的組織中套用和強制執行。宣告政策可套用至整個組織、組織單位 OUs) 或帳戶。加入組織的帳戶會自動繼承組織中的宣告政策。如需詳細資訊，請參閱[了解宣告政策繼承](orgs_manage_policies_inheritance_mgmt.md)。

*有效政策*是從組織根和 OU 繼承的一組規則，以及直接連接到帳戶的規則。有效政策會指定套用至帳戶的最終規則集。如需詳細資訊，請參閱[檢視有效的宣告政策](orgs_manage_policies_effective.md)。

如果已[分離](https://docs.aws.amazon.com/organizations/latest/userguide/orgs_policies_detach.html)宣告政策，則屬性狀態會在連接宣告政策之前回復至先前的狀態。

**Topics**
+ [宣告政策的運作方式](#orgs_manage_policies_declarative_policies-how-work)
+ [先決條件和許可](orgs_manage_policies_prereqs.md)
+ [了解政策繼承](orgs_manage_policies_inheritance_mgmt.md)
+ [檢視有效的政策](orgs_manage_policies_effective.md)
+ [無效的政策提醒](invalid-policy-alerts.md)
+ [EC2 政策](orgs_manage_policies_ec2.md)
+ [備份政策](orgs_manage_policies_backup.md)
+ [標籤政策](orgs_manage_policies_tag-policies.md)
+ [聊天應用程式政策](orgs_manage_policies_chatbot.md)
+ [AI 服務選擇退出政策](orgs_manage_policies_ai-opt-out.md)
+ [Security Hub 政策](orgs_manage_policies_security_hub.md)
+ [Amazon Bedrock 政策](orgs_manage_policies_bedrock.md)
+ [Amazon Inspector 政策](orgs_manage_policies_inspector.md)
+ [升級推展政策](orgs_manage_policies_upgrade_rollout.md)
+ [Amazon S3 政策](orgs_manage_policies_s3.md)
+ [AWS Shield Network Security Director 政策](orgs_manage_policies_network_security_director.md)