Why it’s shaped this way
- Human approval is mandatory. The agent generates the change; a person merges the PR and owns the
terraform apply. Nothing is applied autonomously. - Git is the source of truth. Your cluster and topic definitions live in your repo; Sariva contributes PRs to it, and a background watcher registers what actually got applied.
- Outbound-only. Your CI applies Terraform and Sariva polls GitHub for the result — but GitHub Actions never calls back into the Sariva pod. This keeps the Sariva platform’s network surface closed.
- Credentials by reference. When a change needs a new credential, Terraform writes it to your secret store and Sariva records only a reference — it never stores the secret value. (Full model: Connecting Kafka clusters.)
Closing the loop: the watcher
After CI finishesterraform apply, something has to tell Sariva that the new (or changed) cluster exists, so it becomes observable. That’s the watcher — an optional background component that closes the loop automatically (the poll workflow run step in the diagram above).
When enabled, the watcher:
- polls the GitHub Actions run for your apply — every 60 seconds by default (
gitops.workflow_watcher.poll_interval_seconds). This is polling, not a push: Sariva reaches out to GitHub on a cadence; GitHub never calls in, so there’s no inbound webhook or public endpoint to expose, - reads the Terraform outputs that run published (the
tf-outputs-<stage>artifact), and - auto-registers the resulting cluster with Sariva, so lag, health, and alerts light up with no manual step.
terraform-outputs.json artifact and register the cluster yourself. Either way the registration is outbound-only — Sariva reaches out to GitHub; GitHub never reaches in.
The watcher is opt-in (workflow_watcher.enabled) and needs the Sariva platform’s GitHub token to include the Actions: read scope. Configuration lives in CI → AWS auth.
A few growth operations need one or two manual follow-ups (e.g. a real cluster endpoint only exists after the first apply). The PR’s checklist spells these out — see Using Sariva.