

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

# 使用 Amazon S3 Intelligent-Tiering 管理儲存成本
<a name="intelligent-tiering"></a>

S3 Intelligent-Tiering 儲存類別旨在透過在存取模式變更時自動將資料移動到最具成本效益的存取層，將儲存成本最佳化，且帶來額外營運負荷或不會影響效能。只需每月支付少許的物件監控和自動化費用，S3 Intelligent-Tiering 即可監控存取模式，並自動將未存取的物件移至低成本層。

S3 Intelligent-Tiering 可在三個低延遲和高輸送量存取層中自動節省儲存成本。對於可非同步存取的資料，您可以選擇啟用 S3 Intelligent-Tiering 儲存方案內的自動封存功能。S3 Intelligent-Tiering 不會產生擷取費。如果物件稍後在不常存取層或 Archive Instant 存取層受到存取，則它會自動將物件移回經常存取層。在 S3 Intelligent-Tiering 儲存方案內於存取層間移動物件時，不會產生額外的分層費用。

S3 Intelligent-Tiering 是推薦用於存取模式未知、不斷變化或無法預測，且與物件大小或保留期無關的儲存方案，例如資料湖、資料分析和新應用程式。

 S3 Intelligent-Tiering 儲存類別支援所有 Amazon S3 功能，包括：
+ S3 庫存，用於驗證物件的存取層
+ S3 複寫，用於將資料複寫到任何 AWS 區域
+ S3 Storage Lens，用於檢視儲存用量和活動指標
+ 伺服器端加密，用於保護物件資料
+ S3 物件鎖定，用於防止意外刪除資料
+ AWS PrivateLink，用於透過虛擬私有雲端 (VPC) 中的私有端點存取 Amazon S3

如需有關使用 S3 Intelligent-Tiering 的資訊，請參閱下列各節：

**Topics**
+ [S3 Intelligent-Tiering 的運作方式](intelligent-tiering-overview.md)
+ [使用 S3 Intelligent-Tiering](using-intelligent-tiering.md)
+ [管理 S3 Intelligent-Tiering](intelligent-tiering-managing.md)

# S3 Intelligent-Tiering 的運作方式
<a name="intelligent-tiering-overview"></a>

Amazon S3 Intelligent-Tiering 儲存類別會自動將物件存放在三個存取層。一個層針對頻繁存取進行最佳化，一個較低成本層針對不常存取進行最佳化，另一個非常低成本的層針對很少存取的資料進行最佳化。對於低廉的物件監控和自動化月費，S3 Intelligent-Tiering 會監控存取模式，並自動將連續 30 天未存取過的物件移至不常存取層。未存取達到 90 天之後，物件會移至 Archive Instant 存取層，而不會影響效能或操作額外負荷。

若要取得可在幾分鐘到幾小時內存取的最低資料儲存成本，請啟用封存功能以新增兩個額外存取層。您可以將物件分層至 Archive Access 層、Deep Archive Access 層或兩者。透過 Archive Access，S3 智慧型分層服務會將最少連續 90 天未存取過的物件移至 Archive Access 層。透過 Deep Archive Access，S3 智慧型分層服務會將最少連續 180 天未存取過的物件移至 Deep Archive Access 層。對於這兩個層，您可以根據需要配置無法存取的天數。

以下動作構成存取，可防止物件分層至 Archive Access 層或 Deep Archive Access 層：
+ 透過 Amazon S3 主控台下載或複製物件。
+ 使用 S3 批次複寫叫用 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) 或複寫物件。在這些情況下，複製或複寫操作的來源物件會分層。
+ 呼叫 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html) 或 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html)。

例如，如果在指定的無存取天數 (例如 180 天) 之前透過 `SelectObjectContent` 存取物件，則該動作會重設計時器。直到最後一個 `SelectObjectContent` 請求到達指定的天數為止，您的物件不會移至 Archive Access 層或 Deep Archive Access 層。

如果物件稍後在不常存取層或 Archive Instant 存取層受到存取，則它會自動將物件移回經常存取層。

下列動作會自動將物件從不常存取層或 Archive Instant 存取層移回經常存取層：
+ 透過 Amazon S3 主控台下載或複製物件。
+ 使用 Batch 複寫呼叫 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html) 或複寫物件。在這些情況下，複製或複寫操作的來源物件會分層。
+ 調用 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObject.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_RestoreObject.html) 或 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html)。

其他動作**不會**自動將物件從不常存取層至物件移回經常存取層。以下是此類動作的範例，而非明確清單：
+ 叫用 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjects.html)[https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectsV2.html)、[https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions)、 和 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateObjectEncryption.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UpdateObjectEncryption.html)。
+ 呼叫 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_SelectObjectContent.html) 並不構成將物件層級至頻繁存取層的存取權。此外，這不會防止物件從 Frequent Access 層下移至 Infrequent Access 層，然後再移到 Archive Instant Access 層。

您可以將 S3 Intelligent-Tiering 做為新建立資料的預設儲存類別，方法是在呼叫 `PutObject`、`CopyObject` 或 `CreateMultipartUpload` 操作時在 [x-amz-storage-class 請求標頭](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#AmazonS3-PutObject-request-header-StorageClass)中指定 `INTELLIGENT-TIERING`。S3 Intelligent-Tiering 旨在提供的設計可提供 99.9% 的可用性和 99.999999999% 的耐用性。

**注意**  
若物件大小低於 128 KB，便不會受到監控且不符合自動分層的資格。較小的物件一律儲存在經常存取層中。

## S3 Intelligent-Tiering 存取層
<a name="intel-tiering-tier-definition"></a>

下一節說明不同的自動和選用存取層。當物件在存取層之間移動時，儲存體類別會保持不變 (S3 Intelligent-Tiering)。

經常存取層 (自動)  
這是在其生命週期中建立或轉換到 S3 Intelligent-Tiering 的任何物件的預設存取層。物件在被存取時，就會保留在此層中。Frequent Access 層可提供低延遲和高輸送量效能。

不常存取層 (自動)  
如果物件連續 30 天未被存取，則物件會移至不常存取層。Infrequent Access 層可提供低延遲和高輸送量效能。

Archive Instant 存取層 (自動)  
如果物件連續 90 天未被存取，則物件會移至 Archive Instant 存取層。Archive Instant Access 層可提供低延遲和高輸送量效能。

Archive Access 層 (選用)  
S3 Intelligent-Tiering 可讓您選擇啟用封存存取層，以取得可以非同步存取的資料。啟用後，封存存取層會自動封存至少連續 90 天未存取過的物件。您可以將封存的最後存取時間延長至最多 730 天。封存存取層的效能與 [S3 Glacier Flexible Retrieval](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html#sc-glacier) 儲存類別相同。  
此存取層的標準擷取時間範圍為 3-5 小時。如果您使用 S3 批次操作啟動還原請求，還原會在幾分鐘內開始。如需擷取選項和時間的詳細資訊，請參閱 [從 S3 Intelligent-Tiering 封存存取層和 Deep Archive 存取層還原物件](intelligent-tiering-managing.md#restore-data-from-int-tier-archive)。  
只有在您想要略過 Archive Instant 存取層時，才啟用封存存取層 90 天。Archive Access 層提供略低的儲存成本，擷取時間在幾分鐘到幾小時之間。Archive Instant Access 層可提供毫秒存取和高輸送量效能。

Deep Archive Access 層 (選用)  
S3 Intelligent-Tiering 可讓您選擇啟用 Deep Archive 存取層，以取得可以非同步存取的資料。啟用後，Deep Archive 存取層會自動封存至少連續 180 天未存取過的物件。您可以將封存的最後存取時間延長至最多 730 天。Deep Archive Access 層的效能與 [S3 Glacier Deep Archive](https://docs.aws.amazon.com/AmazonS3/latest/userguide/storage-class-intro.html#sc-glacier) 儲存方案相同。  
此存取層中的物件標準擷取會在 12 小時內進行。如果您使用 S3 批次操作啟動還原請求，還原會在 9 小時內開始。如需擷取選項和時間的詳細資訊，請參閱 [從 S3 Intelligent-Tiering 封存存取層和 Deep Archive 存取層還原物件](intelligent-tiering-managing.md#restore-data-from-int-tier-archive)。

**注意**  
只有當應用程式可以非同步存取物件時，才可啟用 Archive Access 和 Deep Archive Access 層。如果您要擷取的物件存放在 Archive Access 或 Deep Archive Access 層中，則必須先使用 `RestoreObject` 操作還原物件。  
您可以從 S3 Intelligent-Tiering Archive Access 和 S3 Intelligent-Tiering Deep Archive Access 還原封存物件，每個 AWS 區域每個帳戶每秒最多 1，000 筆交易 (TPS) 的物件還原請求。

# 使用 S3 Intelligent-Tiering
<a name="using-intelligent-tiering"></a>

您可以使用 S3 Intelligent-Tiering 儲存方案，以自動最佳化儲存成本。當存取模式改變時，S3 Intelligent-Tiering 可在精密物件層級上兩個存取層之間移動資料，以自動節省成本的雲端儲存。對於可以非同步存取的資料，您可以選擇使用 AWS CLI AWS 管理主控台或 Amazon S33 API 在 S3 Intelligent-Tiering 儲存類別中啟用自動封存。

## 將資料移至 S3 Intelligent-Tiering
<a name="moving-data-to-int-tiering"></a>

有兩種方法可以將資料移至 S3 Intelligent-Tiering。您可以從主控台直接將物件上傳至 S3 Intelligent-Tiering，或使用 `PUT` 操作以程式設計方式上傳物件。如需詳細資訊，請參閱[設定物件的儲存體方案](sc-howtoset.md)。您也可以設定 S3 生命週期組態，以將物件從 S3 Standard 或 S3 Standard - Standard-Infrequent 轉換為 S3 Intelligent-Tiering。

### 使用 Direct Put 將資料上傳至 S3 Intelligent-Tiering
<a name="moving-data-to-int-tiering-directPUT"></a>

當您使用 [PUT](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) API 操作將物件上傳至 S3 Intelligent-Tiering 儲存方案時，您可在 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#API_PutObject_RequestSyntax](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html#API_PutObject_RequestSyntax) 請求標頭中指定 S3 Intelligent-Tiering。

以下請求會將映像 `my-image.jpg` 存放在 `myBucket` 儲存貯體中。此要求會使用 `x-amz-storage-class` 標頭，以請求使用 S3 Intelligent-Tiering 儲存方案存放物件。

**Example**  

```
PUT /my-image.jpg HTTP/1.1
Host: myBucket.s3.<Region>.amazonaws.com (http://amazonaws.com/)
Date: Wed, 1 Sep 2021 17:50:00 GMT
Authorization: authorization string
Content-Type: image/jpeg
Content-Length: 11434
Expect: 100-continue
x-amz-storage-class: INTELLIGENT_TIERING
```

### 使用 S3 生命週期將資料從 S3 Standard 或 S3 標準 - 不常存取轉換為 S3 Intelligent-Tiering
<a name="moving-data-to-int-tiering-lifecycle"></a>

您可以在 S3 生命週期組態中新增規則，命令 Amazon S3 將物件從一個儲存方案轉換至另一個儲存方案。如需有關支援的轉換和相關限制的資訊，請參閱[使用 S3 生命週期轉換物件](https://docs.aws.amazon.com/AmazonS3/latest/userguide/lifecycle-transition-general-considerations.html)。

您可以在儲存貯體或字首層級指定 S3 生命週期組態。在此 S3 生命週期組態規則中，篩選條件指定了一個金鑰字首 (key prefix) (`documents/`)。因此，規則將會套用至其金鑰名稱字首為 `documents/` 的物件，例如 `documents/doc1.txt` 與 `documents/doc2.txt`。該規則會指定 `Transition` 動作，指示 Amazon S3 在建立物件的 0 天後，將其轉換為 S3 Intelligent-Tiering 儲存方案。在此情況下，物件在建立之後 UTC 時間的午夜，即符合轉換至 S3 Intelligent-Tiering 的條件。

**Example**  

```
<LifecycleConfiguration>
  <Rule>
    <ID>ExampleRule</ID>
    <Filter>
       <Prefix>documents/</Prefix>
    </Filter>
    <Status>Enabled</Status>
    <Transition>
      <Days>0</Days>
      <StorageClass>INTELLIGENT_TIERING</StorageClass>
    </Transition>
 </Rule>
</LifecycleConfiguration>
```

已啟用版本控制的儲存貯體會維持一個目前的物件版本，以及零或多個非目前的物件版本。您可以為目前及非目前的物件版本定義另外的生命週期規則。

如需詳細資訊，請參閱[生命週期組態元素](intro-lifecycle-rules.md)。

## 啟用 S3 Intelligent-Tiering Archive Access 和 Deep Archive Access 層
<a name="enable-auto-archiving-int-tiering"></a>

若要取得可在幾分鐘到數小時內存取之資料的最低儲存成本，您可以使用 或 Amazon S3 API 建立儲存貯體 AWS 管理主控台、字首或物件標籤層級組態 AWS CLI，來啟用一個或兩個封存存取層。

### 使用 S3 主控台
<a name="enable-auto-archiving-int-tiering-console"></a>

**若要啟用 S3 Intelligent-Tiering 自動封存**

1. 登入 AWS 管理主控台 ，並在 [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/)：// 開啟 Amazon S3 主控台。

1. 在 **Buckets (儲存貯體)** 清單中，選擇您所需的儲存貯體名稱。

1. 選擇 **Properties** (屬性)。

1. 導覽至 **S3 Intelligent-Tiering Archive configurations** (S3 Intelligent-Tiering Archive 組態) 區段並選擇 **Create configuration** (建立組態)。

1. 在 **Archive configuration settings** (Archive 組態設定) 區段中，為您的 S3 Intelligent-Tiering Archive 組態指定一個描述性組態名稱。

1. 在 **Choose a configuration scope** (選擇組態範圍) 下，選擇要使用的組態範圍。除此之外，您可以使用共用字首、物件標籤或兩者的組合，將組態範圍限制在儲存貯體內的指定物件。

   1. 若要限制組態的範圍，請選取 **Limit the scope of this configuration using one or more filters** (使用一或多個篩選條件限制此組態的範圍)。

   1. 若要使用單一字首限制組態的範圍，請在 **Prefix** (字首) 下輸入字首。

   1. 若要使用物件標籤限制組態的範圍，請選取 **Add tag** (新增標籤) 並輸入金鑰的值。

1. 在 **Status** (狀態) 下，選取 **Enable** (啟用)。

1. 在 **Archive settings** (封存設定) 區段中，選取一個或兩個要啟用的 Archive Access 層。

1. 選擇**建立**。

### 使用 AWS CLI
<a name="enable-auto-archiving-int-tiering-cli"></a>

您可以使用下列 AWS CLI 命令來管理 S3 Intelligent-Tiering 組態：
+ [https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-bucket-intelligent-tiering-configuration.html](https://docs.aws.amazon.com/cli/latest/reference/s3api/delete-bucket-intelligent-tiering-configuration.html)
+ [https://docs.aws.amazon.com/cli/latest/reference/s3api/get-bucket-intelligent-tiering-configuration.html](https://docs.aws.amazon.com/cli/latest/reference/s3api/get-bucket-intelligent-tiering-configuration.html)
+ [https://docs.aws.amazon.com/cli/latest/reference/s3api/list-bucket-intelligent-tiering-configurations.html](https://docs.aws.amazon.com/cli/latest/reference/s3api/list-bucket-intelligent-tiering-configurations.html)
+ [https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-intelligent-tiering-configuration.html](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-intelligent-tiering-configuration.html)

如需設定 的指示 AWS CLI，請參閱《[Amazon S3 API 參考》中的使用 AWS CLI 開發](https://docs.aws.amazon.com/AmazonS3/latest/API/setup-aws-cli.html) Amazon S3。 *Amazon S3 *

使用 時 AWS CLI，您無法將組態指定為 XML 檔案。您必須改為指定 JSON。下列是 XML S3 Intelligent-Tiering 組態範例與可在 AWS CLI 命令中指定的對等 JSON。

下列範例會將 S3 Intelligent-Tiering 組態放入指定的儲存貯體中。

**Example [https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-intelligent-tiering-configuration.html](https://docs.aws.amazon.com/cli/latest/reference/s3api/put-bucket-intelligent-tiering-configuration.html)**  

```
{
  "Id": "string",
  "Filter": {
    "Prefix": "string",
    "Tag": {
      "Key": "string",
      "Value": "string"
    },
    "And": {
      "Prefix": "string",
      "Tags": [
        {
          "Key": "string",
          "Value": "string"
        }
        ...
      ]
    }
  },
  "Status": "Enabled"|"Disabled",
  "Tierings": [
    {
      "Days": integer,
      "AccessTier": "ARCHIVE_ACCESS"|"DEEP_ARCHIVE_ACCESS"
    }
    ...
  ]
}
```

```
PUT /?intelligent-tiering&id=Id HTTP/1.1
Host: Bucket.s3.amazonaws.com
<?xml version="1.0" encoding="UTF-8"?>
<IntelligentTieringConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
   <Id>string</Id>
   <Filter>
      <And>
         <Prefix>string</Prefix>
         <Tag>
            <Key>string</Key>
            <Value>string</Value>
         </Tag>
         ...
      </And>
      <Prefix>string</Prefix>
      <Tag>
         <Key>string</Key>
         <Value>string</Value>
      </Tag>
   </Filter>
   <Status>string</Status>
   <Tiering>
      <AccessTier>string</AccessTier>
      <Days>integer</Days>
   </Tiering>
   ...
</IntelligentTieringConfiguration>
```

### 使用 PUT API 操作
<a name="enable-auto-archiving-int-tiering-api"></a>

您可以針對指定的儲存貯體使用 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketIntelligentTieringConfiguration.html) 操作，且每個儲存貯體最多 1,000 個 S3 Intelligent-Tiering 組態。您可以使用共用字首或物件標籤，來定義儲存貯體內的哪些物件適用於封存存取層。使用共用字首或物件標籤，可讓您符合特定商業應用程式、工作流程或內部組織。您也可以靈活地啟用 Archive Access 層、Deep Archive Access 層，或兩者。

## 開始使用 S3 智慧型分層服務
<a name="intelligent-tiering-tutorial"></a>

若要進一步了解如何使用 S3 智慧型分層服務，請參閱[教學課程：開始使用 S3 智慧型分層服務](https://aws.amazon.com/getting-started/hands-on/getting-started-using-amazon-s3-intelligent-tiering/?ref=docs_gateway/amazons3/using-intelligent-tiering.html)。

# 管理 S3 Intelligent-Tiering
<a name="intelligent-tiering-managing"></a>

S3 Intelligent-Tiering 儲存類別可在三個低延遲和高輸送量存取層中自動節省儲存成本。其還提供選用封存功能，協助您為可在數分鐘至數小時內存取的雲端資料取得最低儲存成本。

## 識別儲存在哪些 S3 Intelligent-Tiering 存取層物件中
<a name="identify-intelligent-tiering-access-tier"></a>

您可以使用 [Amazon S3 庫存清單](storage-inventory.md)取得物件及其對應中繼資料的清單，包括其 S3 Intelligent-Tiering 存取層。S3 庫存提供 CSV、ORC 或 Parquet 輸出檔案，當中列出您的物件及其對應中繼資料。您可以每天或每週接收 Amazon S3 儲存貯體或共用字首的這些庫存報告。(*共用字首*是指名稱以共用字串為開頭的物件。) 

## 在 S3 Intelligent-Tiering 中檢視物件的封存狀態
<a name="identify-archive-status"></a>

您可以設定 S3 事件通知，以便在 S3 Intelligent-Tiering 儲存類別中的物件移至 Archive Access 層或 Deep Archive Access 層時收到通知。如需詳細資訊，請參閱[啟用事件通知](how-to-enable-disable-notification-intro.md)。

Amazon S3 可以將事件通知發佈到 Amazon Simple Notification Service (Amazon SNS) 主題、Amazon Simple Queue Service (Amazon SQS) 佇列或 AWS Lambda 函數。如需詳細資訊，請參閱[Amazon S3 事件通知](EventNotifications.md)。

以下是 Amazon S3 傳送以發佈 `s3:IntelligentTiering` 事件的訊息範例。如需詳細資訊，請參閱[事件訊息結構](notification-content-structure.md)。

```
 1. {  
 2.    "Records":[  
 3.       {  
 4.          "eventVersion":"2.3",
 5.          "eventSource":"aws:s3",
 6.          "awsRegion":"us-west-2",
 7.          "eventTime":"1970-01-01T00:00:00.000Z",
 8.          "eventName":"IntelligentTiering",
 9.          "userIdentity":{  
10.             "principalId":"s3.amazonaws.com"
11.          },
12.          "requestParameters":{  
13.             "sourceIPAddress":"s3.amazonaws.com"
14.          },
15.          "responseElements":{  
16.             "x-amz-request-id":"C3D13FE58DE4C810",
17.             "x-amz-id-2":"FMyUVURIY8/IgAtTv8xRjskZQpcIZ9KG4V5Wp6S7S/JRWeUWerMUE5JgHvANOjpD"
18.          },
19.          "s3":{  
20.             "s3SchemaVersion":"1.0",
21.             "configurationId":"testConfigRule",
22.             "bucket":{  
23.                "name":"amzn-s3-demo-bucket",
24.                "ownerIdentity":{  
25.                   "principalId":"A3NL1KOZZKExample"
26.                },
27.                "arn":"arn:aws:s3:::amzn-s3-demo-bucket"
28.             },
29.             "object":{  
30.                "key":"HappyFace.jpg",
31.                "size":1024,
32.                "eTag":"d41d8cd98f00b204e9800998ecf8427e",              
33.             }
34.          },
35.          "intelligentTieringEventData":{
36.             "destinationAccessTier": "ARCHIVE_ACCESS"
37.             }
38.       }
39.    ]
40. }
```

您也可以使用 [`HEAD` 物件請求](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html)，以檢視物件的封存狀態。如果物件儲存在 S3 Intelligent-Tiering 儲存類別中且位於其中一個封存層，則 `HEAD` 物件回應將會顯示目前的封存層。若要顯示封存層，請求會使用 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html#API_HeadObject_ResponseElements](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html#API_HeadObject_ResponseElements) 標頭。

下列 `HEAD` 物件請求會傳回物件的中繼資料 (此案例中為 `my-image.jpg`)。

**Example**  

```
HEAD /my-image.jpg HTTP/1.1
Host: bucket.s3.region.amazonaws.com
Date: Wed, 28 Oct 2009 22:32:00 GMT
Authorization: AWS AKIAIOSFODNN7EXAMPLE:02236Q3V0RonhpaBX5sCYVf1bNRuU=
```

您也可以使用 `HEAD` 物件請求監控 `restore-object` 請求的狀態。如果封存還原正在進行中，`HEAD` 物件回會包含 [https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html#API_HeadObject_ResponseElements](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadObject.html#API_HeadObject_ResponseElements) 標頭。

以下 `HEAD` 物件回應範例顯示使用 S3 Intelligent-Tiering 封存的物件，且還原請求正在進行中。

**Example**  

```
HTTP/1.1 200 OK
x-amz-id-2: FSVaTMjrmBp3Izs1NnwBZeu7M19iI8UbxMbi0A8AirHANJBo+hEftBuiESACOMJp
x-amz-request-id: E5CEFCB143EB505A
Date: Fri, 13 Nov 2020 00:28:38 GMT
Last-Modified: Mon, 15 Oct 2012 21:58:07 GMT
ETag: "1accb31fcf202eba0c0f41fa2f09b4d7"
x-amz-storage-class: 'INTELLIGENT_TIERING'
x-amz-archive-status: 'ARCHIVE_ACCESS'
x-amz-restore: 'ongoing-request="true"'
x-amz-restore-request-date: 'Fri, 13 Nov 2020 00:20:00 GMT'
Accept-Ranges: bytes
Content-Type: binary/octet-stream
Content-Length: 300
Server: AmazonS3
```

## 從 S3 Intelligent-Tiering 封存存取層和 Deep Archive 存取層還原物件
<a name="restore-data-from-int-tier-archive"></a>

若要存取 S3 Intelligent-Tiering Archive Access 和 Deep Archive Access 層中的物件，您必須啟動[還原請求](https://docs.aws.amazon.com/AmazonS3/latest/userguide/restoring-objects.html)，然後等待物件移至 Frequent Access 層。如需封存物件的詳細資訊，請參閱[使用封存的物件](archived-objects.md)。

當您從 Archive Access 層或 Deep Archive Access 層還原物件時，物件會移回不經常存取層。之後，如果物件連續 30 天未被存取，則會自動移至不常存取層。然後，在至少連續 90 天無存取的情況下，物件會移至 Archive Access 層。在至少連續 180 天無存取的情況下，物件會移至 Deep Archive Access 層。如需詳細資訊，請參閱[S3 Intelligent-Tiering 的運作方式](intelligent-tiering-overview.md)。

您可以使用 Amazon S3 主控台、S3 批次操作、Amazon S3 REST API、 AWS SDKs 或 AWS Command Line Interface () 來還原封存的物件AWS CLI。如需詳細資訊，請參閱[使用封存的物件](archived-objects.md)。