Example Workflows
Nomatron is in early access. Some advanced workflows may not be covered in the public docs.
This page shows how the provider fits into real operating patterns.
The most useful way to think about Terraform with Nomatron is not as a list of isolated resources, but as a way to encode repeatable workflows.
Workflow 1: Bootstrap A New Organization
One of the strongest Terraform use cases is onboarding a new tenant or team.
Typical flow:
- create the organization;
- add members or groups;
- create any required custom roles;
- assign roles to the right subjects;
- register the Nomad cluster if needed;
- create the app, app environments, and jobs; and
- define baseline variables.
This gives you a reviewable, repeatable onboarding path that is much easier to audit than manual point-and-click setup.
Workflow 2: Manage RBAC Declaratively
Terraform is a strong fit for RBAC because access-control changes benefit from review and version history.
A common pattern is:
- define custom roles in Terraform;
- define group structure in Terraform;
- assign roles to groups and service accounts in Terraform; and
- keep day-to-day human approval activity out of Terraform.
That strikes a useful balance between declarative governance and interactive operations.
Workflow 3: Manage Delivery Baselines
For many platform teams, Terraform is the right place to define the baseline shape of delivery rather than the day-to-day application change itself.
Examples:
- application definitions;
- app environments and jobs;
- default variables;
- cluster bindings; and
- GitHub App integration wiring.
The application code and deployment changes still move through Git and Nomatron workflows, but the surrounding control-plane objects stay declarative.
Workflow 4: Read Existing State Before Incremental Adoption
If you already have a running Nomatron installation, you do not have to move everything into Terraform at once.
A safer pattern is:
- use data sources to read existing resources;
- import selected resources into Terraform state where appropriate; and
- migrate ownership gradually.
This reduces the risk of accidental duplication or conflicting ownership models.
Import Patterns
Most managed resources support terraform import.
Common examples include:
terraform import nomatron_network_agent.example aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa
terraform import nomatron_application.example platform/payments
terraform import nomatron_environment.example platform/payments/prod
terraform import nomatron_variable.example job/platform/payments/web/aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaaThis is useful when:
- a resource already exists in Nomatron;
- you now want Terraform to own it; and
- you want to avoid recreating it manually.
Actions And Operational Workflows
The provider also supports selected imperative actions, such as:
nomatron_import_nomad_jobnomatron_speculative_plan- job-level and app-level destroy actions (
nomatron_destroy_job,nomatron_destroy_app_jobs)
These are different from normal resources:
- resources describe durable state;
- actions trigger operational behavior.
That means you should usually treat actions as targeted workflow tools, not as a replacement for the stable resource model.
For deployment actions, remember that app environments are mandatory. A speculative plan can target a specific app environment, and a normal deployment without an explicit environment starts from the first app environment by priority.
Destroy actions stop and purge live Nomad jobs. They do not delete Nomatron app or job configuration. They are available in provider ~> 0.6.
Recommended Team Pattern
For most teams, a good Terraform operating model looks like this:
- one workspace for platform bootstrap and shared global objects;
- one or more workspaces for organization-scoped onboarding;
- provider authentication through dedicated service accounts;
- sensitive values passed through secret stores and
value_wowhere appropriate; and - normal Git review on every Terraform change before apply.
This keeps Terraform useful without turning it into a catch-all for every interactive Nomatron action.