Resource Orchestration Service (ROS) Visual Editor is a tool that visualizes the process of editing a template to improve productivity. It allows users to drag and drop resources onto the canvas where you can perform such tasks as grouping resources, linking resources for dependencies or references, and editing resource properties. This makes the process of creating a template much more intuitive and concise. All the template editing you can do with a text editor you can do with the Visual Editor, but without complex syntax and error-prone text format. This improves user experience. The best part is the visualization of resource dependencies. You no longer have to go through the entire template and try to remember which resource depends on which. It is all laid out on the canvas. The Visual Editor can be found in the ROS console.

This topic describes how to use the Visual Editor to create a template for a high availability use case. This involves a Server Load Balancer (SLB) instance with a Virtual Private Cloud (VPC), a VSwitch, a security group, and an ECS group (with multiple ECS instances), and the listener ports are 443 and 80.

  1. Log on to the ROS console.
  2. Click Visual Editor in the left-side navigation pane. The Visual Editor page appears.
  3. Enter a description for the template.

    Enter a description to explain the use case of the template.

  4. Add parameters.

    Click Add new property item to add the following parameters:

    • Image ID
      • Parameter Name: AppEcsImageId
      • Data Type: String
      • Default Value: ubuntu_14
    • Instance type
      • Parameter Name: AppEcsInstanceType
      • Enter values for Default Value and Optional Value respectively.
    • Database name
      • Validation Expression: [a-z] {1} [a-z0-9-_] * [a-z0-9] {1} (must consists of lowercase letters, numbers and underscore (_). Must begin with a letter and end with a letter or number.)
      • Maximum Length: 64
      • Minimum Length: 2
      • Description: Name of the APP database.
      • Prompt: Consist of 2 to 64 characters of lowercase letters, hyphen or underline. Must begin with a letter and end with an alphanumeric character.
    • ECS instance password
      • Output: Enable (NoEcho = true)
      • Form Label: InstancePassword
    • Number of ECS instances
      • Data Type: Number
      • Maximum Value: 5
      • Minimum Value: 1
    • Database information
      • RDS instance type
      • RDS capacity
      • RDS password
      • RDS username
  5. Create resources.

    Use the resource search bar on the left to find the resource you need and drag and drop it to the canvas to create the resource.

    • Create a VPC.

      Drag a VPC and drop it to the canvas. Click the VPC on the canvas. Its Resource Property pane appears on the right. You can modify its resource ID and CIDR block.

    • Create a VSwitch.

      Since a VSwitch cannot be created without a VPC, you must drag the VSwitch and drop it inside the VPC. Click the VSwitch on the canvas and its resource properties appear on the right.

      • Select Ref for VpcId and enter values for Reference Type and Reference Object, respectively.
      • Select JSON for ZoneId and enter values for Reference Type and JSON Value, respectively. The JSON value must strictly conform to JSON syntax.
    • Create a SecurityGroup.

      Since a SecurityGroup cannot be created without a VPC, you must drag the SecurityGroup and drop it inside the VPC. Click the SecurityGroup on the canvas and its resource properties appear on the right.

      • Create a SecurityGroupEgress.
      • Create two SecurityGroupIngress.

        Set PortRange to 443/443 for the first SecurityGroupIngress. Set PortRange to 80/80 for the second.

    • Create an InstanceGroup.

      Drag the InstanceGroup and drop it inside the VPC. Click the InstanceGroup on the canvas and its resource properties appear on the right.

      Edit resource properties on the right:
      • SystemDiskCategory: cloud_ss
      • IoOptimized: optimized
      • InternetChargeType: PayByTraffic
      • ImageId: Click Ref and reference the parameter AppEcsImageId.
      • Password: Click Ref and reference the parameter InstancePassword.
      • InstanceType: Click Ref and reference the parameter AppEcsInstanceType.
      • NetworkType: VPC
    • Create a DBInstance.

      Drag the DBInstance and drop it inside the VPC. Click the DBInstance on the canvas. Its resource properties appear on the right.

      Edit resource properties:
      • Engine: MySQL
      • MultiZA: false
      • DBMappings: Add and set CharacterSetName to UTF-8 and DBName to myapp.
      • DBInstanceClass: Click Ref and reference the parameter DBInstanceClass.
      • MasterUserPassword: Click Ref and reference the parameter DBPassword.
      • DBInstanceNetType: Intranet
      • DBInstanceStorage: 50
      • EngineVersion: 5.6
      • PreferredBackupTime: 23:00Z-24:00Z.
      • PreferredBackupPeriod: Monday, Wednesday
    • Create a LoadBalancer.

      Drag the LoadBalancer to the canvas. Click the LoadBalancer on the canvas. Its resource properties appear on the right.

      • Bandwidth: 200
      • AddressType: Internet
    • Add two SLB listeners.

      Drag both Listeners to the canvas. Click a Listener on the canvas. Its resource properties appear on the right.

      Edit resource properties:
      • Protocol: tcp
      • BackendServerPort: 80 for the first listener and 443 for the second
      • ListenerPort: 80 for the first listener and 443 for the second
      • Bandwidth: -1
      • HealthCheck
      • Persistence
    • Create a BackendServerAttachment.

      Drag the BackendServerAttachment to the canvas. Click the BackendServerAttachment on the canvas. Its resource properties appear on the right.

      • BackendServerList: Click JSON and select FnGetAttr as the Data Type.
      • LoadBalancerId: Click Ref and reference ALIYUN-SLB-LoadBalancer1.
  6. Add output items.

    Click a blank area on the canvas. Resource Orchestration Template appears on the right. Click Add new property item under Output. Click the edit icon to add the following output items:

    • AppEcsLoadBalancerIp
    • DatabaseInnerConnString
    • DatabaseInnerPort
  7. Save the template.

    Click Save Template in the top menu. The Create Template page on My Templates appears. Enter the template title and description, and click Create.