Skip to content

Integrations: Pulumi #4003

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: latest
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions use-timescale/integrations/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ Some of the most in-demand integrations for $CLOUD_LONG are listed below, with l

## Configuration and deployment

| Name | Description |
|:---------------------------:|--------------------------------------------------------------------------|
| [Terraform][terraform] | Safely and predictably provision and manage infrastructure in any cloud. |
| Name | Description |
|:----------------------:|-----------------------------------------------------------------------------------------------------------------------|
| [Terraform][terraform] | Safely and predictably provision and manage infrastructure in any cloud. |
| [Pulumi][pulumi] | Define, deploy, and manage cloud infrastructure as code across multi-cloud, Kubernetes, and on-premises environments. |


## Data engineering and extract, transform, load
Expand Down
128 changes: 128 additions & 0 deletions use-timescale/integrations/pulumi.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
---
title: Integrate Pulumi with Timescale Cloud
excerpt: Manage your Timescale Cloud services with a Terraform provider
products: [cloud]
keywords: [Pulumi, Terraform, configuration, deployment]
tags: [integrate]
---

import IntegrationPrereqs from "versionContent/_partials/_integration-prereqs.mdx";

# Integrate Pulumi with $CLOUD_LONG

Pulumi is an open-source infrastructure as code platform that enables you to define, deploy, and manage your infrastructure and applications across multi-cloud and on-premises environments.

This page explains how to configure Pulumi to manage your $SERVICE_LONG or a self-hosted database.

## Prerequisites

<IntegrationPrereqs />

* [Download and install][pulumi-install] Pulumi v1.0 or later.

<Procedure>

1. **Generate client credentials for programmatic use**

1. In [$CONSOLE][console], click `Timescale project` and save your `Project ID`, then click `Project settings`.

2. Click `Create credentials`, then save `Public key` and `Secret key`.

1. **Initialize a new Pulumi project**

1. Create a new directory:

```bash
mkdir pulumi-timescale
cd pulumi-timescale
```

2. Initialize a new Pulumi project using YAML runtime:

```bash
pulumi new yaml
```

3. Set the following fields or use default values as prompted:
`Project name (project): pulumi-timescaledb`
`Project description (A minimal Pulumi YAML program): A Pulumi project to manage Timescale Cloud resources using YAML`
`Stack name (dev): dev`

Create a password:
`Enter your passphrase to protect config/secrets:`

You should see something like this:

```bash
Created stack 'dev'

Your new project is ready to go!

To perform an initial deployment, run `pulumi up`
```

1. **Configure Pulumi**

Modify the `Pulumi.yaml` file to this:

```yaml
name: pulumi-timescaledb
runtime: yaml
description: Deploy TimescaleDB VPC without AWS

config:
tsProjectId:
type: string
tsAccessKey:
type: string
tsSecretKey:
type: string
tsRegion:
type: string
default: us-east-1

resources:
# TimescaleDB VPC
timescaleVpc:
type: timescale:Vpcs
properties:
cidr: "10.10.0.0/16"
name: "timescale-vpc"
regionCode: ${tsRegion}

outputs:
timescaleVpcId: ${timescaleVpc.vpcsId}
```

1. **Configure the Pulumi stack**

To configure the stack, use `pulumi-config` along with your saved `Public key`, `Secret key` and `Timescale Project ID`:

```bash
pulumi config set tsAccessKey "<Public Key>" --secret
pulumi config set tsSecretKey "<Secret Key>" --secret
pulumi config set tsProjectId "<Project ID>"
```

1. **Install $COMPANY Terraform provider**

```bash
pulumi package add terraform-provider timescale/timescale
```

1. **Run the Pulumi project**

To view the Timescale VPC, deploy the Pulumi project:

```bash
pulumi up
```

You can now manage your resources with Pulumi. See more about [available resources][terraform-resources] and [data sources][terraform-data-sources].

</Procedure>

[pulumi-install]: https://www.pulumi.com/docs/iac/download-install/
[console]: https://console.cloud.timescale.com/dashboard/services
[terraform-resources]: https://registry.terraform.io/providers/timescale/timescale/latest/docs/resources/peering_connection
[terraform-data-sources]: https://registry.terraform.io/providers/timescale/timescale/latest/docs/data-sources/products
5 changes: 5 additions & 0 deletions use-timescale/page-index/page-index.js
Original file line number Diff line number Diff line change
Expand Up @@ -853,6 +853,11 @@ module.exports = [
href: "psql",
excerpt: "Connect to Timescale products with psql",
},
{
title: "Pulumi",
href: "pulumi",
excerpt: "Integrate Pulumi with Timescale Cloud",
},
{
title: "qStudio",
href: "qstudio",
Expand Down