

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

# 在 Amazon SNS 中移除訂閱篩選條件政策
<a name="message-filtering-policy-remove"></a>

若要停止篩選傳送到訂閱的訊息，請以空的 JSON 內文覆寫訂閱的篩選政策來移除政策。移除政策後，訂閱會接受發佈給它的每個訊息。

## 使用 AWS 管理主控台
<a name="message-filtering-policy-remove-console"></a>

1. 登入 [Amazon SNS 主控台](https://console.aws.amazon.com/sns/home)。

1. 在導覽面板上，選擇 **Subscriptions (訂閱)**。

1. 選取訂閱，然後選擇 **Edit** (編輯)。

1. 在 **Edit {{EXAMPLE1-23bc-4567-d890-ef12g3hij456}}** (EXAMPLE1-23bc-4567-d890-ef12g3hij456) 頁面上，展開 **Subscription filter policy** (訂閱篩選政策) 區段。

1. 在 **JSON editor** (JSON 編輯器) 欄位中，提供您篩選政策的空白 JSON 內文：`{}`。

1. 選擇**儲存變更**。

   Amazon SNS 套用您的篩選政策到訂閱。

## 使用 AWS CLI
<a name="message-filtering-policy-remove-cli"></a>

若要使用 移除篩選條件政策 AWS CLI，請使用 [https://docs.aws.amazon.com/cli/latest/reference/sns/set-subscription-attributes.html](https://docs.aws.amazon.com/cli/latest/reference/sns/set-subscription-attributes.html)命令，並為`--attribute-value`引數提供空的 JSON 內文：

```
$ aws sns set-subscription-attributes --subscription-arn {{arn:aws:sns: ...}} --attribute-name FilterPolicy --attribute-value "{}"
```

## 使用 Amazon SNS API
<a name="message-filtering-policy-remove-api"></a>

若要使用 Amazon SNS API 移除篩選政策，請提出 [https://docs.aws.amazon.com/sns/latest/api/API_SetSubscriptionAttributes.html](https://docs.aws.amazon.com/sns/latest/api/API_SetSubscriptionAttributes.html) 動作的請求。將 `AttributeName` 參數設定為 `FilterPolicy`，並為 `AttributeValue` 參數提供空的 JSON 內文。