GitHub - sparelabs/terraform-provider-typesense: Terraform provider for Typesense Cloud · GitHub
Skip to content

About

Terraform provider for Typesense Cloud

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Repository files navigation

Terraform Provider for Typesense Cloud

MPL-2.0 License

The Typesense Terraform provider manages resources on Typesense Cloud using the Cloud Management API. It supports full lifecycle management of clusters, in-place configuration changes, server parameters, cluster cloning, and API key generation.

This is a fork of pRxEngage/terraform-provider-typesense, maintained by Spare Labs under the same MPL-2.0 license.

Feature Highlights

  • Cluster lifecycle — create, update, and terminate Typesense Cloud clusters
  • In-place configuration changes — scale memory, vCPU, GPU, HA, HPD, and server version without replacing the cluster (automatic polling until complete)
  • Rolling restarts — server configuration parameter changes trigger automatic rolling restarts
  • Cluster cloning — clone clusters to other regions
  • Ephemeral API keys — generate admin and search-only API keys as ephemeral resources (never persisted to state) or as managed resources
  • Memory/vCPU validation — built-in compatibility matrix prevents invalid tier combinations at plan time

Quick Start

terraform {
  required_providers {
    typesense = {
      source = "sparelabs/typesense"
    }
  }
}

provider "typesense" {
  # Set via TYPESENSE_CLOUD_MANAGEMENT_API_KEY env var, or:
  # api_key = "your-management-api-key"
}

resource "typesense_cluster" "example" {
  memory  = "0.5_gb"
  vcpu    = "2_vcpus_1_hr_burst_per_day"
  regions = ["oregon"]
  name    = "my-cluster"
}

Requirements

  • Terraform >= 1.0
  • Go >= 1.24 (for building from source)

Authentication

The provider requires a Typesense Cloud Management API key. You can provide it in two ways:

  1. Environment variable (recommended): export TYPESENSE_CLOUD_MANAGEMENT_API_KEY="your-key"
  2. Provider configuration: set the api_key attribute in the provider block

Resources

Resource Description
typesense_cluster Manages a Typesense Cloud cluster
typesense_cluster_configuration_change Schedules infrastructure scaling and version upgrades
typesense_cluster_server_configuration_parameter Manages runtime server configuration parameters
typesense_cluster_cloning_operation Clones a cluster to another region
typesense_cluster_api_keys Generates cluster API keys (admin + search-only)

Data Sources

Data Source Description
typesense_cluster Reads a single cluster by ID
typesense_clusters Lists all clusters in the account

Ephemeral Resources

Ephemeral Resource Description
typesense_cluster_api_keys Generates cluster API keys without persisting to state

Development

Build

git clone https://github.com/sparelabs/terraform-provider-typesense.git
cd terraform-provider-typesense
make install

Test

# Unit tests
make test

# Acceptance tests (requires TYPESENSE_CLOUD_MANAGEMENT_API_KEY)
make testacc

Generate Documentation

make generate

Lint

make fmt
make lint

See CONTRIBUTING.md for more details on contributing to this provider.

License

MPL-2.0

About

Terraform provider for Typesense Cloud

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages