Skip to main content
The Toktra Terraform provider lets you manage your entire Toktra configuration as infrastructure-as-code. Policies, budgets, alert configs, SIEM connectors, ITSM connectors, and SSO settings are all supported resources.

Installing the provider

Add the Toktra provider to your Terraform configuration’s required_providers block:
versions.tf
Run terraform init to download the provider:

Authentication

Configure the provider with your Toktra API URL and API key:
provider.tf
You can also set these via environment variables — the provider reads TOKTRA_API_URL and TOKTRA_API_KEY automatically:
Environment variables
Store your API key in a secrets manager (AWS Secrets Manager, HashiCorp Vault, etc.) and inject it at plan/apply time. Never commit API keys to version control.

Resources

toktra_policy

Manages a Toktra usage policy. Policies define conditions that trigger alerts or blocks.
policy.tf
Arguments:

toktra_budget

Manages a monthly spending budget for your organization.
budget.tf
Arguments:

toktra_alert_config

Manages notification routing for Toktra alerts.
alert_config.tf
Arguments:

toktra_siem_config

Manages a SIEM connector (Splunk, Datadog, or Elasticsearch).
siem.tf
Arguments:

toktra_itsm_config

Manages an ITSM connector (ServiceNow or Jira).
itsm.tf
Arguments:

toktra_sso_config

Manages SSO/SAML configuration for your organization.
sso.tf
Arguments:

Complete example

The following configuration manages a full Toktra deployment:
main.tf

Importing existing resources

If you have existing Toktra resources created through the dashboard, import them into Terraform state using terraform import:
Import examples
Find resource UUIDs in the Toktra dashboard under Integrations or via the Toktra API (GET /v1/api/siem/configs, etc.). After importing, run terraform plan to verify the imported state matches your configuration. Adjust any attribute values that differ before running terraform apply.
Importing a resource does not update the live Toktra resource. It only brings existing state into Terraform management. Run terraform apply after import to reconcile any configuration differences.