

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

# 透過 VPC 介面端點提出 Amazon WorkSpaces API 請求
<a name="interface-vpc-endpoint"></a>

您可以透過虛擬私有雲端 (VPC) 中的[介面端點](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpce-interface.html)直接連線至 Amazon WorkSpaces API 端點，而不是透過網際網路進行連線。當您使用 VPC 介面端點時，VPC 與 Amazon WorkSpaces API 端點之間的通訊會在 AWS 網路內完全安全地執行。

**注意**  
此功能只能用於連線到 WorkSpaces API 端點。若要使用 WorkSpaces 用戶端連線至 WorkSpaces，需要網際網路連線能力，如 [WorkSpaces Personal 的 IP 位址和連接埠要求](workspaces-port-requirements.md) 所述。

Amazon WorkSpaces API 端點支援由 [AWS PrivateLink](https://aws.amazon.com/privatelink/) 提供支援的 [Amazon Virtual Private Cloud](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Introduction.html) (Amazon VPC) 介面端點。每個 VPC 端點都是由您的 VPC 子網路中一個或多個具私有 IP 地址的[網路介面](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html) (也稱為彈性網路介面，或 ENI) 來表示。

VPC 介面端點會將您的 VPC 直接連線至 Amazon WorkSpaces API 端點，無需網際網路閘道、NAT 裝置、VPN 連接或 Direct Connect 連線。VPC 中的執行個體不需要公用 IP 地址，就能與 Amazon WorkSpaces API 端點進行通訊。

您可以使用 或 AWS Command Line Interface (AWS CLI) 命令建立介面端點以連線至 AWS 管理主控台 Amazon WorkSpaces。如需指示，請參閱[建立介面端點](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/vpce-interface.html#create-interface-endpoint)。

*建立 VPC 端點之後*，您可透過下列使用 `endpoint-url` 參數的 CLI 命令範例，將介面端點指定至 Amazon WorkSpaces API 端點：

```
aws workspaces copy-workspace-image --endpoint-url VPC_Endpoint_ID.workspaces.Region.vpce.amazonaws.com

aws workspaces delete-workspace-image --endpoint-url VPC_Endpoint_ID.api.workspaces.Region.vpce.amazonaws.com

aws workspaces describe-workspace-bundles --endpoint-url VPC_Endpoint_ID.workspaces.Region.vpce.amazonaws.com  \
   --endpoint-name Endpoint_Name \
   --body "Endpoint_Body" \
   --content-type "Content_Type" \
       Output_File
```

如果您為 VPC 端點啟用私有 DNS 主機名稱，則不需要指定端點 URL。CLI 和 Amazon WorkSpaces SDK 根據預設使用的 Amazon WorkSpaces API DNS 主機名稱 (https://api.workspaces.*Region*.amazonaws.com) 會解析為您的 VPC 端點。

Amazon WorkSpaces API 端點在所有可使用 Amazon VPC 和 [Amazon WorkSpaces](https://aws.amazon.com/about-aws/global-infrastructure/regional-product-services) 的 AWS 區域中支援 VPC 端點。 [https://docs.aws.amazon.com/general/latest/gr/rande.html#vpc_region](https://docs.aws.amazon.com/general/latest/gr/rande.html#vpc_region)Amazon WorkSpaces 支援在您的 VPC 內呼叫其所有的[公用 API](https://docs.aws.amazon.com/workspaces/latest/api/welcome.html)。

若要進一步了解 AWS PrivateLink，請參閱 [AWS PrivateLink 文件](https://docs.aws.amazon.com/AmazonVPC/latest/UserGuide/VPC_Introduction.html#what-is-privatelink)。請參閱 [VPC 定價](https://aws.amazon.com/vpc/pricing/)以取得 VPC 端點的價格。若要進一步了解 VPC 與端點，請參閱 [Amazon VPC](https://docs.aws.amazon.com/vpc/latest/userguide/what-is-amazon-vpc.html)。

若要查看各區域的 Amazon WorkSpaces API 端點清單，請參閱 [WorkSpaces API 端點](workspaces-port-requirements.md#workspaces_api_endpoints)。