Marking a component toggleable
Settoggleable = true on a component in your app config, with an optional default_enabled for its starting state:
components/observability.toml
default_enabled, it defaults to false — the component starts disabled until an install enables it.
A non-toggleable component is always enabled and cannot be turned off. Only toggleable components can be enabled or disabled per install.
Toggling per install
A toggleable component’s enabled state is stored as an install input. That input is the source of truth, and there are several ways to set it: the install config, the dashboard, and the CLI all write the same underlying input. If you manage the install with an install config, set the state per component in a[component_toggles] section, keyed by component name:
install.toml
true enables the component on this install; false disables it. A component you don’t list falls back to its default_enabled value from the app config.
When you run nuon installs sync, Nuon reconciles every toggle in one pass: newly enabled components are deployed and newly disabled components are torn down, all within a single workflow. Enabling or disabling a component also runs its pre/post enable and disable lifecycle actions when defined.
Dependencies
Toggle state has to stay consistent with the component dependency graph. Nuon enforces two rules whenever you sync:- An enabled component cannot depend on a disabled one.
- A component cannot be disabled while a component that depends on it is still enabled.
dependencies and implicit output references ({{.nuon.components.<name>.outputs...}}) count as edges in the graph.
For example, given api_gateway depends on certificate, syncing a config that enables the gateway while the certificate is disabled fails with:
Dashboard and CLI
Each toggleable component’s enabled state is exposed through the API, the dashboard, and the CLI:--component-id accepts a component ID or name. If you omit both --enable and --disable, the CLI prompts you to choose.
For installs managed by an install config, the dashboard toggles are disabled, since the config file is the place these inputs are managed and a later nuon installs sync would overwrite an out-of-band change.
Config sync reconciles all toggles in a single workflow. An imperative per-component toggle runs a dedicated enable or disable workflow for that one component.