Authentication
Nomatron is in early access. Some advanced workflows may not be covered in the public docs.
The Nomatron Terraform provider authenticates using a Nomatron token.
In practice, that means you should decide not just how to pass the token into Terraform, but which Nomatron identity should own Terraform-driven changes.
Use A Service Account Where Possible
For long-lived automation, the best default is a dedicated Nomatron service account rather than a human user token.
That gives you:
- clearer ownership of Terraform-driven changes;
- easier token rotation;
- tighter RBAC boundaries; and
- less coupling between human access and automation access.
Provider Authentication Shape
The provider itself uses a simple configuration model:
provider "nomatron" {
address = "https://nomatron.example.com"
token = var.nomatron_token
}The token should usually be injected from outside source control.
Do Not Hardcode Tokens In Configuration
Avoid committing tokens directly into .tf files.
Preferred patterns include:
- CI/CD secret stores;
- Terraform Cloud or Enterprise workspace variables;
- local shell environment injection into
TF_VAR_nomatron_token; or - secret managers used by your automation platform.
Example:
export TF_VAR_nomatron_token="$NOMATRON_TOKEN"
terraform planAlign RBAC With Terraform Scope
The token used by Terraform should only have the permissions Terraform actually needs.
Examples:
- a bootstrap workspace may need global administration permissions;
- an organization-scoped workspace may only need access within one organization; and
- a narrow workflow managing variables for one app should not need broad platform access.
This matters because Terraform can create, update, and destroy resources very quickly once the token is accepted by the provider.
Separate Workspaces By Responsibility
A good pattern is to avoid one giant Terraform workspace for every Nomatron concern.
Instead, split by responsibility where useful:
- platform bootstrap;
- RBAC and access control;
- cluster and integration registration;
- app and environment onboarding.
That makes both token scoping and change review easier.
Sensitive Resource Values
Some Nomatron resources contain sensitive values.
In particular, nomatron_variable supports both:
valuefor normal non-sensitive values; andvalue_wofor write-only sensitive values.
Use value_wo for secrets so the value is not stored in Terraform plan or state, assuming your Terraform version supports write-only attributes.
Example:
resource "nomatron_variable" "db_password" {
scope = "job"
org_name = "platform"
app_slug = "payments"
job_slug = "web"
key = "db_password"
sensitive = true
value_wo = var.db_password
}Recommended Authentication Model
For most teams, the strongest default is:
- create a dedicated Terraform service account in Nomatron;
- assign only the required permissions;
- inject the token from a secret manager or CI variable store; and
- keep human operator credentials separate from Terraform automation.