Terraform
Manage projects, keys, routing, and residency as code.
The Eridian Terraform provider manages control-plane objects: projects, routing policies, budgets, residency, webhooks, and template promotion gates. Inference traffic stays in your application. Terraform does not send prompts to GPT or Gemini.
Provider
terraform {
required_providers {
eridian = {
source = "eridian-ai/eridian"
version = "~> 1.4"
}
}
}
provider "eridian" {
api_key = var.eridian_api_key
base_url = "https://api.geteridian.com"
}
Set ERIDIAN_API_KEY instead of hardcoding. The key needs governance:manage, keys:manage, and budgets:manage.
Project and Residency
resource "eridian_project" "legal" {
name = "legal-production"
region = "eu-west-1"
routing_policy = "quality_optimized"
features_default = ["pii_redaction", "semantic_cache"]
}
resource "eridian_residency" "legal" {
project_id = eridian_project.legal.id
region = "eu-west-1"
inference_pin = true
cache_scope = "region"
fail_closed = true
}
resource "eridian_budget" "legal" {
project_id = eridian_project.legal.id
monthly_limit_usd = 50000
alert_thresholds = [0.5, 0.8, 0.95]
hard_stop = true
}
Routing Policy
resource "eridian_routing_policy" "legal_strict" {
project_id = eridian_project.legal.id
policy_id = "legal_strict_v2"
quality_floor = 0.92
max_cost_usd = 0.05
allowed_models = ["gpt", "gemini"]
fallback_chain = ["gpt", "gemini"]
weights = {
quality = 0.6
latency = 0.2
cost = 0.2
}
}
Changing allowed_models or fail_closed from Terraform still requires dual control if the project has the gate enabled. Apply will wait on eridian_approval or fail with dual_control_required.
Webhook
resource "eridian_webhook" "siem" {
project_id = eridian_project.legal.id
url = var.siem_webhook_url
events = ["inference.completed", "budget.threshold", "policy.updated"]
}
The provider writes the webhook secret to your state. Mark the secret sensitive. Rotate with terraform apply -replace=eridian_webhook.siem.
Import
terraform import eridian_project.legal prj_legal_001
See Projects, Regions, and Dual Control.
Production API credentials are issued with an institution workspace. Contact sales if you need access.