

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

# 使用 Amazon S3 on Outposts 端點
<a name="S3OutpostsEndpointsWorking"></a>

若要將請求路由至 Amazon S3 on Outpost 存取點，您必須建立和設定 S3 on Outposts 端點。若要建立端點，您需要與 Outposts 主要區域的服務連結有效連接。Outpost 上的每個 Virtual Private Cloud (VPC) 可以有一個相關聯的端點。如需端點配額的詳細資訊，請參閱 [S3 on Outposts 網路需求](S3OnOutpostsRestrictionsLimitations.md#S3OnOutpostsConnectivityRestrictions)。您必須建立端點，才能存取您的 Outposts 儲存貯體並執行物件操作。如需更多詳細資訊，請參閱 [端點](S3OutpostsWorkingBuckets.md#S3OutpostsEP)。

建立端點後，您可以使用「狀態」欄位來了解端點狀態。若您的 Outposts 處於離線狀態，系統將回傳 CREATE\$1FAILED。您可以檢查服務連結的連線、刪除端點，然後在連線恢復後重試建立操作。如需其他錯誤代碼列表，請參閱下方內容。如需更多詳細資訊，請參閱 [端點](S3OutpostsWorkingBuckets.md#S3OutpostsEP)。


| API | Status | 失敗原因錯誤代碼 | 訊息 - 失敗原因 | 
| --- | --- | --- | --- | 
| CreateEndpoint | Create\$1Failed | OutpostNotReachable | 因為與 Outposts 主要區域的服務連結連線失敗，所以無法建立端點。請檢查您的連線狀態、刪除端點，然後再試一次。 | 
| CreateEndpoint | Create\$1Failed | InternalError | 由於內部錯誤，無法建立端點。請刪除端點然後重新建立一次。 | 
| DeleteEndpoint | Delete\$1Failed | OutpostNotReachable | 因為與 Outposts 主要區域的服務連結連線失敗，所以無法刪除端點。請檢查您的連線狀態，然後再試一次。 | 
| DeleteEndpoint | Delete\$1Failed | InternalError | 由於內部錯誤，無法刪除端點。請再試一次。 | 

如需在 S3 on Outposts 上使用儲存貯體的詳細資訊，請參閱 [使用 S3 on Outposts 儲存貯體](S3OutpostsWorkingBuckets.md)。

以下幾節描述如何建立和管理 S3 on Outposts 的端點。

**Topics**
+ [在 Outpost 上建立端點](S3OutpostsCreateEndpoint.md)
+ [檢視 Amazon S3 on Outposts 端點上的清單](S3OutpostsListEndpoints.md)
+ [刪除 Amazon S3 on Outposts 端點](S3OutpostsDeleteEndpoints.md)

# 在 Outpost 上建立端點
<a name="S3OutpostsCreateEndpoint"></a>

若要將請求路由至 Amazon S3 on Outpost 存取點，您必須建立和設定 S3 on Outposts 端點。若要建立端點，您需要與 Outposts 主要區域的服務連結有效連接。Outpost 上的每個 Virtual Private Cloud (VPC) 可以有一個相關聯的端點。如需端點配額的詳細資訊，請參閱 [S3 on Outposts 網路需求](S3OnOutpostsRestrictionsLimitations.md#S3OnOutpostsConnectivityRestrictions)。您必須建立端點，才能存取您的 Outposts 儲存貯體並執行物件操作。如需更多詳細資訊，請參閱 [端點](S3OutpostsWorkingBuckets.md#S3OutpostsEP)。

**許可**  
如需建立端點所需許可的詳細資訊，請參閱 [適用於 S3 on Outposts 端點的許可](S3OutpostsIAM.md#S3OutpostsEndpointPermissions)。

當您建立端點時，S3 on Outposts 也會在您的 AWS 帳戶 中建立服務連結角色。如需更多詳細資訊，請參閱 [針對 Amazon S3 on Outposts 使用服務連結角色](S3OutpostsServiceLinkedRoles.md)。

以下範例示範如何使用 AWS 管理主控台、AWS Command Line Interface (AWS CLI) 和 適用於 Java 的 AWS SDK 建立 S3 on Outposts 端點。

## 使用 S3 主控台
<a name="S3OutpostsCreateEndpointConsole"></a>

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

1. 在左側導覽窗格中，選擇 **Outposts access points** (Outposts 存取點)。

1. 選擇 **Outposts endpoints** (Outposts 端點) 索引標籤。

1. 選擇 **Create Outposts endpoint** (建立 Outposts 端點)。

1. 在 **Outpost** 下，選擇 Outpost 以建立此端點。

1. 在 **VPC** 下，選擇還沒有端點且符合 Ourposts 端點規則的 VPC。

   Virtual Private Cloud (VPC) 可讓您將 AWS 資源啟動到您定義的虛擬網路。這個虛擬網路與您在資料中心中操作的傳統網路非常相似，且具備使用 可擴展基礎設施的優勢AWS 

   如果您沒有 VPC，請選擇 **Create VPC** (建立 VPC)。如需詳細資訊，請參閱《Amazon S3 使用者指南》**中的[建立僅限虛擬私有雲端 (VPC) 使用的存取點](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-points-vpc.html)。

1. 選擇 **Create Outposts endpoint** (建立 Outposts 端點)。

## 使用 AWS CLI
<a name="S3OutpostsCreateEndpointCLI"></a>

**Example**  
下列 AWS CLI 範例使用 VPC 資源存取類型建立 Outpost 的端點。VPC 衍生自子網路。若要執行此命令，請以您自己的資訊取代 `user input placeholders`。  

```
aws s3outposts create-endpoint --outpost-id op-01ac5d28a6a232904 --subnet-id subnet-8c7a57c5 --security-group-id sg-ab19e0d1
```
下列 AWS CLI 範例使用客戶擁有的 IP 位址集區 (CoIP 集區) 存取類型為 Outpost 建立端點。若要執行此命令，請以您自己的資訊取代 `user input placeholders`。  

```
aws s3outposts create-endpoint --outpost-id op-01ac5d28a6a232904 --subnet-id subnet-8c7a57c5 --security-group-id sg-ab19e0d1 --access-type CustomerOwnedIp --customer-owned-ipv4-pool ipv4pool-coip-12345678901234567
```

## 使用適用於 Java 的 AWS 軟體開發套件
<a name="S3OutpostsCreateEndpointJava"></a>

**Example**  
如需如何使用適用於 Java 的 AWS SDK 為 S3 Outpost 建立端點的範例，請參閱《適用於 Java 的 AWS SDK 2.x 程式碼範例》**中的 [CreateOutpostsEndPoint.java](https://github.com/awsdocs/aws-doc-sdk-examples/blob/main/javav2/example_code/s3/src/main/java/com/example/s3/outposts/CreateOutpostsEndPoint.java)。

# 檢視 Amazon S3 on Outposts 端點上的清單
<a name="S3OutpostsListEndpoints"></a>

若要將請求路由至 Amazon S3 on Outpost 存取點，您必須建立和設定 S3 on Outposts 端點。若要建立端點，您需要與 Outposts 主要區域的服務連結有效連接。Outpost 上的每個 Virtual Private Cloud (VPC) 可以有一個相關聯的端點。如需端點配額的詳細資訊，請參閱 [S3 on Outposts 網路需求](S3OnOutpostsRestrictionsLimitations.md#S3OnOutpostsConnectivityRestrictions)。您必須建立端點，才能存取您的 Outposts 儲存貯體並執行物件操作。如需詳細資訊，請參閱[端點](S3OutpostsWorkingBuckets.md#S3OutpostsEP)。

下列範例示範如何使用 AWS 管理主控台、 AWS Command Line Interface (AWS CLI) 和 傳回 S3 on Outposts 端點的清單 適用於 Java 的 AWS SDK。

## 使用 S3 主控台
<a name="s3-outposts-endpoint-list"></a>

1. 開啟位於 [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/) 的 Amazon S3 主控台。

1. 在左側導覽窗格中，選擇 **Outposts access points** (Outposts 存取點)。

1. 在 **Outposts access points** (Outposts 存取點)頁面上，選擇 **Outposts endpoints** (Outposts 端點) 標籤。

1. 在 **Outposts endpoints** (Outposts 端點)中，您可以查看 S3 on Outposts 端點清單。

## 使用 AWS CLI
<a name="S3OutpostsListEndpointsCLI"></a>

下列 AWS CLI 範例列出與您帳戶相關聯之 AWS Outposts 資源的端點。如需此命令的詳細資訊，請參閱 *AWS CLI 參考*中的 [list-endpoints](https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3outposts/list-endpoints.html)。

```
aws s3outposts list-endpoints
```

## 使用適用於 Java 的 AWS 開發套件
<a name="S3OutpostsListEndpointsJava"></a>

下列適用於 Java 的開發套件範例列出了 Outpost 的端點。如需詳細資訊，請參閱 *Amazon Simple Storage Service API 參考*中的 [ListEndpoints](https://docs.aws.amazon.com/AmazonS3/latest/API/API_s3outposts_ListEndpoints.html)。

```
import com.amazonaws.services.s3outposts.AmazonS3Outposts;
import com.amazonaws.services.s3outposts.AmazonS3OutpostsClientBuilder;
import com.amazonaws.services.s3outposts.model.ListEndpointsRequest;
import com.amazonaws.services.s3outposts.model.ListEndpointsResult;

public void listEndpoints() {
    AmazonS3Outposts s3OutpostsClient = AmazonS3OutpostsClientBuilder
                .standard().build();
                
    ListEndpointsRequest listEndpointsRequest = new ListEndpointsRequest();
    ListEndpointsResult listEndpointsResult = s3OutpostsClient.listEndpoints(listEndpointsRequest);
    System.out.println("List endpoints result is " + listEndpointsResult);
}
```

# 刪除 Amazon S3 on Outposts 端點
<a name="S3OutpostsDeleteEndpoints"></a>

若要將請求路由至 Amazon S3 on Outpost 存取點，您必須建立和設定 S3 on Outposts 端點。若要建立端點，您需要與 Outposts 主要區域的服務連結有效連接。Outpost 上的每個 Virtual Private Cloud (VPC) 可以有一個相關聯的端點。如需端點配額的詳細資訊，請參閱 [S3 on Outposts 網路需求](S3OnOutpostsRestrictionsLimitations.md#S3OnOutpostsConnectivityRestrictions)。您必須建立端點，才能存取您的 Outposts 儲存貯體並執行物件操作。如需詳細資訊，請參閱[端點](S3OutpostsWorkingBuckets.md#S3OutpostsEP)。

下列範例示範如何使用 AWS 管理主控台、 AWS Command Line Interface (AWS CLI) 和 刪除 S3 on Outposts 端點 適用於 Java 的 AWS SDK。

## 使用 S3 主控台
<a name="s3-outposts-endpoint-delete"></a>

1. 開啟位於 [https://console.aws.amazon.com/s3/](https://console.aws.amazon.com/s3/) 的 Amazon S3 主控台。

1. 在左側導覽窗格中，選擇 **Outposts access points** (Outposts 存取點)。

1. 在 **Outposts access points** (Outposts 存取點)頁面上，選擇 **Outposts endpoints** (Outposts 端點) 標籤。

1. 在 **Outposts 端點**下，選擇您要刪除的端點，然後選擇**Delete** (刪除)。

## 使用 AWS CLI
<a name="S3OutpostsDeleteEndpointCLI"></a>

下列 AWS CLI 範例會刪除 Outpost 的端點。若要執行此命令，請以您自己的資訊取代 `user input placeholders`。

```
aws s3outposts delete-endpoint --endpoint-id example-endpoint-id --outpost-id op-01ac5d28a6a232904
```

## 使用適用於 Java 的 AWS 開發套件
<a name="S3OutpostsDeleteEndpointJava"></a>

下列適用於 Java 的開發套件範例刪除 Outpost 的端點。若要使用此範例，請以您自己的資訊取代 `user input placeholders`。

```
import com.amazonaws.arn.Arn;
import com.amazonaws.services.s3outposts.AmazonS3Outposts;
import com.amazonaws.services.s3outposts.AmazonS3OutpostsClientBuilder;
import com.amazonaws.services.s3outposts.model.DeleteEndpointRequest;

public void deleteEndpoint(String endpointArnInput) {
    String outpostId = "op-01ac5d28a6a232904";
    AmazonS3Outposts s3OutpostsClient = AmazonS3OutpostsClientBuilder
                .standard().build();
                
    Arn endpointArn = Arn.fromString(endpointArnInput);
    String[] resourceParts = endpointArn.getResource().getResource().split("/");
    String endpointId = resourceParts[resourceParts.length - 1];
    DeleteEndpointRequest deleteEndpointRequest = new DeleteEndpointRequest()
                .withEndpointId(endpointId)
                .withOutpostId(outpostId);
    s3OutpostsClient.deleteEndpoint(deleteEndpointRequest);
    System.out.println("Endpoint with id " + endpointId + " is deleted.");
}
```