

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

# 使用 AWS CloudFormation 設定 Neptune-to-Neptune 複寫與 Streams 消費者應用程式
<a name="streams-consumer-setup"></a>

您可以使用 CloudFormation 範本來設定 Neptune 串流消費者應用程式，以支援 Neptune-to-Neptune複寫。

**Topics**
+ [為您的區域選擇 CloudFormation 範本](#streams-consumer-cfn-by-region)
+ [新增有關您要建立之 Neptune 串流消費者堆疊的詳細資訊](#streams-consumer-cfn-stack-details)
+ [執行 CloudFormation 範本](#streams-consumer-cfn-complete)
+ [使用最新的 Lambda 成品更新串流輪詢器](#streams-consumer-cfn-update)

## 為您的區域選擇 CloudFormation 範本
<a name="streams-consumer-cfn-by-region"></a>

若要在 CloudFormation 主控台上啟動適當的 CloudFormation 堆疊，請根據 AWS 您要使用的 區域，選擇下表中的其中一個**啟動堆疊**按鈕。


| 區域 | 檢視 | 啟動 | 
| --- | --- | --- | 
| 美國東部 (維吉尼亞北部) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=us-east-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 美國東部 (俄亥俄) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=us-east-2#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 美國西部 (加利佛尼亞北部) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=us-west-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=us-west-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 美國西部 (奧勒岡) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=us-west-2#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 加拿大 (中部) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=ca-central-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=ca-central-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 南美洲 (聖保羅) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=sa-east-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=sa-east-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 歐洲 (斯德哥爾摩) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=eu-north-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=eu-north-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 歐洲 (愛爾蘭) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=eu-west-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 歐洲 (倫敦) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=eu-west-2#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| Europe (Paris) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=eu-west-3#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=eu-west-3#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 歐洲 (法蘭克福) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=eu-central-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=eu-central-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| Middle East (Bahrain) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=me-south-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=me-south-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 中東 (阿拉伯聯合大公國) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=me-central-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=me-central-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 以色列 (特拉維夫) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=il-central-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=il-central-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 非洲 (開普敦) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=af-south-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=af-south-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 亞太地區 (東京) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 亞太地區 (香港) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=ap-east-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=ap-east-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 亞太地區 (首爾) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-2#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=ap-northeast-2#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 亞太地區 (新加坡) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 亞太地區 (悉尼) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=ap-southeast-2#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 亞太地區 (孟買) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.aws.amazon.com/cloudformation/home?region=ap-south-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 中國 (北京) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.amazonaws.cn/cloudformation/home?region=cn-north-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.amazonaws.cn/cloudformation/home?region=cn-north-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| 中國 (寧夏) | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.amazonaws.cn/cloudformation/home?region=cn-northwest-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.amazonaws.cn/cloudformation/home?region=cn-northwest-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| AWS GovCloud （美國西部） | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-west-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-west-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 
| AWS GovCloud （美國東部） | [檢視](https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json) | [https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-east-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json](https://console.amazonaws-us-gov.com/cloudformation/home?region=us-gov-east-1#/stacks/new?stackName=NeptuneStreamPoller&templateURL=https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json)  | 

在 **Create Stack (建立堆疊)** 頁面中，選擇 **Next (下一步)**。

## 新增有關您要建立之 Neptune 串流消費者堆疊的詳細資訊
<a name="streams-consumer-cfn-stack-details"></a>

**Specify Stack Details (指定堆疊詳細資訊)** 頁面提供的屬性和參數，可用於控制應用程式設定。

**堆疊名稱**   –   您正在建立的新 CloudFormation 堆疊名稱。您通常可以使用預設值 `NeptuneStreamPoller`。

**Parameters (參數)** 下提供下列項目：

**串流消費者執行所在 VPC 的網路組態**
+ **`VPC`** – 提供輪詢 Lambda 函數將在其中執行的 VPC 名稱。
+ **`SubnetIDs`** – 要建立網路界面的子網路。新增與 Neptune 叢集對應的子網路。
+ **`SecurityGroupIds`** – 提供安全群組的 ID，這些群組會授予來源 Neptune 資料庫叢集的寫入傳入存取權。
+ **`RouteTableIds`** – 這是在 Neptune VPC 中建立 Amazon DynamoDB 端點的必要項目，如果您還沒有此項目，請建立一個。您必須提供與子網路相關聯的路由表 ID 逗號分隔清單。
+ **`CreateDDBVPCEndPoint`** – 預設為 `true` 的布林值，指出是否需要建立 Dynamo 資料庫 VPC 端點。如果您已在 VPC 中建立 DynamoDB 端點，只需要將其變更為 `false` 即可。
+ **`CreateMonitoringEndPoint`** – 預設為 `true` 的布林值，指出是否需要建立一個監控 VPC 端點。如果您已在 VPC 中建立監控端點，只需要將其變更為 `false` 即可。

**串流輪詢器**
+ **`ApplicationName`** – 您通常可將此設定保留為預設值 (`NeptuneStream`)。如果使用不同的名稱，其必須是唯一的。
+ **`LambdaMemorySize`** – 用來設定 Lambda 輪詢器函數可用的記憶體大小。預設值是 2,048 MB。
+ **`LambdaRuntime`** – 從 Neptune 串流擷取項目之 Lambda 函數中使用的語言。您可以將此項設為 `python3.9` 或 `java8`。
+ **`LambdaS3Bucket`** – 包含 Lambda 程式碼成品的 Amazon S3 儲存貯體。除非您要使用從不同 Amazon S3 儲存貯體載入的自訂 Lambda 輪詢函數，否則請保留空白。
+ **`LambdaS3Key`** – 對應至 Lambda 程式碼成品的 Amazon S3 金鑰。除非您要使用自訂的 Lambda 輪詢函數，否則請保留空白。
+ **`LambdaLoggingLevel`** – 一般而言，會將此設定保留為預設值，即 `INFO`。
+ **`ManagedPolicies`** – 列出用於執行 Lambda 函數的受管政策。一般而言，除非您要使用自訂的 Lambda 輪詢函數，否則請保留空白。
+ **`StreamRecordsHandler`** – 一般而言，除非您要為 Neptune 串流中的記錄使用自訂處理器，否則請保留空白。
+ **`StreamRecordsBatchSize`** – 要從串流擷取的記錄數目上限。您可以使用此參數調整效能。預設值 (`5000`) 是很好的開始。允許的上限為 10,000。數字愈大，從串流讀取記錄所需的網路呼叫就愈少，但處理記錄所需的記憶體就愈多。此參數的較低值會產生較低的輸送量。
+ **`MaxPollingWaitTime`** – 兩次輸詢之間的最長等待時間 (以秒為單位)。決定調用 Lambda 輪詢器輪詢 Neptune 串流的頻率。將此值設為 0 可連續輪詢。最高值為 3,600 秒 (1 小時)。預設值 (60 秒) 是很好的開始，視圖表資料變更的速度而定。
+ **`MaxPollingInterval`** – 最長連續輪詢期間 (以秒為單位)。使用此項來設定 Lambda 輪詢函數的逾時。此值應在 5 秒與 900 秒之間的範圍內。預設值 (600 秒) 是很好的開始。
+ **`StepFunctionFallbackPeriod`** – 等待輪詢器的 step-function-fallback-period 單位數，在此之後透過 Amazon CloudWatch Events 呼叫 step function 以從失敗中復原。預設值值 (5 分鐘) 是很好的開始。
+ **`StepFunctionFallbackPeriodUnit`** – 用來測量前一個 `StepFunctionFallbackPeriodUnit` (`minutes`、`hours` 或 `days`) 的時間單位。通常預設值 (`minutes`) 就足夠了。
+ **`StartingCheckpoint`**   –   串流輪詢器的起始檢查點。預設值為 `0:0`，這表示從 Neptune 串流開頭處開始。
+ **`StreamPollerInitialState`**   –   輪詢器的初始狀態。預設值為 `ENABLED`，這表示串流複寫會在整個堆疊建立完成後立即開始。

**Neptune 串流**
+ **`NeptuneStreamEndpoint`** – (*必要*) Neptune 來源串流的端點。這會採取以下兩種形式之一：
  + **`https://{{your DB cluster}}:{{port}}/propertygraph/stream`** (或其別名 `https://{{your DB cluster}}:{{port}}/pg/stream`)。
  + **`https://{{your DB cluster}}:{{port}}/sparql/stream`**.
+ **`Neptune Query Engine`** – 選擇 Gremlin、openCypher 或 SPARQL。
+ **`IAMAuthEnabledOnSourceStream`** – 如果您的 Neptune 資料庫叢集使用的是 IAM 身分驗證，請將此參數設為 `true` 。
+ **`StreamDBClusterResourceId`** – 如果您的 Neptune 資料庫叢集使用的是 IAM 身分驗證，請將此參數設為叢集資源 ID。資源 ID 和叢集 ID 不同。其改採的格式為：`cluster-` 加上 28 個英數字元。它可以在 Neptune 主控台的**叢集詳細資訊**下找到。

**目標 Neptune 資料庫叢集**
+ **`TargetNeptuneClusterEndpoint`** – 目標備份叢集的叢集端點 (僅主機名稱)。

  請注意，如果您指定 `TargetNeptuneClusterEndpoint`，您也無法指定 `TargetSPARQLUpdateEndpoint`。
+ **`TargetNeptuneClusterPort`** – 目標叢集的連接埠號碼。

  請注意，如果指定 `TargetSPARQLUpdateEndpoint`，則會忽略 `TargetNeptuneClusterPort` 的設定。
+ **`IAMAuthEnabledOnTargetCluster`** – 如果要在目標叢集上啟用 IAM 身分驗證，則設定為 true。
+ **`TargetAWSRegion`**   –   目標備份叢集 AWS 的區域，例如 `us-east-1`)。只有在目標備份叢集 AWS 的區域與 Neptune 來源叢集的區域不同時，才能提供此參數，如同跨區域複寫的情況。如果來源和目標區域相同，則此為選用參數。

  請注意，如果`TargetAWSRegion`值不是 [Neptune 支援的有效 AWS 區域](limits.md#limits-regions)，則程序會失敗。
+ **`TargetNeptuneDBClusterResourceId`** – *選用*：只有在目標資料庫叢集上啟用 IAM 身分驗證時，才需要此項。設定為目標叢集的資源 ID。
+ **`SPARQLTripleOnlyMode`** – 決定是否啟用僅限三重模式的布林旗標。在僅限三重模式中，沒有具名圖形複寫。預設值為 `false`。
+ **`TargetSPARQLUpdateEndpoint`** – SPARQL 更新之目標端點的 URL，例如 `https://abc.com/xyz`。此端點可以是任何支援四元組或三元組的 SPARQL 存放區。

  請注意，如果指定 `TargetSPARQLUpdateEndpoint`，您也無法指定 `TargetNeptuneClusterEndpoint`，且會忽略 `TargetNeptuneClusterPort` 的設定。
+ **`BlockSparqlReplicationOnBlankNode `** – 布林旗標，如果設定為 `true`，則會停止 SPARQL (RDF) 資料中 BlankNode 的複寫。預設值為 `false`。

**警示**
+ **`Required to create Cloud watch Alarm`** – 如果想要為新堆疊建立 CloudWatch 警示，請將此設為 `true`。
+ **`SNS Topic ARN for Cloudwatch Alarm Notifications`** - 應在其中傳送 CloudWatch 警示通知的 SNS 主題 ARN (僅在警示啟用時才需要)。
+ **`Email for Alarm Notifications`** – 應接收警示通知的電子郵件地址 (僅在警示啟用時才需要)。

對於警示通知的目的地，您可以僅新增 SNS、僅新增電子郵件，或同時新增 SNS 和電子郵件。

## 執行 CloudFormation 範本
<a name="streams-consumer-cfn-complete"></a>

現在，您可以完成佈建 Neptune 串流消費者應用程式執行個體的程序，如下所示：

1. 在 CloudFormation**指定堆疊詳細資訊**頁面上，選擇**下一步**。

1. 在**選項**頁面上，選擇**下一步**。

1. 在**檢閱**頁面上，選取第一個核取方塊以確認 CloudFormation 將建立 IAM 資源。選取第二個核取方塊，確認新堆疊 `CAPABILITY_AUTO_EXPAND`。
**注意**  
`CAPABILITY_AUTO_EXPAND` 明確確認在建立堆疊時，無需事先檢閱，即可擴充巨集。使用者通常會在處理過的範本中建立變更集，以便在實際建立堆疊之前，檢閱巨集所做的變更。如需詳細資訊，請參閱《 API 參考》中的 CloudFormation [CreateStack](https://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/API_CreateStack.html) API。 *AWS CloudFormation *

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

## 使用最新的 Lambda 成品更新串流輪詢器
<a name="streams-consumer-cfn-update"></a>

您可以使用最新的 Lambda 程式碼成品更新串流輪詢器，如下所示：

1. 在 中 AWS 管理主控台，導覽 CloudFormation 至並選擇主要父 CloudFormation 堆疊。

1. 為堆疊選取**更新**選項。

1. 選取**取代目前範本**。

1. 對於範本來源，請選擇 **Amazon S3 URL**，然後輸入以下 S3 URL：

   ```
   https://aws-neptune-customer-samples.s3.amazonaws.com/neptune-stream/neptune_to_neptune.json
   ```

1. 選取**下一步**，而不變更任何 CloudFormation 參數。

1. 請選擇 **Update Stack (建立堆疊)**。

堆疊現在將使用最新的成品來更新 Lambda 成品。