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:
| Argument | Required | Environment variable | Purpose |
|---|---|---|---|
api_key | Yes | SAZABI_API_KEY | A Sazabi secret key. Sensitive. |
organization_id | No | SAZABI_ORGANIZATION_ID | Default organization for org-scoped resources. |
base_url | No | SAZABI_API_BASE_URL | Overrides 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
sazabi_project
A project.
sazabi_component
A tracked service, API, or feature.
sazabi_secret_key
A secret key for API access.
sazabi_log_source
A log source.
sazabi_log_stream
A log stream under a managed source.
sazabi_script
A durable project script.
sazabi_automation
A scheduled automation.
sazabi_team
An organization team.
sazabi_team_membership
A member's team membership.
sazabi_member
An organization member's role.
sazabi_member_invitation
A pending member invitation.
sazabi_notification_delivery_rule
A project notification delivery rule.
sazabi_integration
An API-key integration connection.
sazabi_integration_jit_policy
Per-connection JIT policy.
sazabi_integration_slack_configuration
Connection-level Slack settings.
sazabi_integration_slack_channel_project_mapping
A Slack channel-to-project mapping.
sazabi_organization_jit_policy
Organization-wide JIT master switch.
sazabi_mcp_connector
A custom MCP connector.
sazabi_mcp_connector_read_only
Read-only mode on an existing connector.
sazabi_sandbox_cli
A sandbox CLI connection.