Cattle: per-tenant SaaS (Atmos)

Tags: Substrate · Modeling · Automation · Self-host Substrate: Atmos

The Atmos-substrate variant of the Terraform Cloud demo. Same scenario, same blueprint shape — only the trigger type and the IaC layout differ. The customer manages Terraform configuration with Atmos, not Terraform Cloud, so there is zero required SaaS dependency. This is the demo for Sam's OSS-first constraint.

What you'll see

The cattle blueprint is identical to the TFC variant — same entity types, the same prod-clusters cell, the same runs_on relationship type, the same OnboardTenant action. Only the Action's trigger changes:

TFC variantAtmos variant
Where Terraform runsHosted on TFCA customer-deployed Atmos runner
What hosts stateTFCThe customer's S3 (Atmos doesn't host state)
Action trigger typeterraform-cloudatmos-workflow
What gets committedA new tenant .tfvars.jsonA new stacks/tenants/<id>.yaml manifest
SaaS dependencyTFC subscription requiredNone — fully self-hostable

The atmos-workflow trigger HTTP-POSTs a dispatch payload to a customer-deployed runner (see the Atmos reference runner). The runner clones your Atmos repo and runs atmos workflow <name> -s <stack>. The runner runs Atmos; Terrantula never runs atmos terraform apply itself.

Try it

The stacks/ and workflows/ directories in this example are sketches of what lives in a real customer's Atmos repo. To wire the trigger end-to-end you also deploy the reference runner once — see Reference runner: Atmos.

# Apply the cattle blueprint (same shape as the TFC variant; trigger type differs).
terrantula apply --file blueprint.yaml

The Action's trigger points at your deployed runner:

trigger:
  type: atmos-workflow
  workflow: provision-tenant
  stack: "tenant-{{ parameters.customer_id }}"
  runner:
    endpoint: https://atmos-runner.your-domain.com/dispatch
    auth:
      type: bearer
      token: "{{ secrets.atmos-runner-token }}"
  waitForCompletion: true

You can also import an existing Atmos stacks directory into Terrantula as entities:

terrantula import-atmos ./stacks --plan

Key files

FileWhat it is
blueprint.yamlThe Terrantula schema — same shape as the TFC variant, with an atmos-workflow trigger.
stacks/tenants/acme.yamlA sketch of a per-tenant Atmos stack manifest.
stacks/tenants/README.mdWhat stack files look like per tenant.
workflows/provision-tenant.yamlA sketch of the Atmos workflow the trigger invokes.

View on GitHub

examples/cattle-saas-tenants-atmos