Skip to content

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_id
  • region
  • billing_account_id
  • context_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:

  1. examples/inputs.state.yml
  2. examples/inputs.min.yml
  3. examples/inputs.typical.yml
  4. other examples/*.yml
  5. tests/example-inputs.yml
  6. spec.inputs.defaults if 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 init writes only the env-scoped overlay. It does not apply the module.
  • Edit the generated .inputs.yml file, then run the normal hyops preflight, validate, or apply flow.
  • If the overlay was created with --state-instance, use the same --state-instance value for hyops preflight, validate, apply, and destroy so 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-off HYOPS_INPUT_* overrides.
  • --env selects the runtime lane. If a module also has a context_id, treat it as a naming token, not as a second environment selector.