A Terraform root module rarely runs on its code alone: its providers
need to know which subscription, project, account or compartment to
work in, and its input variables without a default need values. Kumoss
asks for these once per root module, keeps the answers in a manifest,
kumoss.yaml, committed inside the module, and reuses them on every
later session.
What Kumoss reads from the module
Before a session runs, the core inspects the root module statically
with HashiCorp’s terraform-config-inspect (bundled in the core image;
no init, no provider download) and scans its variable-definition
files:
-
Providers — every entry of the module’s
required_providers, identified by its Terraform provider type: the last segment of its source address (azurermforhashicorp/azurerm,google,aws,oci,kubernetes,vsphere,random,helm…). A module may use several, and every one of them is part of the session. Nobody picks a provider in the wizard any more. -
Variables — each
variableblock’s name, type, description, and whether it is required (no default) orsensitive. -
Var files —
terraform.tfvarsand.auto.tfvarsat the module’s top level, which Terraform loads on its own, and any other.tfvarsor.tfvars.jsonfile up to three directories below the module (envs/dev.tfvars), which are *optional: the user may pick them, and each run passes them as-var-filein the order picked, so Terraform reads them itself, fresh on every command. Kumoss only reads which variables a file sets. Subdirectories that are modules themselves, hidden directories and symlinks are skipped.
A configuration with errors is reported as 422 rather than guessed
at.
Scopes
Four providers have a scope, the place their resources live in, and need one before a session can run:
| Provider | Scope | Sent to the IaC sidecar as |
|---|---|---|
|
subscription id |
|
|
project id |
|
|
account id |
|
|
compartment OCID |
|
The user answers each scope once, in the inputs form; it is saved in
the manifest. The core turns it into the environment variable of every
command the session runs, or into an input variable of every plan and
import, sent last so no configured value overrides it. Because the
core fills aws_account_id and compartment_ocid from the scope, those
two variables are never asked for. Every other provider has no scope
and runs on whatever the IaC sidecar’s ambient credentials and
configuration select. See
Environment
and input variables and
Terraform providers.
The manifest file
The manifest is a YAML file named kumoss.yaml (configurable with
paths.manifest_filename)
in the root module’s directory:
# Managed by Kumoss: the inputs this Terraform root module is configured with.
# Sensitive values are never stored here, only their names.
version: "1"
project_identifier: sistemas-kumoss-rsg-esc1-dev
fingerprint: sha256:<hex>
providers:
- name: azurerm
source: hashicorp/azurerm
version_constraints: ["~> 4.0"]
var_files: [envs/dev.tfvars]
variables:
- name: region
value: westeurope
- name: db_password
sensitive: true
scopes:
- provider: azurerm
scope_id: 00000000-0000-0000-0000-000000000000
| Key | Meaning |
|---|---|
|
The layout version, |
|
Optional. What the user named the repository when it was not its URL (a name the mapping sidecar resolved), as recorded by the latest session that saved the manifest. Written only when the session has one. Informational: it is refreshed on every save and never makes the manifest drift. See Project identifier. |
|
A digest of what the user answers for: the providers and their constraints, each variable’s name, type, required and sensitive flags, which variables the auto-loaded files set, and which optional var files exist. Descriptions, defaults and the contents of optional var files are left out, so editing them never triggers a question. |
|
The module’s |
|
The optional var files picked, in the order they are passed. |
|
The user’s answers. Plain values are stored as given, in any JSON
type. Sensitive ones carry only |
|
One |
The file is committed by a session on its branch, together with the
session’s other changes, and reaches the default branch when the
session’s pull request is merged. Only version and fingerprint are
required; every other key is optional. Reading is strict about what is
there: the file may be edited by hand, so a known key with the wrong
type or shape is reported (422) rather than guessed, and a sensitive
variable written with a value is refused with an instruction to remove
it and rotate the secret. Unknown keys, at any level, are ignored, so a
newer layout can add keys without breaking older readers; they are not
kept when Kumoss saves the file.
Project identifier
A repository can be named by a project identifier, such as
sistemas-kumoss-rsg-esc1-dev, that the mapping sidecar resolves to
its URL. When the session’s first call carries one (the
project_identifier field of the
Core API),
the session writes it to the manifest. Every session’s first call
records its own identifier: when it differs from the manifest’s, or the
session has none and the manifest does, the manifest is saved even if
nothing else changed, and a session without one removes the key. It is
not part of the fingerprint, so the probe never reports drifted or
needs_input because of it.
Where values and secrets live
| What | Where |
|---|---|
Plain variable values, picked var files, scopes |
|
Sensitive variable values |
One JSON object per root module in Kumoss’s object storage (the
artifacts bucket, |
Values at run time |
Sent to the IaC sidecar on |
A variable declared sensitive in the code is always stored as a
secret. Any other variable can be marked secret by the user in the
inputs form (sensitive: true in the API). Probe responses and session
read models never contain values.
Provider credentials are not manifest inputs: they stay in the IaC sidecar’s environment, or an IaC service implementation picks them by the session’s project identifier.
Before a session: the probe
POST /api/v1/manifest/probe with repo_uri and root_module_path
reads the module on the repository’s default branch and reports what
a session on it would need. It never writes anything.
| Field | Meaning |
|---|---|
|
|
|
Whether the first session call must carry answers. True when a value, a var file selection or a scope is missing, and on a first setup when the module has optional var files to choose from. |
|
Required variables nothing covers — no default, no auto-loaded file,
no picked var file, no saved answer — and sensitive variables whose
stored value is gone. Each with its name, type, description, and
|
|
The optional var files, each with |
|
Picked var files that no longer exist; a new selection is needed. |
|
Scoped providers with no scope yet, as |
|
Providers added, removed or re-constrained since the manifest was written. |
The first session call
The answers ride on the first generate, drift or import call, in
manifest:
{
"q": "Add a private storage account for application logs",
"repo_uri": "https://github.com/acme/infra.git",
"root_module_path": "environments/dev",
"manifest": {
"variables": [
{"name": "db_password", "value": "s3cr3t"},
{"name": "region", "value": "westeurope", "sensitive": false}
],
"var_files": ["envs/dev.tfvars"],
"scopes": {"azurerm": "00000000-0000-0000-0000-000000000000"}
}
}
When the probe says needs_input: false, manifest is omitted. Either
way the session, right after cloning:
-
inspects the module again and reconciles it with the committed manifest and the answers;
-
derives the session’s provider/scope pairs and has the authorization sidecar evaluate each of them, before anything is saved;
-
stores the secret values, writes
kumoss.yamland commits it to the session branch (nothing is committed when nothing changed); -
records the providers and scopes on the session, where the session read models show them as
providers: [{name, scope_id}].
If something is still missing, or an answer is invalid (unknown
variable or provider, a value of the wrong shape, a var file that
cannot be selected), the session ends FAILED with the reason — for
example The root module needs values for db_password. Probe it with
POST /v1/manifest/probe and send the answers in manifest. — and
nothing is saved. Iteration calls cannot carry manifest: they reuse
the providers, scopes and inputs set up at the first call.
In the web application
The wizard asks for the request, the repository URL and the root module, then probes the module ("Checking what the root module needs…"). When nothing is needed the session starts straight away. Otherwise it shows the inputs form, "This root module needs a few values", with up to three groups:
-
Scopes — one field per provider in
missing_scopes, labeled in the provider’s terms (Subscription ID, Project ID, Account ID, Compartment OCID). -
Values — one field per missing variable, typed after the declaration (JSON for lists, maps and objects), with a Secret toggle; a variable declared sensitive is always a secret.
-
Variable files — the optional var files, picked in order. A variable that a picked file sets can be left empty.
The answers go with the session’s first call. They are asked once: the
next session on the same module finds them in the manifest — once the
pull request carrying kumoss.yaml has been merged into the default
branch, which is what the probe reads.
When the module changes
The manifest is checked against the code at the start of every session (never on iteration calls):
-
Nothing to ask — a provider bump, a removed variable, a new variable with a default, a variable newly declared
sensitive(its plain value moves to the secret store), a provider that no longer needs a scope — the session updates the manifest by itself and commits it with its changes. The probe reportsdriftedwithneeds_input: false. -
Something to ask — a new required variable, a new scoped provider, a picked var file that was deleted, or a secret whose stored value is gone (asked again rather than silently replaced by a default) — the probe reports
needs_input: trueand the wizard asks only for that.
A module that has no manifest and needs nothing (no required variable, no scoped provider, no optional var file) is set up silently on its first session.
Related pages
-
Core API for the probe route and the
manifestrequest field. -
Terraform providers for the credentials each provider needs in the IaC sidecar.
-
Prompt registry for how the module’s providers select the prompts a session uses.
-
Compliance policy for how the module’s provider type names reach the Rego policy as
input.kumoss.providers. -
Upgrade notes for what changed when providers moved to the module.