

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

# AWS Serverless Application Repository 使用界面端點存取 (AWS PrivateLink)
<a name="vpc-interface-endpoints"></a>

您可以使用 在 VPC 與 之間 AWS PrivateLink 建立私有連線 AWS Serverless Application Repository。您可以 AWS Serverless Application Repository 像在 VPC 中一樣存取 ，無需使用網際網路閘道、NAT 裝置、VPN 連接或 Direct Connect 連線。VPC 中的執行個體不需要公有 IP 地址即可存取 AWS Serverless Application Repository。

您可以建立由 AWS PrivateLink提供支援的*介面端點*來建立此私有連線。我們會在您為介面端點啟用的每個子網中建立端點網路介面。這些是請求者管理的網路介面，可作為目的地為 AWS Serverless Application Repository之流量的進入點。

如需詳細資訊，請參閱《*AWS PrivateLink 指南*》中的「[透過 AWS PrivateLink存取 AWS 服務](https://docs.aws.amazon.com/vpc/latest/privatelink/privatelink-access-aws-services.html)」。

## 的考量事項 AWS Serverless Application Repository
<a name="vpc-endpoint-considerations"></a>

在您設定介面端點之前 AWS Serverless Application Repository，請檢閱《 *AWS PrivateLink 指南*》中的[考量事項](https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html#considerations-interface-endpoints)。

AWS Serverless Application Repository 支援透過介面端點呼叫其所有 API 動作。

## 建立 的介面端點 AWS Serverless Application Repository
<a name="vpc-endpoint-create"></a>

您可以使用 Amazon VPC AWS Serverless Application Repository 主控台或 AWS Command Line Interface () 建立 的介面端點AWS CLI。如需詳細資訊，請參閱《*AWS PrivateLink 指南*》中的「[建立介面端點](https://docs.aws.amazon.com/vpc/latest/privatelink/create-interface-endpoint.html#create-interface-endpoint-aws)」。

 AWS Serverless Application Repository 使用下列服務名稱建立 的介面端點：

```
com.amazonaws.region.serverlessrepo
```

如果您為介面端點啟用私有 DNS，您可以使用 AWS Serverless Application Repository 其預設的區域 DNS 名稱向 提出 API 請求。例如 `serverlessrepo.us-east-1.amazonaws.com`。

## 為您的介面端點建立端點政策
<a name="vpc-endpoint-policy"></a>

端點政策為 IAM 資源，您可將其連接至介面端點。預設端點政策允許 AWS Serverless Application Repository 透過介面端點完整存取 。若要控制允許 AWS Serverless Application Repository 從您的 VPC 存取 ，請將自訂端點政策連接至介面端點。

端點政策會指定以下資訊：
+ 可執行動作 (AWS 帳戶、IAM 使用者和 IAM 角色) 的主體。
+ 可執行的動作。
+ 可供執行動作的資源。

如需詳細資訊，請參閱《*AWS PrivateLink 指南*》中的「[使用端點政策控制對服務的存取](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-access.html)」。

**範例： AWS Serverless Application Repository 動作的 VPC 端點政策**  
以下是自訂端點政策的範例。當您將此政策連接到介面端點時，它會授予所有資源上所有主體的所列 AWS Serverless Application Repository 動作的存取權。下列範例允許所有使用者透過 VPC 端點建立應用程式的許可。

```
{
   "Statement": [
      {
         "Principal": "*",
         "Effect": "Allow",
         "Action": [
            "serverlessrepo:CreateApplication"
         ],
         "Resource":"*"
      }
   ]
}
```