You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
a.Flag(certificateConfig.flag, "TLS server certificate file.").Default(certificateConfig.defaultValue).StringVar(&cfg.certificate)
432
438
a.Flag(keyConfig.flag, "TLS server private key file.").Default(keyConfig.defaultValue).StringVar(&cfg.key)
433
439
a.Flag(enableSigV4AuthConfig.flag, "Whether to enable SigV4 authentication with the API Gateway. Default to 'false'.").Default(enableSigV4AuthConfig.defaultValue).StringVar(&enableSigV4Auth)
440
+
a.Flag(queryBaseEndpointConfig.flag, "Override the default Timestream query endpoint (e.g., a VPC Endpoint).").
# Timestream Prometheus Connector with AWS PrivateLink
2
+
3
+
## Overview
4
+
5
+
This guide explains how to set up the Prometheus Connector to ingest data to Amazon Timestream from within an isolated VPC environment using [AWS PrivateLink](https://aws.amazon.com/privatelink/).
6
+
7
+
This [serverless application](https://aws.amazon.com/serverless/) consists of the following:
8
+
-[Amazon EC2](https://aws.amazon.com/ec2/getting-started/) instance that will host the Prometheus Connector.
9
+
-[VPC Endpoints](https://docs.aws.amazon.com/whitepapers/latest/aws-privatelink/what-are-vpc-endpoints.html) for securely communicating with AWS services using PrivateLink.
10
+
11
+
This application assumes that the VPC in which the template will be deployed has no internet access and ensures that all communication stays within Amazon's internal network.
12
+
13
+
## Prerequisites
14
+
15
+
1. A VPC with at least two private subnets and route tables.
16
+
2. A Timestream database and table.
17
+
3.[Read and write cells](https://docs.aws.amazon.com/timestream/latest/developerguide/architecture.html#cells) for your Timestream account. Amazon routes requests to the write and query endpoints of the cell that your account has been mapped to for a given region.
Take note of your assigned cells (`ingest-cell1` for the above example) for both read and write endpoints.
43
+
44
+
45
+
## Deployment
46
+
47
+
From your existing VPC, you will need the following values:
48
+
- VPC ID: This is the ID of your existing VPC
49
+
- VPC CIDR : This is the CIDR range for your VPC
50
+
- Private Subnet IDs: This is where the EC2 instance and VPC endpoints will be deployed
51
+
- Private Route Table ID(s): This is how the [S3 Gateway endpoint](https://docs.aws.amazon.com/vpc/latest/privatelink/vpc-endpoints-s3.html) will resolve requests
52
+
- Query and Write cells: These are your assigned endpoint cells for Timestream
53
+
54
+
55
+
1. From the `privatelink` directory, run the following command to deploy the SAM template:
To view the full set of `sam deploy` options see the [sam deploy documentation](https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/sam-cli-command-reference-sam-deploy.html).
62
+
63
+
2. The deployment will have the following outputs upon completion:
3. Start an AWS SSM session, replacing `INSTANCE_ID` with your EC2 instance ID from deployment. You can install the [plugin here.](https://docs.aws.amazon.com/systems-manager/latest/userguide/session-manager-working-with-install-plugin.html)
80
+
81
+
```shell
82
+
aws ssm start-session --target i-<INSTANCE_ID>
83
+
```
84
+
85
+
4. Install the Prometheus Connector.
86
+
87
+
1. Create a directory for the connector.
88
+
```
89
+
mkdir ~/connector && cd ~/connector
90
+
```
91
+
92
+
2. Download the precompiled binary from S3 for your region. [See here](https://github.com/awslabs/amazon-timestream-connector-prometheus/tags) for released versions.
4. Disable endpoint discovery by setting the `AWS_ENABLE_ENDPOINT_DISCOVERY` environment variable to `false`. This ensures requests from the connector are routed through VPC endpoints.
105
+
```
106
+
export AWS_ENABLE_ENDPOINT_DISCOVERY=false
107
+
```
108
+
109
+
5. Launch Prometheus Connector
110
+
111
+
Replace the following variables to configure your Timestream database, region, and assigned cells.
112
+
113
+
114
+
- `DEFAULT_DATABASE`: Specifies the default Timestream database for the Prometheus Connector.
115
+
- `DEFAULT_TABLE`: Specifies the default table for storing Prometheus metrics.
116
+
- `AWS_REGION`: Defines the AWS region.
117
+
- `QUERY_CELL`: Defines the query endpoint cell for Timestream.
118
+
- `INGEST_CELL`: Defines the ingestion endpoint cell for Timestream.
The connector is now ready to ingest data to Timestream!
132
+
133
+
To see an example of how Prometheus can be configured, [see here](https://github.com/awslabs/amazon-timestream-connector-prometheus?tab=readme-ov-file#prometheus-configuration).
134
+
135
+
### Cleanup
136
+
137
+
Delete the CloudFormation stack. From the `privatelink` directory, run the following command:
0 commit comments