

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

# 建立端點
<a name="async-inference-create-endpoint-create-endpoint"></a>

取得模型和端點組態後，請使用 [https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpoint.html](https://docs.aws.amazon.com/sagemaker/latest/APIReference/API_CreateEndpoint.html) API 建立端點。端點名稱在 AWS 帳戶中的 AWS 區域中必須是唯一的。

下面會使用請求中指定的端點組態建立端點。Amazon SageMaker AI 使用端點來佈建資源和部署模型。

```
# The name of the endpoint.The name must be unique within an AWS Region in your AWS account.
endpoint_name = '<endpoint-name>' 

# The name of the endpoint configuration associated with this endpoint.
endpoint_config_name='<endpoint-config-name>'

create_endpoint_response = sagemaker_client.create_endpoint(
                                            EndpointName=endpoint_name, 
                                            EndpointConfigName=endpoint_config_name)
```

當您呼叫 `CreateEndpoint` API 時，Amazon SageMaker 非同步推論會傳送測試通知，以檢查您是否已設定 Amazon SNS 主題。Amazon SageMaker 非同步推論也會在呼叫 `UpdateEndpoint` 和 `UpdateEndpointWeightsAndCapacities` 之後傳送測試通知。如此可讓 SageMaker AI 檢查您是否具有必要許可。通知可以直接忽略。測試通知的格式如下：

```
{
    "eventVersion":"1.0",
    "eventSource":"aws:sagemaker",
    "eventName":"TestNotification"
}
```