

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

# 使用 Neptune ML AWS CloudFormation 模板在新的数据库集群中快速入门
<a name="machine-learning-quick-start"></a>

开始使用 Neptune ML 的最简单方式是使用 CloudFormation 快速入门模板。此模板安装了所有必需的组件，包括新的 Neptune 数据库集群、所有必要的 IAM 角色和新的 Neptune 图形笔记本，以便更轻松地使用 Neptune ML。

**创建 Neptune ML 快速入门堆栈**

1. 要在 CloudFormation 控制台中启动 CloudFormation 堆栈，请选择下表中的**启动堆栈**按钮之一：    
[See the AWS documentation website for more details](http://docs.aws.amazon.com/zh_cn/neptune/latest/userguide/machine-learning-quick-start.html)

1.  在 **Select Template** 页面上，选择 **Next**。

1. 在**指定详细信息**页面上，选择**下一步**。

1. 在**选项**页面上，选择**下一步**。

1. 在**审核**页面上，您需要勾选两个复选框：
   + 第一个复选框确认 AWS CloudFormation 可能会创建具有自定义名称的 IAM 资源。
   + 第二个复选框确认 AWS CloudFormation 可能需要新堆栈的 `CAPABILITY_AUTO_EXPAND` 功能。`CAPABILITY_AUTO_EXPAND` 显式允许 CloudFormation 在创建堆栈时自动扩展宏，无需事先审核。

     客户通常从处理的模板创建更改集，以便在实际创建堆栈之前对宏所做的更改进行审核。有关更多信息，请参阅 CloudFormation [CreateStack](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html) API。

   然后选择**创建**。

快速入门模板创建和设置以下内容：
+ Neptune 数据库集群。
+ 所需的 IAM 角色（并附加它们）。
+ 所需的 Amazon EC2 安全组。
+ 所需的 SageMaker AI VPC 端点。
+ Neptune ML 的数据库集群参数组。
+ 该参数组中的所需参数。
+ SageMaker AI 笔记本，预填充了 Neptune ML 的笔记本样本。请注意，并非每个区域都提供所有实例大小，因此，您需要确保所选的笔记本实例大小是您所在区域支持的大小。
+ Neptune-Export 服务。

快速入门堆栈准备就绪后，前往模板创建的 SageMaker AI 笔记本并查看预先填充的示例。它们将帮助您下载示例数据集，用于体验 Neptune ML 功能。

当您使用 Neptune ML 时，它们还可以为您节省大量时间。例如，请参阅这些笔记本支持的 [%neptune\_ml](notebooks-magics.md#notebooks-line-magics-neptune_ml) 行魔术命令和 [%%neptune\_ml](notebooks-magics.md#notebooks-cell-magics-neptune_ml) 单元格魔术命令。

您也可以使用以下 AWS CLI 命令来运行快速入门 CloudFormation 模板：

```
aws cloudformation create-stack \
  --stack-name neptune-ml-fullstack-$(date '+%Y-%m-%d-%H-%M') \
  --template-url https://aws-neptune-customer-samples.s3.amazonaws.com/v2/cloudformation-templates/neptune-ml-nested-stack.json \
  --parameters ParameterKey=EnableIAMAuthOnExportAPI,ParameterValue={{(true if you have IAM auth enabled, or false otherwise)}} \
               ParameterKey=Env,ParameterValue=test$(date '+%H%M')\
  --capabilities CAPABILITY_IAM \
  --region {{(the AWS region, like us-east-1)}} \
  --disable-rollback \
  --profile {{(optionally, a named CLI profile of yours)}}
```