Setting component dependencies in Cloud Assembly
In the previous post we’ve seen how to setup Cloud Automation Services, how to use Cloud Assembly to create a fully Cloud agnostic blueprint, how to use input variables. When designing services it may be necessary to setup dependencies between different components in the blueprint.
When using VMware Cloud Assembly, one component might need to follow another. For example, when deploying an application which uses a web front-end and a separate database server. The web front-end can only be deployed and configured when the name of the database server and the name of the database is known. To achieve this you an add dependencies so that deployment executes in the correct order.
Explicit Dependency
A blueprint component needs information from another before it can finish the provisioning process. This type of dependency controls the build order at deployment time, or for scale in or scale out actions. For example, your database server must be deployed before your application server. Implicit Dependency
A blueprint component property needs a property value from another component. This type of dependency is a property binding. A binding controls the build order by not building the component that contains the dependent property until the component on which it is dependent is deployed and the property is available. For example, your BackupServer component needs the operating system image of the DatabaseServer component, so the DatabaseServer must exist before the BackupServer is provisioned. How Do I Set Dependencies You can create the explicit dependencies using the design canvas or by adding dependsOn properties in the YAML editor. Implicit dependencies are set only in the YAML editor.
Use one of the following methods to create an explicit dependency.
To create an explicit dependency on the canvas, you begin with the dependent component and connect it to the component it is depending on. To create an explicit dependency in the YAML editor, you add a dependsOn property to the dependent component that specifies the component it is depending on. An explicit dependency appears on the canvas as a solid arrow, where the ApplicationServer is not provisioned until DatabaseServer is provisioned. The dependency appears in the YAML as a dependsOn property.
Use the following method to create an implicit dependency.
To create an implicit dependency as a property binding, you add a property binding in the dependent component property that specifies the property value needed from the component that it is depending on. An implicit dependency appears on the canvas as a dashed line arrow, were the backup is not provisioned until the webTier is provisioned and acquired an address from the network.