Why Dependencies?
Most applications have either explicit or implicit dependencies between the different components that comprise them. For example, given an app that comprises a Helm chart component and a Terraform component:components/helm.toml
components/database.toml
helm chart requires that the database be provisioned before it is deployed. Otherwise, the
database will not exist yet, and the database_url output will not be defined.
When deprovisioning the install, the helm chart must be deprovisioned before the database, to ensure no active
dependencies exist, preventing the database from being shut down.
Defining Component Dependencies
To support this, you can define one or more dependencies on each component, telling Nuon what other components it relies on. Nuon will use your configuration to build a dependency graph, to ensure components are provisioned and deprovisioned in the correct order. Dependencies can be explicitly defined using thedependencies field in each component’s configuration file.
You can specify which components a given component depends on by listing their names in the dependencies array.
Taking the example above, you can make the Helm chart depend on the database by adding it to the dependencies list.
With the directory-based approach, you can specify dependencies explicitly in each component file:
components/database.toml
components/helm.toml