RB-036 - Materialize module inputs with hyops module init¶
Use hyops module init when an operator needs a durable env-scoped module input file under config/modules/... and does not want to create that path by hand.
This is the module equivalent of hyops blueprint init.
When to use it¶
- recover an existing env to a new provider project or account
- create a fresh state-instance input file for a module
- promote a shipped example into a durable env-scoped overlay before editing
Basic usage¶
hyops module init --env dev --module org/gcp/project-factory
This writes:
~/.hybridops/envs/dev/config/modules/org__gcp__project-factory/latest.inputs.yml
For org/gcp/project-factory, HyOps also prefills the generated overlay from the env GCP init context when available:
project_idregionbilling_account_idcontext_id(set to the selected env)
That avoids carrying a shipped example like CHANGE_ME_BILLING_ACCOUNT or a baked context_id: dev into a real recovery lane.
By default, HyOps picks the best shipped example in this order:
examples/inputs.state.ymlexamples/inputs.min.ymlexamples/inputs.typical.yml- other
examples/*.yml tests/example-inputs.ymlspec.inputs.defaultsif no example exists
When a module ships inputs.state.yml, that file is the preferred durable-overlay template.
It keeps state-backed fields empty or expressed as state refs so upstream project, network, router, or target changes continue to flow into later runs.
Explicit values in the env overlay remain the operator override path.
Blank string placeholders in the overlay do not replace imported dependency values; set a non-empty explicit value when you intentionally want to override upstream state.
Initialize an instance-specific overlay¶
hyops module init --env dev \
--module platform/k8s/argocd-bootstrap \
--state-instance gke_burst_gitops
This writes:
~/.hybridops/envs/dev/config/modules/platform__k8s__argocd-bootstrap/instances/gke_burst_gitops.inputs.yml
Use a specific example file¶
hyops module init --env dev \
--module platform/k8s/argocd-bootstrap \
--source examples/inputs.burst.yml \
--state-instance gke_burst_gitops \
--force
Overwrite an existing overlay¶
hyops module init --env dev \
--module org/gcp/project-factory \
--force
Notes¶
hyops module initwrites only the env-scoped overlay. It does not apply the module.- Edit the generated
.inputs.ymlfile, then run the normalhyops preflight,validate, orapplyflow. - If the overlay was created with
--state-instance, use the same--state-instancevalue forhyops preflight,validate,apply, anddestroyso HyOps targets the same module state slot consistently. - For integrated lanes such as
dev, prefer updating the env-scoped module inputs instead of relying on one-offHYOPS_INPUT_*overrides. --envselects the runtime lane. If a module also has acontext_id, treat it as a naming token, not as a second environment selector.