Tembo Terraform Provider

Tembo has a Terraform Provider that allows you to provision an Instance on the Tembo Cloud.

Requirements

Authentication

Tembo Terraform Provider needs an access_token to authenticate with the API. Generate a long-lived API token by following steps here.

Note: To set access_token either create a local .tfvars file with the variable or set an environment variable with the access_token as shown below.

export TEMBO_ACCESS_TOKEN="TOKEN_GOES_HERE"

Example Usage

terraform {
  required_providers {
    tembo = {
      source = "tembo-io/tembo"
    }
  }
}

provider "tembo" {
  access_token = var.access_token
}

variable "access_token" {
  type = string
}

tembo_instance (Resource)

Resource for creating a tembo instance.

Example Usage

resource "tembo_instance" "test_instance" {
  instance_name = "test-instance"
  org_id        = "org_test" # Replace this with your org_id
  cpu           = "1"
  stack_type    = "Standard"
  environment   = "dev"
  memory        = "4Gi"
  storage       = "10Gi"
  replicas      = 1
  # extra_domains_rw = ["sample-invalid-domain.test.tembo-development.com"]
  postgres_configs = [
    {
      name  = "max_connections"
      value = "200"
    },
    {
      name  = "wal_buffers"
      value = "10"
    }
  ]
  trunk_installs = [
    {
      name    = "pgmq"
      version = "0.24.0"
    }
  ]
  extensions = [{
    name        = "plperl"
    description = "PL/Perl procedural language"
    locations = [{
      database = "app"
      schema   = "public"
      version  = "1.0"
      enabled  = false
      },
      {
        database = "postgres"
        schema   = "public"
        version  = "1.0"
        enabled  = true
    }]
    },
    {
      "name" : "pltclu",
      "description" : "PL/TclU untrusted procedural language",
      "locations" : [
        {
          "database" : "app",
          "schema" : "public",
          "version" : "1.0",
          "enabled" : false,
          "error" : false,
          "error_message" : null
        },
        {
          "database" : "postgres",
          "schema" : "public",
          "version" : "1.0",
          "enabled" : false,
          "error" : false,
          "error_message" : null
        }
      ]
  }]
}

output "instance" {
  value = tembo_instance.test_instance
}

Schema

Required

  • cpu (String) CPU. Supported values: 1, 2, 4, 8, 16, 32
  • environment (String) Environment. Values supported: dev, test, prod
  • instance_name (String) Unique name of the instance
  • memory (String) Memory. Values supported: 1Gi, 2Gi, 4Gi, 8Gi, 16Gi, 32Gi
  • org_id (String) Id of the organization in which the instance will be created
  • stack_type (String) Stack type for the instance. Supported values: Standard, MessageQueue, MachineLearning, OLAP, OLTP
  • storage (String) Storage. Values supported: 10Gi, 50Gi, 100Gi, 200Gi, 300Gi, 400Gi, 500Gi

Optional

Read-Only

  • instance_id (String) Unique ID for the instance generated by Tembo
  • last_updated (String) Last updated date time in UTC
  • state (String) Instance state. Values: Submitted, Up, Configuring, Error, Restarting, Starting, Stopping, Stopped, Deleting, Deleted

Nested Schema for extensions

Required:

Optional:

  • description (String)

Nested Schema for extensions.locations

Required:

  • database (String)
  • enabled (Boolean)

Optional:

  • schema (String)
  • version (String)

Nested Schema for postgres_configs

Required:

  • name (String)

Optional:

  • value (String)

Nested Schema for trunk_installs

Required:

  • name (String)

Optional:

  • version (String)

Next

chevron right arrow

API

DEVELOPMENT