This topic describes how to use an online template editor of Resource Orchestration Service (ROS) to create a template. The online template editor of ROS provides a variety of features, such as automatic code completion, and previews for template structure and parameters.

Prerequisites

You are familiar with the syntax and the basic structure of ROS templates. For more information, see Template syntax and Template structure.

Procedure

  1. Log on to the ROS console.
  2. In the left-side navigation pane, choose Templates > My Templates.
  3. On the My Templates page, click Create Template.
  4. On the Create Template page, edit your template in the template editor.
    The following types of template editors are supported: ROS and Terraform template editors.

ROS template editor

An ROS template editor supports the following modes: script editor and visual editor modes.

  • Script editor

    The script editor supports automatic code completion and hinting. You can use the script editor to create JSON and YAML templates.

    • Intelligent code hinting of resource and parameter types

      When you configure the Resources and Parameters sections of an ROS template, the script editor responsively displays hints about the resource and parameter types.

      001
    • Intelligent code hinting of resource properties

      When you configure the Resources section of an ROS template, the script editor responsively displays hints about the resource properties.

      资源属性
    • Intelligent code hinting of references

      When you use the Ref function in the Resources, Outputs, Mappings, Conditions, and Metadata sections of an ROS template, the script editor responsively displays hints about the parameters, resource IDs, and pseudo parameters.

      引用
    • Template preview

      After you define an ROS template, you can click Preview in the upper-right corner of the script editor to preview the template. This feature helps you identify and fix invalid mappings.

      模板预览
  • Visual editor

    The visual editor supports GUI elements such as drop-down lists and fields.

    You can enter the content of a template in the visual editor to define and generate an ROS template. In a visual editor, the list of template sections is displayed. You can update or delete template parameters, resources, metadata, and outputs based on the list.

    可视化编辑

Terraform template editor

  • Import and editing of Terraform templates

    You can import an existing Terraform template from a local folder to a Terraform template editor.

  • Conversion between Terraform and ROS templates

    After you define a Terraform template and convert the Terraform template into an ROS template, the template format is changed to the template format that is supported by the Terraform hosting feature.