All Products
Search
Document Center

Resource Orchestration Service:Metadata

Last Updated:Feb 29, 2024

You can use Metadata to group the parameters defined in the Parameters section of a template and define a label for each group. To view the display effect of the parameters, you can go to the Configure Parameters step in the Resource Orchestration Service (ROS) console.

Syntax

Metadata:
  ALIYUN::ROS::Interface:
    # ParameterGroups is required.
    ParameterGroups:
      - <ParameterGroup1>
      - <ParameterGroup2>
      - ...
    # TemplateTags is optional. The value is a custom string.
    TemplateTags:
      - <Tag1>
      - <Tag2>
      - ...

ParameterGroup syntax

# Parameters is required.
Parameters: 
    - <Parameter1>
    - <Parameter2>
    - ...
# Label is required.
Label: 
    default: <Custom String>

Example

ROSTemplateFormatVersion: '2015-09-01'
Description: an example of the Metadata section.
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - VpcName
          - VpcCidrBlock
        Label:
          default: VPC
      - Parameters:
          - VswName
          - VswCidrBlock
        Label:
          default: VSwitch
    TemplateTags:
      - VPC-VSwitch
Parameters:
  VpcName:
    Type: String
    Label: VPC Name
    Description: The name must be 2 to 128 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter. 
    Default: MyVPC
  VswName:
    Type: String
    Label: vSwitch Name
    Description: The name must be 2 to 128 characters in length and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter. 
    Default: MyVSwitch
  VpcCidrBlock:
    Type: String
    AllowedValues:
      - 10.0.0.0/8
      - 172.16.0.0/12
      - 192.168.0.0/16
    Description: the CIDR block of the VPC. To specify a custom CIDR block, you must change the valid CIDR blocks that are specified by AllowedValues in the template. The custom CIDR block must be one of the subnets of the valid CIDR blocks. 
    Label: IPv4 CIDR Block
    Default: 192.168.0.0/16
  VswCidrBlock:
    Type: String
    Description: The vSwitch CIDR block must be a subnet of the VPC CIDR block and is not used by other vSwitches. 
    Label: IPv4 CIDR Block
    Default: 192.168.1.0/24
Resources:
  VSwitch:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VpcId:
        Ref: VPC
      ZoneId:
        Fn::Select:
          - '1'
          - Fn::GetAZs:
              Ref: ALIYUN::Region
      CidrBlock:
        Ref: VswCidrBlock
      VSwitchName:
        Ref: VswName
  VPC:
    Type: ALIYUN::ECS::VPC
    Properties:
      CidrBlock:
        Ref: VpcCidrBlock
      VpcName:
        Ref: VpcName