

 **此頁面僅適用於使用 Vaults 和 2012 年原始 REST API 的 Amazon Glacier 服務的現有客戶。**

如果您要尋找封存儲存解決方案，建議您在 Amazon Glacier Instant Retrieval、S3 Glacier Flexible Retrieval 和 S3 Glacier Deep Archive 中使用 Amazon Glacier 儲存類別。 Amazon S3 若要進一步了解這些儲存選項，請參閱 [Amazon Glacier 儲存類別](https://aws.amazon.com/s3/storage-classes/glacier/)。

Amazon Glacier （原始獨立保存庫型服務） 不再接受新客戶。Amazon Glacier 是一項獨立服務，具有自己的 APIs，可將資料存放在保存庫中，並與 Amazon S3 和 Amazon S3 Glacier 儲存類別不同。您現有的資料將在 Amazon Glacier 中無限期保持安全且可存取。不需要遷移。對於低成本、長期的封存儲存， AWS 建議使用 [Amazon S3 Glacier 儲存類別](https://aws.amazon.com/s3/storage-classes/glacier/)，透過 S3 儲存貯體型 APIs、完整 AWS 區域 可用性、降低成本 AWS 和服務整合，提供卓越的客戶體驗。如果您想要增強功能，請考慮使用我們的解決方案指南，將資料從 Amazon S3 Glacier 保存庫傳輸至 Amazon S3 Glacier 儲存類別，以遷移至 Amazon S3 Glacier 儲存類別。 [AWS Amazon Glacier Amazon S3 ](https://aws.amazon.com/solutions/guidance/data-transfer-from-amazon-s3-glacier-vaults-to-amazon-s3/)

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

# 使用 設定保存庫通知 AWS Command Line Interface
<a name="configuring-notifications-cli"></a>

本節說明如何使用 AWS Command Line Interface設定保存庫通知。設定通知時，您要指定工作完成事件，其會觸發對 Amazon Simple Notification Service (Amazon SNS) 主題的通知。除了設定文件庫通知外，您也可以指定在啟動作業時發佈通知的主題。如果您的文件庫設定為通知特定事件，並且在作業啟動請求中指定通知，則會發送兩個通知。

請遵循下列步驟，使用 AWS CLI設定保存庫通知。

**Topics**
+ [（先決條件） 設定 AWS CLI](#Creating-Vaults-CLI-Setup)
+ [範例：使用 設定保存庫通知 AWS CLI](#Configure-Vault-Notifications-CLI-Implementation)

## （先決條件） 設定 AWS CLI
<a name="Creating-Vaults-CLI-Setup"></a>

1. 下載和設定 AWS CLI。如需相關指示，請參閱《AWS Command Line Interface 使用者指南》**中的下列主題：

    [安裝 AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/installing.html) 

   [設定 AWS Command Line Interface](https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html)

1. 在命令提示中輸入下列命令來驗證您的 AWS CLI 設定。這些命令不會明確提供登入資料，因此會使用預設描述檔的登入資料。
   + 嘗試使用幫助命令。

     ```
     aws help
     ```
   + 若要取得已設定帳戶上的 Amazon Glacier 保存庫清單，請使用 `list-vaults`命令。將 *123456789012* 取代為您的 AWS 帳戶 ID。

     ```
     aws glacier list-vaults --account-id 123456789012
     ```
   + 若要查看 目前的組態資料 AWS CLI，請使用 `aws configure list`命令。

     ```
     aws configure list
     ```

## 範例：使用 設定保存庫通知 AWS CLI
<a name="Configure-Vault-Notifications-CLI-Implementation"></a>

1. 使用 `set-vault-notifications` 命令，設定保存庫發生特定事件時將傳送的通知。根據預設，您不會收到任何通知。

   ```
   aws glacier set-vault-notifications --vault-name examplevault --account-id 111122223333 --vault-notification-config file://notificationconfig.json
   ```

1.  通知組態是 JSON 文件，如以下範例所示。

   ```
   {    
      "SNSTopic": "arn:aws:sns:us-west-2:012345678901:mytopic",    
      "Events": ["ArchiveRetrievalCompleted", "InventoryRetrievalCompleted"] 
   }
   ```

   如需針對 Amazon Glacier 使用 Amazon SNS 主題的詳細資訊，請參閱在 [Amazon Glacier 中設定保存庫通知：一般概念](configuring-notifications.html#configuring-notifications.general) Amazon Glacier 

   如需 Amazon SNS 的詳細資訊，請參閱 [Amazon SNS 入門](https://docs.aws.amazon.com/sns/latest/gsg/Welcome.html)。