Auto deploys and dependencies
Define dependencies between components to control how installs are first configured, and ensure teardown is properly ordered.
When you create an app using the nuon
cli, an an sdk, or using an installer - each component in the app will
automatically be deployed to new installs, without you having to run a release.
To support this, we model apps as directed acyclic graphs. Each component is a node in that graph. When provisioning an install, the components will be provisioned in the order of their dependencies. When deprovisioning an install, the components will be deprovisioned in the reverse order.
You can control this order by declaring component dependencies in your app config.
Component Dependencies
Let’s say you are deploying a Helm packaged app that requires a database managed by Terraform.
Your Nuon config will have two components, your Terraform component and a Helm component. In order for the Helm component to be properly deployed, it must know about the some of the outputs from the Terraform component. In this example, the Terraform component must be provisioned before the Helm component when provisioning the install. When destroying the install, the Helm component must be deprovisioned first.
To ensure that happens, add the dependencies
attribute to the Helm component, referencing the Terraform component ID.
Cyclic Dependencies
Nuon does not support cycling dependencies. When you apply your app config, we will automatically look out for cycles and error if your dependencies are invalid: