

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 创建端点
<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 区域 in your AWS 账户.
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"
}
```