When you use a cloud template task in Code Stream, a common question is how to use the output of that task in a subsequent task in your pipeline. To use the output of a cloud template task, such as a cloud machine, you must know how to find the resource properties in the deployment details of the cloud template task, and the IP address of the cloud machine.
For example, the deployment details of a VMware Cloud Template include the cloud machine resource and its IP address. In your pipeline, you can use the cloud machine and IP address as a variable to bind a cloud template task to a REST task.
The method that you use to find the IP address for the cloud machine is not typical, because the deployment of the VMware Cloud Template must finish before the deployment details are available. Then, you can use the resources from the VMware Cloud Template deployment to bind your pipeline tasks.
- The resource properties that appear in a cloud template task in your pipeline are defined in the VMware Cloud Template in Cloud Assembly.
- You might not know when a deployment of that cloud template finished.
- A cloud template task in Code Stream can only display the output properties of the VMware Cloud Template after the deployment finished.
This example can be especially useful if you are deploying an application and invoking various APIs. For example, if you use a cloud template task that calls a VMware Cloud Template, which deploys a Wordpress application with a REST API, you can locate the IP address of the deployed machine in the deployment details, and use the API to test it.
The cloud template task supports you to use variable binding by displaying the type ahead auto fill details. It is up to you how you bind the variable.
This example shows you how to:
- Find the deployment details and resource properties for your cloud template task in a pipeline that ran and succeeded.
- Find the cloud machine IP address in the resources section of the deployment details.
- Add a REST task subsequent to the cloud template task in your pipeline.
- Bind the cloud template task to the REST task by using the cloud machine IP address in the URL of the REST task.
- Run your pipeline and watch the binding work from the cloud template task to the REST task.
Prerequisites
- Verify that you have a working VMware Cloud Template that is versioned.
- Verify that the deployment of the VMware Cloud Template succeeded in Cloud Assembly.
- Verify that you have a pipeline that includes a cloud template task that uses that VMware Cloud Template.
- Verify that your pipeline ran and succeeded.
Procedure
Results
Congratulations! You found the cloud machine name and IP address in the deployment details and JSON output of a cloud template task, and used them to bind your cloud template task output to your REST task URL input in your pipeline.
What to do next
Continue to explore using binding variables from resources in the cloud template task with other tasks in your pipeline.