

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

# 使用 Neptune ML AWS CloudFormation 範本在新的資料庫叢集中快速開始使用
<a name="machine-learning-quick-start"></a>

開始使用 Neptune ML 最簡單的方法是使用 CloudFormation 快速入門範本。此範本會安裝所有必要的元件，包括新的 Neptune DB 叢集、所有必要的 IAM 角色，以及新的 Neptune 圖形筆記本，讓使用 Neptune ML 變得更輕鬆。

**建立 Neptune ML 快速入門堆疊**

1. 若要在 CloudFormation 主控台上啟動 CloudFormation 堆疊，請選擇下表中的其中一個**啟動堆疊**按鈕：    
[\[See the AWS documentation website for more details\]](http://docs.aws.amazon.com/zh_tw/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。

   然後選擇 **Create (建立)**。

快速入門範本會建立並設定下列項目：
+ Neptune 資料庫叢集。
+ 必要的 IAM 角色 (並附加它們)。
+ 必要的 Amazon EC2 安全群組。
+ 必要的 SageMaker AI VPC 端點。
+ Neptune ML 的資料庫叢集參數群組。
+ 該參數群組中的必要參數。
+ 預先填入 Neptune ML 筆記本範例的 SageMaker AI 筆記本。請注意，並非每個區域都提供所有執行個體大小，因此您必須確定選取的筆記型電腦執行個體大小是您所在地區支援的大小。
+ Neptune-Export 服務。

當快速入門堆疊準備就緒時，請前往範本建立的 SageMaker AI 筆記本，並查看預先填入的範例。它們將協助您下載要用於嘗試 Neptune ML 功能的範例資料集。

當您使用 Neptune ML 時，它們還可以為您節省大量時間。例如，請參閱這些筆記本支援的 [%neptune\$1ml](notebooks-magics.md#notebooks-line-magics-neptune_ml) 行魔法和 [%%neptune\$1ml](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)
```