

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

# 使用 API 在 Amazon SNS 中建立資料保護政策
<a name="sns-message-data-protection-configure-api"></a>

**重要**  
Amazon SNS 訊息資料保護不再提供給新客戶。如需替代方案的詳細資訊和指引，請參閱 [Amazon SNS 訊息資料保護可用性變更](https://docs.aws.amazon.com/sns/latest/dg/sns-message-data-protection-availability-change.html)。

 AWS 帳戶中 Amazon SNS 資源的數量和大小有限。如需詳細資訊，請參閱 [Amazon Simple Notification Service 端點和配額](https://docs.aws.amazon.com/general/latest/gr/sns.html)。

## 使用 API 建立資料保護政策
<a name="create-policies-api"></a>

使用 AWS API 建立 Amazon SNS 資料保護政策。

**建立資料保護政策與 Amazon SNS 主題 (AWS API)**  
使用標準 Amazon SNS 主題的 `DataProtectionPolicy` 屬性：
+ [https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html](https://docs.aws.amazon.com/sns/latest/api/API_CreateTopic.html)

**擷取或建立現有 Amazon SNS 主題 (AWS API) 的資料保護政策**  
呼叫以下其中一項操作：
+ [GetDataProtectionPolicy](https://docs.aws.amazon.com/sns/latest/api/API_GetDataProtectionPolicy.html)
+ [PutDataProtectionPolicy](https://docs.aws.amazon.com/sns/latest/api/API_PutDataProtectionPolicy.html)