Terraform provider
Provider Terraform pour gerer les projets, connexions, webhooks et approval policies Auralith en infra as code. Permet aux Platform Engineers de versionner la configuration aux cotes du reste de la stack.
Quand l'utiliser
- Provisionner Auralith comme partie d'un environnement reproductible (staging, prod, demo).
- Versionner les approval policies aux cotes du code applicatif.
- Faire respecter "no manual changes" via drift detection Terraform.
Resources disponibles
| Resource | Description |
|---|---|
auralith_project | Projet (name, slug, team) |
auralith_connection | Connexion DB (host, port, db_type, secret_path) |
auralith_webhook | Webhook outbound (URL, events, secret) |
auralith_approval_policy | Policy par action × environment_tag |
auralith_api_key | API key scopee |
Snippet HCL minimal
terraform {
required_providers {
auralith = {
source = "auralith/auralith"
version = "~> 0.1"
}
}
}
provider "auralith" {
endpoint = "https://app.auralith.io"
api_key = var.auralith_api_key
}
resource "auralith_project" "billing" {
name = "Billing service"
slug = "billing"
}
resource "auralith_connection" "billing_prod" {
project_id = auralith_project.billing.id
name = "billing-prod"
db_type = "postgres"
host = "billing-prod.cluster-xyz.eu-west-3.rds.amazonaws.com"
port = 5432
database = "billing"
user = "auralith_ro"
secret_provider = "aws_secrets"
secret_path = "arn:aws:secretsmanager:eu-west-3:..."
environment_tag = "prod"
}
resource "auralith_approval_policy" "billing_prod_patch" {
project_id = auralith_project.billing.id
action_type = "mass_patch"
environment_tag = "prod"
required = true
min_approvers = 2
}
resource "auralith_webhook" "slack_ops" {
project_id = auralith_project.billing.id
url = "https://hooks.slack.com/services/..."
events = ["mass_patch.completed", "drift.detected", "approval.requested"]
secret = var.slack_webhook_secret
}
Workflow rapide
- Generer une API key admin sur Auralith. La stocker dans
TF_VAR_auralith_api_keyou un secret manager. terraform initpour telecharger le provider.- Definir vos resources dans des fichiers
.tf. terraform planpour voir le diff.terraform apply.
Concepts cles
- State : Terraform stocke l'etat. Recommande : backend remote (S3, GCS, Terraform Cloud) avec lock.
- Drift :
terraform plandetecte les divergences entre.tfet l'etat Auralith reel. Si quelqu'un modifie via UI, vous le voyez. - Importable :
terraform import auralith_project.foo <project_id>pour rapatrier une ressource existante.
Pieges courants
- Secrets en clair dans
.tfstate: utiliser un backend chiffre (S3 + KMS) ou referencer viasecret_providerau lieu de stocker password en clair dans Terraform. - Cycles : eviter de creer des resources qui se referencent mutuellement (project -> webhook -> project). Lineaire fonctionne mieux.
- Provider en alpha : breaking changes possibles avant 1.0. Pin la version exacte en prod.
Lien repo
Source du provider : gitlab.com/fullchelh/auralith