About Template Files
A template in Oracle Cloud Stack is a YAML file that’s comprised of several components, including parameters, resources, attributes, and conditions.
Files that contain YAML documents can use any file extension but .yaml
is a typical convention. The first line in the file identifies it as a YAML document by using 3 dashes:
---
In the template’s definition provide its name, version and description:
---
template:
templateName: MyTemplateName
templateVersion: 1.0
templateDescription: My Oracle cloud stack template
The values of templateName
and templateVersion
are used to uniquely identify a template in Oracle Cloud
Stack. The name of the template source file is not used to identify a template. Two templates can have identical names if they have different versions.
Template documents have the following general structure:
Template
Parameters (Optional)
Parameter Groups (Optional)
Attributes (Optional)
Conditions (Optional)
Resources
YAML supports two different methods of expressing sequences (collections of items). You can write a YAML sequence by using multiple lines and dashes, as shown in the following example:
depends_on:
- HRStorage
- HRDatabase
Alternatively, you can write a YAML sequence as an array by using square brackets. For example:
depends_on: [HRStorage,HRDatabase]