

如需與 Amazon Timestream for LiveAnalytics 類似的功能，請考慮使用 Amazon Timestream for InfluxDB。它提供簡化的資料擷取和單一位數毫秒查詢回應時間，以進行即時分析。[在這裡](https://docs.aws.amazon.com//timestream/latest/developerguide/timestream-for-influxdb.html)進一步了解。

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

# VPC 端點 (AWS PrivateLink)
<a name="VPCEndpoints"></a>

您可以建立介面 VPC *端點*，在 VPC 與 Amazon Timestream for LiveAnalytics 之間建立私有連線。介面端點採用 [AWS PrivateLink](https://aws.amazon.com/privatelink)技術，可讓您在沒有網際網路閘道、NAT 裝置、VPN 連線或 AWS Direct Connect 連線的情況下，私下存取 Timestream for LiveAnalytics APIs。VPC 中的執行個體不需要公有 IP 地址，即可與 Timestream for LiveAnalytics APIs 通訊。VPC 與 Timestream for LiveAnalytics 之間的流量不會離開 Amazon 網路。

每個介面端點都是由您子網路中的一或多個[彈性網路介面](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/using-eni.html)表示。如需介面 VPC 端點的詳細資訊，請參閱《*Amazon* [VPC 使用者指南》中的介面 VPC 端點 (AWS PrivateLink)](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html)。

為了開始使用 Timestream for LiveAnalytics 和 VPC 端點，我們提供了有關 Timestream for LiveAnalytics 與 VPC 端點的特定考量、為 Timestream for LiveAnalytics 建立界面 VPC 端點、為 Timestream for LiveAnalytics 建立 VPC 端點政策，以及將 Timestream 用戶端 （適用於 Write 或 Query SDK) 與 VPC 端點搭配使用的資訊。

**Topics**
+ [VPC 端點如何與 Timestream 搭配使用](VPCEndpoints.vpc-endpoint-considerations.md)
+ [為 Timestream for LiveAnalytics 建立介面 VPC 端點](VPCEndpoints.vpc-endpoint-create.md)
+ [為 Timestream for LiveAnalytics 建立 VPC 端點政策](VPCEndpoints.vpc-endpoint-policy.md)

# VPC 端點如何與 Timestream 搭配使用
<a name="VPCEndpoints.vpc-endpoint-considerations"></a>

 當您建立 VPC 端點以存取 Timestream Write 或 Timestream Query SDK 時，所有請求都會路由至 Amazon 網路內的端點，而不會存取公有網際網路。更具體地說，您的請求會路由至您帳戶已針對指定區域映射至之儲存格的寫入和查詢端點。若要進一步了解 Timestream 的手機架構和手機特定端點，您可以參閱 [行動架構](architecture.md#cells)。例如，假設您的帳戶已在 `cell1`中映射至 `us-west-2`，而且您已設定 VPC 介面端點進行寫入 (`ingest-cell1.timestream.us-west-2.amazonaws.com`) 和查詢 ()`query-cell1.timestream.us-west-2.amazonaws.com`。在此情況下，使用這些端點傳送的任何寫入請求將完全保留在 Amazon 網路中，且不會存取公有網際網路。

## Timestream VPC 端點的考量事項
<a name="VPCEndpoints.vpc-endpoint-considerations.how-it-works"></a>

為 Timestream 建立 VPC 端點時，請考慮下列事項：
+ 在您為 Timestream for LiveAnalytics 設定介面 VPC 端點之前，請務必檢閱《*Amazon VPC 使用者指南*》中的[介面端點屬性和限制](https://docs.aws.amazon.com/vpc/latest/userguide/vpce-interface.html#vpce-interface-limitations)。
+ Timestream for LiveAnalytics 支援從您的 VPC 呼叫[其所有 API 動作](https://docs.aws.amazon.com/timestream/latest/developerguide/API_Reference.html)。
+ Timestream for LiveAnalytics 支援 VPC 端點政策。根據預設，允許透過端點完整存取 Timestream for LiveAnalytics。如需詳細資訊，請參閱《Amazon VPC 使用者指南》**中的[使用 VPC 端點控制對服務的存取](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html)。
+ 由於 Timestream 的架構，對寫入和查詢動作的存取需要建立兩個 VPC 介面端點，每個 SDK 各一個。此外，您必須指定儲存格端點 （您只能為要映射的 Timestream 儲存格建立端點）。如需詳細資訊，請參閱本指南 [Timestream for LiveAnalytics 的建立介面 VPC 端點](VPCEndpoints.vpc-endpoint-create.md)一節。

現在您已了解 Timestream for LiveAnalytics 如何與 VPC 端點搭配使用，[請為 Timestream for LiveAnalytics 建立介面 VPC 端點](VPCEndpoints.vpc-endpoint-create.md)。

# 為 Timestream for LiveAnalytics 建立介面 VPC 端點
<a name="VPCEndpoints.vpc-endpoint-create"></a>

您可以使用 Amazon [VPC 主控台或 ()，為 Timestream for LiveAnalytics 服務建立介面 VPC 端點](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html)AWS CLI。 LiveAnalytics AWS Command Line Interface 若要為 Timestream 建立 VPC 端點，請完成以下所述的 Timestream 特定步驟。

**注意**  
在完成以下步驟之前，請確定您了解 [Timestream VPC 端點的特定考量。](VPCEndpoints.vpc-endpoint-considerations.md)

## 使用 Timestream 儲存格建構 VPC 端點服務名稱
<a name="VPCEndpoints.vpc-endpoint-create.vpc-endpoint-name"></a>

 由於 Timestream 的獨特架構，必須為每個 SDK （寫入和查詢） 建立個別的 VPC 介面端點。此外，您必須指定 Timestream 儲存格端點 （您只能為要映射的 Timestream 儲存格建立端點）。若要使用介面 VPC 端點從 VPC 中直接連線至 Timestream，請完成以下步驟：

1. 首先，尋找可用的 Timestream 儲存格端點。若要尋找可用的儲存格端點，請使用 [`DescribeEndpoints`動作](https://docs.aws.amazon.com/timestream/latest/developerguide/API_query_DescribeEndpoints.html) （可透過寫入和查詢 APIs取得） 列出 Timestream 帳戶中可用的儲存格端點。如需更多詳細資訊，請參閱[範例](#VPCEndpoints.vpc-endpoint-create.vpc-endpoint-name.example)。

1. 選取要使用的儲存格端點之後，請為 Timestream Write 或 Query API 建立 VPC 介面端點字串：
   + *對於寫入 API：*

     ```
     com.amazonaws.<region>.timestream.ingest-<cell>
     ```
   + *對於查詢 API：*

     ```
     com.amazonaws.<region>.timestream.query-<cell>
     ```

    其中 *<region>* 是[有效的 AWS 區域代碼](https://docs.aws.amazon.com/general/latest/gr/rande.html)，而 *<cell>* 是 [DescribeEndpoints 動作](https://docs.aws.amazon.com/timestream/latest/developerguide/API_query_DescribeEndpoints.html)在[端點物件](https://docs.aws.amazon.com/timestream/latest/developerguide/API_query_DescribeEndpoints.html#API_query_DescribeEndpoints_ResponseSyntax)中傳回的其中一個儲存格端點地址 （例如 `cell1`或 `cell2`)。如需詳細資訊，請參閱[範例](#VPCEndpoints.vpc-endpoint-create.vpc-endpoint-name.example)。

1. 現在您已建置 VPC 端點服務名稱，[請建立介面端點](https://docs.aws.amazon.com/vpc/latest/privatelink/vpce-interface.html)。當系統要求您提供 VPC 端點服務名稱時，請使用您在步驟 2 中建構的 VPC 端點服務名稱。

### 範例：建構您的 VPC 端點服務名稱
<a name="VPCEndpoints.vpc-endpoint-create.vpc-endpoint-name.example"></a>

在下列範例中，`DescribeEndpoints`動作會在 AWS CLI 中使用`us-west-2`區域中的寫入 API 執行：

```
aws timestream-write describe-endpoints --region us-west-2
```

此命令將傳回下列輸出：

```
{
    "Endpoints": [
        {
            "Address": "ingest-cell1.timestream.us-west-2.amazonaws.com",
            "CachePeriodInMinutes": 1440
        }
    ]
}
```

在此情況下， *cell1* 是 *<cell>* ，*us-west-2* 是 *<region>*。因此，產生的 VPC 端點服務名稱會如下所示：

```
com.amazonaws.us-west-2.timestream.ingest-cell1
```

現在您已為 Timestream for LiveAnalytics 建立界面 VPC 端點，[請為 Timestream for LiveAnalytics 建立 VPC 端點政策](VPCEndpoints.vpc-endpoint-policy.md)。

# 為 Timestream for LiveAnalytics 建立 VPC 端點政策
<a name="VPCEndpoints.vpc-endpoint-policy"></a>

您可以將端點政策連接至 VPC 端點，以控制對 Timestream for LiveAnalytics 的存取。此政策會指定下列資訊：
+ 可執行動作的主體。
+ 可執行的動作。
+ 可供執行動作的資源。

如需詳細資訊，請參閱 *Amazon VPC 使用者指南*中的[使用 VPC 端點控制對服務的存取](https://docs.aws.amazon.com/vpc/latest/userguide/vpc-endpoints-access.html)。

**範例：Timestream for LiveAnalytics 動作的 VPC 端點政策**  
以下是 Timestream for LiveAnalytics 的端點政策範例。連接到端點時，此政策會授予所有資源上所有主體對列出的 Timestream for LiveAnalytics 動作 （在此案例中為 [https://docs.aws.amazon.com/timestream/latest/developerguide/API_ListDatabases.html](https://docs.aws.amazon.com/timestream/latest/developerguide/API_ListDatabases.html)) 的存取權。

```
{
   "Statement":[
      {
         "Principal":"*",
         "Effect":"Allow",
         "Action":[
            "timestream:ListDatabases"
         ],
         "Resource":"*"
      }
   ]
}
```