Sazabi
Terraform provider

Terraform provider

Manage Sazabi projects, keys, log sources, automations, teams, and more as code with the Sazabi Terraform provider.

The Sazabi Terraform provider manages Sazabi resources — projects, keys, log sources, automations, teams, integrations, and more — as code. This page covers installing and configuring the provider; each resource has its own reference page listing its arguments.

Install and configure

Declare the provider in a required_providers block, then configure it:

terraform {
  required_providers {
    sazabi = {
      source = "sazabi/sazabi"
    }
  }
}

provider "sazabi" {
  # Prefer environment variables for these; see Authentication below.
  # api_key         = var.sazabi_api_key
  # organization_id = var.sazabi_organization_id
}

Provider configuration:

ArgumentRequiredEnvironment variablePurpose
api_keyYesSAZABI_API_KEYA Sazabi secret key. Sensitive.
organization_idNoSAZABI_ORGANIZATION_IDDefault organization for org-scoped resources.
base_urlNoSAZABI_API_BASE_URLOverrides the API base URL.

Authentication

The provider authenticates with a Sazabi secret key. Create one in the dashboard under Settings > Secret keys (or with sazabi secret-keys create <name>), then provide it through the SAZABI_API_KEY environment variable so it never lands in your configuration or state in plaintext:

export SAZABI_API_KEY="sazabi_secret_your_secret_key"
export SAZABI_ORGANIZATION_ID="org_..."

Set organization_id (or SAZABI_ORGANIZATION_ID) so organization-scoped resources default to the right organization. Project-scoped resources default to the key's project scope when you omit project_id.

Import

Every resource supports terraform import, so you can bring existing Sazabi resources under Terraform management. Import by the resource's ID:

terraform import sazabi_project.example prj_...

A few resources use a composite import ID — for example sazabi_team_membership imports as <team_id>/<user_id> and sazabi_notification_delivery_rule as <project_id>/<rule_id>. Each resource page notes its import form.

In this section