

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

# 使用 Amazon S3 on Outposts 進行開發
<a name="S3OutpostsDeveloping"></a>

使用 Amazon S3 on Outposts，您可以在 AWS Outposts 上建立 S3 儲存貯體，並針對需要本機資料存取、本機資料處理和資料駐留的應用程式，在內部部署輕鬆存放和擷取物件。S3 on Outposts 提供新的儲存類別 S3 Outposts (`OUTPOSTS`)，其使用 Amazon S3 APIs，旨在在您的多個裝置和伺服器上以持久且備援的方式存放資料 AWS Outposts。您可以使用存取點和透過 Virtual Private Cloud (VPC) 的端點連線，與您的 Outpost 儲存貯體進行通訊。就像在 Amazon S3 儲存貯體一樣，您在 Outpost 儲存貯體上可以使用同樣的 API 和功能，包括存取政策、加密和標記。您可以透過 AWS 管理主控台、 AWS Command Line Interface (AWS CLI)、SDK 或 REST API 使用 S3 on Outposts。 AWS SDKs 如需詳細資訊，請參閱[什麼是 Amazon S3 on Outposts？](S3onOutposts.md)

下列主題提供使用 S3 on Outposts 進行開發的資訊

**Topics**
+ [S3 on Outposts 支援的區域](S3OutpostsRegions.md)
+ [Amazon S3 on Outposts API 操作](S3OutpostsAPI.md)
+ [使用適用於 Java 的開發套件設定 S3 on Outposts 的 S3 控制用戶端](S3OutpostsCongfigureS3ControlClientJava.md)
+ [透過 IPv6 向 S3 on Outposts 提出請求](S3OutpostsIPv6-access.md)

# S3 on Outposts 支援的區域
<a name="S3OutpostsRegions"></a>

S3 on Outposts 在以下 AWS 區域 受到支援：
+ 美國東部 (維吉尼亞北部) (us-east-1)
+ 美國東部 (俄亥俄) (us-east-2)
+ 美國西部 (加利佛尼亞北部) (us-west-1)
+ 美國西部 (奧勒岡) (us-west-2)
+ 非洲 (開普敦) (af-south-1)
+ 亞太地區 (雅加達) (ap-sourtheast-3)
+ 亞太地區 (孟買) (ap-south-1)
+ 亞太地區 (大阪) (ap-northeast-3)
+ 亞太地區 (首爾) (ap-northeast-2)
+ 亞太地區 (新加坡) (ap-southeast-1)
+ 亞太地區 (雪梨) (ap-southeast-2)
+ 亞太地區 (東京) (ap-northeast-1)
+ 加拿大 (中部) (ca-central-1)
+ 歐洲 (法蘭克福) (eu-central-1)
+ 歐洲 (愛爾蘭) (eu-west-1)
+ 歐洲 (倫敦) (eu-west-2)
+ 歐洲 (米蘭) (eu-south-1)
+ 歐洲 (巴黎) (eu-west-3)
+ 歐洲 (斯德哥爾摩) (eu-north-1)
+ 以色列 (特拉維夫) (il-central-1)
+ 中東 (巴林) (me-south-1)
+ 南美洲 (聖保羅) (sa-east-1)
+ AWS GovCloud (美國東部) (us-gov-east-1)
+ AWS GovCloud (美國西部) (us-gov-west-1)

# Amazon S3 on Outposts API 操作
<a name="S3OutpostsAPI"></a>

本主題列出了您可以與 Amazon S3 on Outposts 搭配使用的 Amazon S3、Amazon S3 Control 和 Amazon S3 on Outposts API 操作。

**Topics**
+ [適用於管理物件的 Amazon S3 API 操作](#S3OutpostsAPIsObject)
+ [適用於管理儲存貯體的 Amazon S3 Control API 操作](#S3OutpostsAPIsBucket)
+ [適用於管理 Outposts 的 S3 on Outposts API 操作](#S3OutpostsAPIs)

## 適用於管理物件的 Amazon S3 API 操作
<a name="S3OutpostsAPIsObject"></a>

S3 on Outposts 設計為與 Amazon S3 一樣使用相同的物件 API 操作。您必須使用存取點來存取 Outpost 儲存貯體中的任何物件。當搭配 S3 on Outposts 使用物件 API 操作時，您可以提供 Outposts 存取點 Amazon Resource Name (ARN) 或存取點別名。如需存取點別名的詳細資訊，請參閱 [針對您的 S3 on Outposts 儲存貯體存取點使用儲存貯體樣式別名](s3-outposts-access-points-alias.md)。

Amazon S3 on Outposts 支援下列 Amazon S3 API 操作：
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_AbortMultipartUpload.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_CopyObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateMultipartUpload.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObject.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjects.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteObjectTagging.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_GetObjectTagging.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetObjectTagging.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_HeadBucket.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_ListMultipartUploads.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.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.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListObjectVersions.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListParts.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_PutObjectTagging.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObjectTagging.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html)

## 適用於管理儲存貯體的 Amazon S3 Control API 操作
<a name="S3OutpostsAPIsBucket"></a>

S3 on Outposts 支援下列適用於儲存貯體的 Amazon S3 Control API 操作。
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateAccessPoint.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_CreateBucket.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPoint.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteAccessPointPolicy.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucket.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucket.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketLifecycleConfiguration.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketLifecycleConfiguration.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketPolicy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketPolicy.html)
+  [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketReplication.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketReplication.html) 
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketTagging.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_DeleteBucketTagging.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPoint.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetAccessPointPolicy.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucket.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketLifecycleConfiguration.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketPolicy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketPolicy.html)
+  [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketReplication.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketReplication.html) 
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketTagging.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketTagging.html)
+  [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketVersioning.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_GetBucketVersioning.html) 
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPoints.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListAccessPoints.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListRegionalBuckets.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_ListRegionalBuckets.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutAccessPointPolicy.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketLifecycleConfiguration.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketPolicy.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketPolicy.html)
+  [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketReplication.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketReplication.html) 
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketTagging.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketTagging.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketVersioning.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_control_PutBucketVersioning.html)

## 適用於管理 Outposts 的 S3 on Outposts API 操作
<a name="S3OutpostsAPIs"></a>

S3 on Outposts 支援下列適用於管理端點的 Amazon S3 on Outposts API 操作。
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_CreateEndpoint.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_DeleteEndpoint.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListEndpoints.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListEndpoints.html)
+ [ListOutpostsWithS3](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListOutpostsWithS3.html)
+ [https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListSharedEndpoints.html](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListSharedEndpoints.html)

# 使用適用於 Java 的開發套件設定 S3 on Outposts 的 S3 控制用戶端
<a name="S3OutpostsCongfigureS3ControlClientJava"></a>

下列範例使用 適用於 Java 的 AWS SDK為 Amazon S3 on Outposts 設定 Amazon S3 控制用戶端。若要使用此範例，請以您自己的資訊取代每個 `user input placeholder`。

```
import com.amazonaws.auth.AWSStaticCredentialsProvider;
import com.amazonaws.auth.BasicAWSCredentials;
import com.amazonaws.services.s3control.AWSS3Control;
import com.amazonaws.services.s3control.AWSS3ControlClient;

public AWSS3Control createS3ControlClient() {

    String accessKey = AWSAccessKey;
    String secretKey = SecretAccessKey;
    BasicAWSCredentials awsCreds = new BasicAWSCredentials(accessKey, secretKey);

    return AWSS3ControlClient.builder().enableUseArnRegion()
            .withCredentials(new AWSStaticCredentialsProvider(awsCreds))
            .build();

}
```

# 透過 IPv6 向 S3 on Outposts 提出請求
<a name="S3OutpostsIPv6-access"></a>

Amazon S3 on Outposts 和 S3 on Outposts 雙堆疊端點支援使用 IPv6 或 IPv4 通訊協定，對 S3 on Outposts 儲存貯體提出請求。有了 S3 on Outposts 的 IPv6 支援，您可以使用 S3 on Outposts API 來透過 IPv6 網路存取和操作儲存貯體和控制平面資源。

**注意**  
IPv6 網路不支援 [S3 on Outposts 物件動作](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsAPI.html) (例如 `PutObject` 或 `GetObject`)。

透過 IPv6 網路存取 S3 on Outposts 不另行收費。如需有關 S3 on Outposts 的詳細資訊，請參閱 [S3 on Outposts 定價](https://aws.amazon.com/outposts/rack/pricing/)。

**Topics**
+ [IPv6 入門](#S3Outposts-ipv6-access-getting-started)
+ [使用雙堆疊端點來透過 IPv6 網路提出請求](#S3Outposts-ipv6-access-api)
+ [在 IAM 原則中使用 IPv6 地址](#S3Outposts-ipv6-access-iam)
+ [測試 IP 地址相容性](#S3Outposts-ipv6-access-test-compatabilty)
+ [搭配 使用 IPv6 AWS PrivateLink](#S3Outposts-ipv6-privatelink)
+ [使用 S3 on Outposts 雙堆疊端點](s3-outposts-dual-stack-endpoints.md)

## IPv6 入門
<a name="S3Outposts-ipv6-access-getting-started"></a>

若要透過 IPv6 向 S3 on Outposts 儲存貯體提出請求，您必須使用雙堆疊端點。下節說明如何使用雙堆疊端點透過 IPv6 提出請求。

下列是嘗試透過 IPv6 存取 S3 on Outposts 儲存貯體之前的重要考量：
+ 存取儲存貯體的用戶端與網路必須啟用才能使用 IPv6。
+ 虛擬託管式與路徑式請求都支援 IPv6 存取。如需詳細資訊，請參閱[使用 S3 on Outposts 雙堆疊端點](s3-outposts-dual-stack-endpoints.md)。
+ 如果您在 AWS Identity and Access Management (IAM) 使用者或 S3 on Outposts 儲存貯體政策中使用來源 IP 地址篩選，則必須更新政策以包含 IPv6 地址範圍。
**注意**  
此要求僅適用於 S3 on Outposts 儲存貯體操作，以及跨 IPv6 網路的控制平面資源。IPv6 網路不支援 [Amazon S3 on Outposts 物件動作](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsAPI.html)。
+ 使用 IPv6 時，伺服器會存取 IPv6 格式的日誌檔案輸出 IP 位址。您必須更新用來剖析 S3 on Outposts 日誌檔案的現有工具、指令碼與軟體，讓這些項目可以剖析 IPv6 格式的遠端 IP 位址。然後，更新的工具、指令碼和軟體將正確剖析 IPv6 格式的遠端 IP 位址。

## 使用雙堆疊端點來透過 IPv6 網路提出請求
<a name="S3Outposts-ipv6-access-api"></a>

若要透過 IPv6 使用 S3 on Outposts API 呼叫提出請求，您可以透過 AWS CLI 或 AWS SDK 使用雙堆疊端點。無論是透過 IPv6 通訊協定或 IPv4 通訊協定存取 S3 on Outposts，[Amazon S3 控制 API 操作](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsAPI.html#S3OutpostsAPIsBucket)和 [S3 on Outposts API 操作](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsAPI.html#S3OutpostsAPIs)的運作方式都相同。不過，請注意，IPv6 網路不支援 [S3 on Outposts 物件動作](https://docs.aws.amazon.com/AmazonS3/latest/userguide/S3OutpostsAPI.html) (例如 `PutObject` 或 `GetObject`)。

使用 AWS Command Line Interface (AWS CLI) 和 AWS SDKs時，您可以使用參數或旗標來變更為雙堆疊端點。您也可以直接指定雙堆疊端點來覆寫組態檔中的 S3 on Outposts 端點。

您可以使用雙堆疊端點，從下列任一位置透過 IPv6 存取 S3 on Outposts 儲存貯體：
+  AWS CLI，請參閱 [從 使用雙堆疊端點 AWS CLI](s3-outposts-dual-stack-endpoints.md#s3-outposts-dual-stack-endpoints-cli)。
+  AWS SDKs請參閱 [從 AWS SDKs 使用 S3 on Outposts 雙堆疊端點](s3-outposts-dual-stack-endpoints.md#s3-outposts-dual-stack-endpoints-sdks)。

## 在 IAM 原則中使用 IPv6 地址
<a name="S3Outposts-ipv6-access-iam"></a>

在嘗試使用 IPv6 通訊協定存取 S3 on Outposts 儲存貯體之前，請確保用於 IP 位址篩選條件的 IAM 使用者或 S3 on Outposts 儲存貯體政策皆已更新，以包含 IPv6 位址範圍。如果未更新 IP 位址篩選政策以處理 IPv6 位址，則嘗試使用 IPv6 通訊協定時，可能會失去對 S3 on Outposts 儲存貯體的存取權。

篩選 IP 位址的 IAM 政策使用 [IP 位址條件運算子](https://docs.aws.amazon.com/IAM/latest/UserGuide/reference_policies_elements.html#Conditions_IPAddress)。下列 S3 on Outposts 儲存貯體政策會使用 IP 位址條件運算子找出允許之 IPv4 位址的 54.240.143.\$1 IP 範圍。拒絕此範圍外的任何 IP 位址存取 S3 on Outposts 儲存貯體 (`DOC-EXAMPLE-BUCKET`)。因為所有的 IPv6 地址都在允許的範圍外，所以此原則可避免 IPv6 地址得以存取 `DOC-EXAMPLE-BUCKET`。

------
#### [ JSON ]

****  

```
{
    "Version":"2012-10-17",		 	 	 
    "Statement": [
        {
            "Sid": "IPAllow",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3-outposts:*",
            "Resource": "arn:aws:s3-outposts:us-east-1:111122223333:outpost/OUTPOSTS-ID/bucket/DOC-EXAMPLE-BUCKET/*",
            "Condition": {
                "IpAddress": {
                    "aws:SourceIp": "54.240.143.0/24"
                }
            }
        }
    ]
}
```

------

您可以修改 S3 on Outposts 儲存貯體政策的 `Condition` 元素，允許 IPv4 (`54.240.143.0/24`) 與 IPv6 (`2001:DB8:1234:5678::/64`) 位址範圍，如下列範例所示。您可使用本例所示的同類型 `Condition` 區塊，更新您的 IAM 使用者與儲存貯體原則。

```
1.        "Condition": {
2.          "IpAddress": {
3.             "aws:SourceIp": [
4.               "54.240.143.0/24",
5.                "2001:DB8:1234:5678::/64"
6.              ]
7.           }
8.         }
```

使用 IPv6 之前，您必須更新所有相關的 IAM 使用者與儲存貯體原則，它們會使用 IP 地址篩選條件允許 IPv6 地址範圍。除現有的 IPv4 地址範圍外，建議您也更新 IAM 原則的貴組織 IPv6 地址範圍。如需允許透過 IPv6 與 IPv4 存取的儲存貯體原則範例，請參閱[限制針對特定 IP 位址的存取](S3Outposts-example-bucket-policies.md#S3Outposts-example-bucket-policies-IP-1)。

您可以使用 [https://console.aws.amazon.com/iam/](https://console.aws.amazon.com/iam/)的 IAM 主控台來檢閱 IAM 使用者原則。如需 IAM 的詳細資訊，請參閱《[IAM 使用者指南](https://docs.aws.amazon.com/IAM/latest/UserGuide/)》。如需有關編輯 S3 on Outposts 儲存貯體政策的資訊，請參閱[新增或編輯 Amazon S3 on Outposts 儲存貯體的儲存貯體政策](S3OutpostsBucketPolicyEdit.md)。

## 測試 IP 地址相容性
<a name="S3Outposts-ipv6-access-test-compatabilty"></a>

如果您使用的是 Linux 或 Unix 執行個體，或 macOS X 平台，您可以透過 IPv6 測試對雙堆疊端點的存取權。例如，若要透過 IPv6 測試與 Amazon S3 on Outposts 端點的連線，請使用 `dig` 命令：

```
dig s3-outposts.us-west-2.api.aws AAAA +short
```

如果 IPv6 網路上的雙堆疊端點經過正確設定，則 `dig` 命令會傳回連線的 IPv6 位址。例如：

```
dig s3-outposts.us-west-2.api.aws AAAA +short

2600:1f14:2588:4800:b3a9:1460:159f:ebce

2600:1f14:2588:4802:6df6:c1fd:ef8a:fc76

2600:1f14:2588:4801:d802:8ccf:4e04:817
```

## 搭配 使用 IPv6 AWS PrivateLink
<a name="S3Outposts-ipv6-privatelink"></a>

S3 on Outposts 支援 AWS PrivateLink 服務和端點的 IPv6 通訊協定。透過 IPv6 通訊協定的 AWS PrivateLink 支援，您可以透過 IPv6 網路從內部部署或其他私有連線連線到 VPC 內的服務端點。[AWS PrivateLink 適用於 S3 on Outposts](https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-outposts-privatelink-interface-endpoints.html) 的 IPv6 支援也可讓您 AWS PrivateLink 與雙堆疊端點整合。如需如何為 啟用 IPv6 的步驟 AWS PrivateLink，請參閱[使用 AWS PrivateLink 服務和端點加速採用 IPv6](https://aws.amazon.com/blogs/networking-and-content-delivery/expedite-your-ipv6-adoption-with-privatelink-services-and-endpoints/)。

**注意**  
若要將支援的 IP 位址類型從 IPv4 更新為 IPv6，請參閱《AWS PrivateLink 使用者指南》**中的[修改支援的 IP 位址類型](https://docs.aws.amazon.com/vpc/latest/privatelink/configure-endpoint-service.html#supported-ip-address-types)。

### 搭配 使用 IPv6 AWS PrivateLink
<a name="3Outposts-ipv6-privatelink-dualstack-vpc"></a>

如果您使用 AWS PrivateLink 搭配 IPv6，則必須建立 IPv6 或雙堆疊 VPC 介面端點。如需如何使用 建立 VPC 端點的一般步驟 AWS 管理主控台，請參閱*AWS PrivateLink 《 使用者指南*》中的[使用介面 VPC 端點存取 AWS 服務](https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html#create-interface-endpoint)。

------
#### [ AWS 管理主控台 ]

使用下列程序建立連線至 S3 on Outposts 的介面 VPC 端點。

1. 登入 AWS 管理主控台 並開啟位於 https：//[https://console.aws.amazon.com/vpc/](https://console.aws.amazon.com/vpc/) 的 VPC 主控台。

1. 在導覽窗格中選擇**端點**。

1. 選擇**建立端點**。

1. 在 **Service category** (服務類別) 中，選擇​ **AWS services**。

1. 針對**服務名稱**，選擇 S3 on Outposts 服務 (**com.amazonaws.us-east-1.s3-outposts)。**

1. 對於 VPC，請選擇您將從中存取 S3 on Outposts 的 VPC。

1. 對於**子網路**，為每個可用區域選取一個子網路，您將從中存取 S3 on Outposts。您無法在相同的可用區域內選取多個子網路。系統會為您選取的每個子網路建立新的端點網路介面。系統預設會將子網路 IP 位址範圍的 IP 位址指派給端點網路介面。若要指定端點網路介面的 IP 位址，請選擇**指定 IP 地址**，並在子網路位址範圍輸入 IPv6 位址。

1. 對於 **IP 位址類型**，請選擇 **Dualstack**。將 IPv4 和 IPv6 位址指派給您的端點網路介面。只有當所有選取的子網都具有 IPv4 和 IPv6 地址範圍時，才支援此選項。

1. 對於**安全群組**，選擇要與 VPC 端點的端點網路界面建立關聯的安全群組。預設安全群組預設會與 VPC 建立關聯。

1. 針對**政策**，選擇**完整存取**，以允許 VPC 端點上所有資源的所有主體進行所有操作。否則，選擇**自訂**以連接 VPC 端點政策，該政策會控制主體在 VPC 端點上對資源執行操作所擁有的許可。只有服務支援 VPC 端點政策時，此選項才可用。如需詳細資訊，請參閱[端點政策](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-access.html)。

1. (選用) 若要新增標籤，請選擇 **Add new tag (新增標籤)**，然後輸入標籤的鍵和值。

1. 選擇**建立端點**。

**Example - S3 on Outposts 儲存貯體政策**  
若要允許 S3 on Outposts 與您的 VPC 端點互動，您可以更新 S3 on Outposts 政策，如下所示：  

```
{
    "Statement": [
        {
            "Effect": "Allow",
            "Action": "s3-outposts:*",
            "Resource": "*",
            "Principal": "*"
        }
    ]
}
```

------
#### [ AWS CLI ]

**注意**  
若要在 VPC 端點上啟用 IPv6 網路，您必須為 S3 on Outposts 的 `SupportedIpAddressType` 篩選條件設定 `IPv6`。

下列範例使用 `create-vpc-endpoint` 命令來建立新的雙堆疊介面端點。

```
aws ec2 create-vpc-endpoint \
--vpc-id vpc-12345678 \
--vpc-endpoint-type Interface \
--service-name com.amazonaws.us-east-1.s3-outposts \
--subnet-id subnet-12345678 \
--security-group-id sg-12345678 \
--ip-address-type dualstack \
--dns-options "DnsRecordIpType=dualstack"
```

根據 AWS PrivateLink 服務組態，新建立的端點連線可能需要由 VPC 端點服務提供者接受，才能使用。如需詳細資訊，請參閱《AWS PrivateLink 使用者指南》**中的[接受和拒絕端點連線請求](https://docs.aws.amazon.com/vpc/latest/privatelink/configure-endpoint-service.html#accept-reject-connection-requests)。

下列範例使用 `modify-vpc-endpoint` 命令，將僅限 IPv 的 VPC 端點更新為雙堆疊端點。雙堆疊端點允許存取 IPv4 和 IPv6 網路。

```
aws ec2 modify-vpc-endpoint \
--vpc-endpoint-id vpce-12345678 \
--add-subnet-ids subnet-12345678 \
--remove-subnet-ids subnet-12345678 \
--ip-address-type dualstack \
--dns-options "DnsRecordIpType=dualstack"
```

如需如何啟用 IPv6 網路的詳細資訊 AWS PrivateLink，請參閱[使用 AWS PrivateLink 服務和端點加速採用 IPv6](https://aws.amazon.com/blogs/networking-and-content-delivery/expedite-your-ipv6-adoption-with-privatelink-services-and-endpoints/)。

------

# 使用 S3 on Outposts 雙堆疊端點
<a name="s3-outposts-dual-stack-endpoints"></a>

S3 on Outposts 雙堆疊端點支援透過 IPv6 與 IPv4 對 S3 on Outposts 儲存貯體提出請求。本節說明如何使用 S3 on Outposts 雙堆疊端點。

**Topics**
+ [S3 on Outposts 雙堆疊端點](#s3-outposts-dual-stack-endpoints-description)
+ [從 使用雙堆疊端點 AWS CLI](#s3-outposts-dual-stack-endpoints-cli)
+ [從 AWS SDKs 使用 S3 on Outposts 雙堆疊端點](#s3-outposts-dual-stack-endpoints-sdks)

## S3 on Outposts 雙堆疊端點
<a name="s3-outposts-dual-stack-endpoints-description"></a>

當您對雙堆疊端點時提出請求時，S3 on Outposts 儲存貯體 URL 會解析為 IPv6 或 IPv4 位址。如需如何透過 IPv6 存取 S3 on Outposts 儲存貯體的詳細資訊，請參閱[透過 IPv6 向 S3 on Outposts 提出請求](S3OutpostsIPv6-access.md)。

若要透過雙堆疊端點存取 S3 on Outposts 儲存貯體，請使用路徑樣式端點名稱。S3 on Outposts 僅支援區域雙堆疊端點名稱，亦即，指定的名稱必須包含區域。

針對雙堆疊端點路徑樣式 FIP 端點，請使用下列命名慣例：

```
s3-outposts-fips.region.api.aws
```

針對雙堆疊非 FIP 端點，請使用下列命名慣例：

```
s3-outposts.region.api.aws
```

**注意**  
S3 on Outposts 中不支援虛擬託管樣式端點名稱。

## 從 使用雙堆疊端點 AWS CLI
<a name="s3-outposts-dual-stack-endpoints-cli"></a>

本節提供用於向雙堆疊端點提出請求的 AWS CLI 命令範例。如需設定 的指示 AWS CLI，請參閱 [開始使用適用於 Java 的 AWS CLI 和 開發套件](S3OutpostsGSCLIJava.md)。

您可以在 AWS Config 檔案的設定檔`true`中將組態值設定為 `use_dualstack_endpoint` ，將 `s3`和 `s3api` AWS CLI 命令提出的所有 Amazon S3 請求導向至指定區域的雙堆疊端點。您可以在組態檔案或命令中使用 `--region` 選項指定區域。

搭配 使用雙堆疊端點時 AWS CLI，僅支援`path`定址樣式。組態檔案中設定的定址樣式會決定儲存貯體名稱應包含主機名稱中，或是包含在 URL 中。如需詳細資訊，請參閱《AWS CLI 使用者指南》**中的 [https://docs.aws.amazon.com/cli/latest/reference/s3outposts/](https://docs.aws.amazon.com/cli/latest/reference/s3outposts/)。

若要透過 使用雙堆疊端點 AWS CLI，請將 `--endpoint-url` 參數與 `http://s3.dualstack.region.amazonaws.com`或 `https://s3-outposts-fips.region.api.aws`端點搭配使用，以用於任何 `s3control`或 `s3outposts`命令。

例如：

```
$  aws s3control list-regional-buckets --endpoint-url https://s3-outposts.region.api.aws
```

## 從 AWS SDKs 使用 S3 on Outposts 雙堆疊端點
<a name="s3-outposts-dual-stack-endpoints-sdks"></a>

本節提供如何使用 AWS 開發套件存取雙堆疊端點的範例。

### AWS SDK for Java 2.x 雙堆疊端點範例
<a name="s3-outposts-dual-stack-endpoints-examples-javav2"></a>

下列範例示範如何在使用 AWS SDK for Java 2.x建立 S3 on Outposts 用戶端時，使用 `S3ControlClient` 和 `S3OutpostsClient` 類別啟用雙堆疊端點。如需建立及測試 Amazon S3 on Outposts 的可行 Java 範例的指示，請參閱[開始使用適用於 Java 的 AWS CLI 和 開發套件](S3OutpostsGSCLIJava.md)。

**Example – 在啟用雙堆疊端點的情況下建立 `S3ControlClient` 類別**  

```
import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3control.S3ControlClient;
import software.amazon.awssdk.services.s3control.model.ListRegionalBucketsRequest;
import software.amazon.awssdk.services.s3control.model.ListRegionalBucketsResponse;
import software.amazon.awssdk.services.s3control.model.S3ControlException;


public class DualStackEndpointsExample1 {

    public static void main(String[] args) {
        Region clientRegion = Region.of("us-east-1");
        String accountId = "111122223333";
        String navyId = "9876543210";

        try {
            // Create an S3ControlClient with dual-stack endpoints enabled.
            S3ControlClient s3ControlClient = S3ControlClient.builder()
                                                             .region(clientRegion)
                                                             .dualstackEnabled(true)
                                                             .build();
            ListRegionalBucketsRequest listRegionalBucketsRequest = ListRegionalBucketsRequest.builder()
                                                                                              .accountId(accountId)
                                                                                              .outpostId(navyId)
                                                                                              .build();

            ListRegionalBucketsResponse listBuckets = s3ControlClient.listRegionalBuckets(listRegionalBucketsRequest);
            System.out.printf("ListRegionalBuckets Response: %s%n", listBuckets.toString());
        } catch (AmazonServiceException e) {
            // The call was transmitted successfully, but Amazon S3 on Outposts couldn't process
            // it, so it returned an error response.
            e.printStackTrace();
        }
        catch (S3ControlException e) {
            // Unknown exceptions will be thrown as an instance of this type.
            e.printStackTrace();
        } catch (SdkClientException e) {
            // Amazon S3 on Outposts couldn't be contacted for a response, or the client
            // couldn't parse the response from Amazon S3 on Outposts.
            e.printStackTrace();
        }
    }
}
```

**Example – 建立已啟用雙堆疊端點的 `S3OutpostsClient`**  

```
import com.amazonaws.AmazonServiceException;
import com.amazonaws.SdkClientException;
import software.amazon.awssdk.regions.Region;
import software.amazon.awssdk.services.s3outposts.S3OutpostsClient;
import software.amazon.awssdk.services.s3outposts.model.ListEndpointsRequest;
import software.amazon.awssdk.services.s3outposts.model.ListEndpointsResponse;
import software.amazon.awssdk.services.s3outposts.model.S3OutpostsException;


public class DualStackEndpointsExample2 {

    public static void main(String[] args) {
        Region clientRegion = Region.of("us-east-1");

        try {
            // Create an S3OutpostsClient with dual-stack endpoints enabled.
            S3OutpostsClient s3OutpostsClient = S3OutpostsClient.builder()
                                                              .region(clientRegion)
                                                              .dualstackEnabled(true)
                                                              .build();
            ListEndpointsRequest listEndpointsRequest = ListEndpointsRequest.builder().build();

            ListEndpointsResponse listEndpoints = s3OutpostsClient.listEndpoints(listEndpointsRequest);
            System.out.printf("ListEndpoints Response: %s%n", listEndpoints.toString());
        } catch (AmazonServiceException e) {
            // The call was transmitted successfully, but Amazon S3 on Outposts couldn't process
            // it, so it returned an error response.
            e.printStackTrace();
        }
        catch (S3OutpostsException e) {
            // Unknown exceptions will be thrown as an instance of this type.
            e.printStackTrace();
        } catch (SdkClientException e) {
            // Amazon S3 on Outposts couldn't be contacted for a response, or the client
            // couldn't parse the response from Amazon S3 on Outposts.
            e.printStackTrace();
        }
    }
}
```

如果您在 AWS SDK for Java 2.x Windows 上使用 ，您可能需要設定下列 Java 虛擬機器 (JVM) 屬性：

```
java.net.preferIPv6Addresses=true
```