Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::ECS::VSwitch

Última atualização: Sep 07, 2026

O recurso ALIYUN::ECS::VSwitch cria um vSwitch.

Sintaxe

{
  "Type": "ALIYUN::ECS::VSwitch",
  "Properties": {
    "VSwitchName": String,
    "VpcId": String,
    "Description": String,
    "Tags": List,
    "Ipv6CidrBlock": Integer,
    "ZoneId": String,
    "CidrBlock": String,
    "VpcIpv6CidrBlock": String,
    "ZoneType": String
  }
}

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

VpcId

String

Sim

Não

ID da VPC onde o vSwitch será criado.

Nenhuma

ZoneId

String

Sim

Não

ID da zona.

Nenhuma

VSwitchName

String

Não

Sim

Nome do vSwitch.

O nome deve ter de 2 a 128 caracteres e começar com uma letra ou caractere chinês. Não pode iniciar com http:// ou https://. Pode conter letras, caracteres chineses, dígitos, sublinhados (_) e hifens (-).

CidrBlock

String

Sim

Não

Bloco CIDR do vSwitch.

O bloco CIDR deve ser uma sub-rede da VPC e não pode estar em uso por outro vSwitch.

Description

String

Não

Sim

Descrição do vSwitch.

A descrição deve ter de 2 a 256 caracteres e não pode começar com http:// ou https://.

Ipv6CidrBlock

Integer

Não

Não

Bloco CIDR IPv6 do vSwitch.

Valores válidos: 0 a 255 (inteiro decimal).

Por padrão, a máscara do bloco CIDR IPv6 do vSwitch tem 64 bits.

Você pode personalizar os últimos 8 bits do bloco CIDR IPv6 da VPC.

Tags

List

Não

Sim

Tags do vSwitch.

Adicione até 20 tags.

Para mais informações, consulte Tags properties.

VpcIpv6CidrBlock

String

Não

Não

Bloco CIDR IPv6 da VPC.

Nenhuma

ZoneType

String

Não

Não

Tipo de zona a consultar.

Valor padrão: AvailabilityZone.

Sintaxe de Tags

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Propriedades de Tags

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

Key

String

Sim

Não

Chave da tag.

A chave deve ter de 1 a 128 caracteres. Não pode começar com aliyun ou acs:, nem conter http:// ou https://.

Value

String

Não

Não

Valor da tag.

O valor pode ter de 0 a 128 caracteres. Não pode começar com aliyun ou acs:, nem conter http:// ou https://.

Valores de retorno

Fn::GetAtt

  • CidrBlock: bloco CIDR IPv4 do vSwitch.

  • Ipv6CidrBlock: bloco CIDR IPv6 do vSwitch.

  • VSwitchId: ID do vSwitch.

  • VSwitchName: nome do vSwitch.

Exemplos

Cenário 1: Crie uma VPC e um vSwitch.

Criação rápida

Outputs:
  VSwitch1Name:
    Description: Name of created VSwitch.
    Value:
      Fn::GetAtt:
        - VSwitch
        - VSwitchName
  VpcName:
    Description: Name of created VPC.
    Value:
      Fn::GetAtt:
        - Vpc
        - VpcName
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  ZoneId:
    AssociationProperty: ALIYUN::ECS::Instance:ZoneId
    Type: String
    Description:
      zh-cn: The ID of the zone where the vSwitch resides. For more information, see <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.
      en: VSwitch available area id, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.
    Label:
      zh-cn: VSwitch 1 Zone ID
      en: VSwitch 1 ZoneId
  VpcCidrBlock:
    Default: 192.168.0.0/16
    Type: String
    Description:
      zh-cn: 'The IP address range of the VPC in CIDR block format. <br>You can use the following IP address ranges or their subnets: <br><font color=''green''>[10.0.0.0/8]</font><br><font color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
      en: 'The ip address range of the VPC in the CidrBlock form; <br>You can use the following ip address ranges and their subnets: <br><font color=''green''>[10.0.0.0/8]</font><br><font color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
    Label:
      zh-cn: VPC CIDR Block
      en: VPC CIDR Block
  VSwitchCidrBlock:
    Default: 192.168.1.0/24
    Type: String
    Description:
      zh-cn: The CIDR block must be a subnet of the VPC CIDR block.
      en: Must belong to the subnet segment of VPC.
    Label:
      zh-cn: VSwitch 1 CIDR Block
      en: VSwitch 1 CIDR Block
Resources:
  VSwitch:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VSwitchName:
        Fn::Join:
          - '-'
          - - VSwitch
            - StackId
            - Ref: ALIYUN::StackId
      VpcId:
        Ref: Vpc
      CidrBlock:
        Ref: VSwitchCidrBlock
      ZoneId:
        Ref: ZoneId
  Vpc:
    Type: ALIYUN::ECS::VPC
    Properties:
      VpcName:
        Fn::Join:
          - '-'
          - - StackId
            - Ref: ALIYUN::StackId
      CidrBlock:
        Ref: VpcCidrBlock
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - VpcCidrBlock
          - ZoneId
          - VSwitchCidrBlock
        Label:
          default: Basic Network Configuration
{
  "Outputs": {
    "VSwitch1Name": {
      "Description": "Name of created VSwitch.",
      "Value": {
        "Fn::GetAtt": [
          "VSwitch",
          "VSwitchName"
        ]
      }
    },
    "VpcName": {
      "Description": "Name of created VPC.",
      "Value": {
        "Fn::GetAtt": [
          "Vpc",
          "VpcName"
        ]
      }
    }
  },
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ZoneId": {
      "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
      "Type": "String",
      "Description": {
        "zh-cn": "The ID of the zone where the vSwitch resides. For more information, see <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.",
        "en": "VSwitch available area id, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>."
      },
      "Label": {
        "zh-cn": "VSwitch 1 Zone ID",
        "en": "VSwitch 1 ZoneId"
      }
    },
    "VpcCidrBlock": {
      "Default": "192.168.0.0/16",
      "Type": "String",
      "Description": {
        "zh-cn": "The IP address range of the VPC in CIDR block format. <br>You can use the following IP address ranges or their subnets: <br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>",
        "en": "The ip address range of the VPC in the CidrBlock form; <br>You can use the following ip address ranges and their subnets: <br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>"
      },
      "Label": {
        "zh-cn": "VPC CIDR Block",
        "en": "VPC CIDR Block"
      }
    },
    "VSwitchCidrBlock": {
      "Default": "192.168.1.0/24",
      "Type": "String",
      "Description": {
        "zh-cn": "The CIDR block must be a subnet of the VPC CIDR block.",
        "en": "Must belong to the subnet segment of VPC."
      },
      "Label": {
        "zh-cn": "VSwitch 1 CIDR Block",
        "en": "VSwitch 1 CIDR Block"
      }
    }
  },
  "Resources": {
    "VSwitch": {
      "Type": "ALIYUN::ECS::VSwitch",
      "Properties": {
        "VSwitchName": {
          "Fn::Join": [
            "-",
            [
              "VSwitch",
              "StackId",
              {
                "Ref": "ALIYUN::StackId"
              }
            ]
          ]
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": {
          "Ref": "VSwitchCidrBlock"
        },
        "ZoneId": {
          "Ref": "ZoneId"
        }
      }
    },
    "Vpc": {
      "Type": "ALIYUN::ECS::VPC",
      "Properties": {
        "VpcName": {
          "Fn::Join": [
            "-",
            [
              "StackId",
              {
                "Ref": "ALIYUN::StackId"
              }
            ]
          ]
        },
        "CidrBlock": {
          "Ref": "VpcCidrBlock"
        }
      }
    }
  },
  "Metadata": {
    "ALIYUN::ROS::Interface": {
      "ParameterGroups": [
        {
          "Parameters": [
            "VpcCidrBlock",
            "ZoneId",
            "VSwitchCidrBlock"
          ],
          "Label": {
            "default": "Basic Network Configuration"
          }
        }
      ]
    }
  }
}

Cenário 2: Crie uma VPC de zona dupla e vSwitches.

Criação rápida

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: Create a dual-zone VPC network with a security group, automatic subnet CIDR configuration, and support for custom IP ranges.
  en: Create a dual-Availability Zone VPC network, inclusive of security groups, with automatic subnet CIDR configuration and support for custom IP ranges.
Parameters:
  VSwitch1ZoneId:
    AssociationProperty: ALIYUN::ECS::Instance:ZoneId
    AssociationPropertyMetadata:
      ExclusiveTo:
        - VSwitch2ZoneId
      AutoSelectFirst: true
    Type: String
    Description:
      zh-cn: The ID of the zone where the vSwitch resides. For more information, see <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.
      en: VSwitch available area id, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.
    Label:
      zh-cn: VSwitch 1 Zone ID
      en: VSwitch 1 ZoneId
  VSwitch2CidrBlock:
    Default: 192.168.2.0/24
    Type: String
    Description:
      zh-cn: The CIDR block must be a subnet of the VPC CIDR block.
      en: Must belong to the subnet segment of VPC.
    Label:
      zh-cn: VSwitch 2 CIDR Block
      en: VSwitch 2 CIDR Block
  VSwitch1CidrBlock:
    Default: 192.168.1.0/24
    Type: String
    Description:
      zh-cn: The CIDR block must be a subnet of the VPC CIDR block.
      en: Must belong to the subnet segment of VPC.
    Label:
      zh-cn: VSwitch 1 CIDR Block
      en: VSwitch 1 CIDR Block
  VpcCidrBlock:
    Default: 192.168.0.0/16
    Type: String
    Description:
      zh-cn: 'The IP address range of the VPC in CIDR block format. <br>You can use the following IP address ranges and their subnets: <br><font color=''green''>[10.0.0.0/8]</font><br><font color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
      en: 'The ip address range of the VPC in the CidrBlock form; <br>You can use the following ip address ranges and their subnets: <br><font color=''green''>[10.0.0.0/8]</font><br><font color=''green''>[172.16.0.0/12]</font><br><font color=''green''>[192.168.0.0/16]</font>'
    Label:
      zh-cn: VPC CIDR Block
      en: VPC CIDR Block
  VSwitch2ZoneId:
    AssociationPropertyMetadata:
      ExclusiveTo:
        - VSwitch1ZoneId
      AutoSelectFirst: true
    Description:
      zh-cn: The ID of the zone where the vSwitch resides. The zone must be different from the zone of the other vSwitch. For more information, see <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.
      en: VSwitch available area id, VSwitch available area id, Different from the available area of another virtual switch; <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.
    Default: cn-hangzhou-h
    Label:
      zh-cn: VSwitch 2 Zone ID
      en: VSwitch 2 ZoneId
    AssociationProperty: ALIYUN::ECS::Instance:ZoneId
    Type: String
Outputs:
  VSwitch1Name:
    Description: Name of created VSwitch1.
    Value:
      Fn::GetAtt:
        - VSwitch1
        - VSwitchName
  VpcName:
    Description: Name of created VPC.
    Value:
      Fn::GetAtt:
        - Vpc
        - VpcName
  VSwitch2Name:
    Description: Name of created VSwitch2.
    Value:
      Fn::GetAtt:
        - VSwitch2
        - VSwitchName
Resources:
  VSwitch2:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VSwitchName:
        Fn::Join:
          - '-'
          - - VSwitch1
            - StackId
            - Ref: ALIYUN::StackId
      VpcId:
        Ref: Vpc
      CidrBlock:
        Ref: VSwitch2CidrBlock
      ZoneId:
        Ref: VSwitch2ZoneId
  VSwitch1:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VSwitchName:
        Fn::Join:
          - '-'
          - - VSwitch1
            - StackId
            - Ref: ALIYUN::StackId
      VpcId:
        Ref: Vpc
      CidrBlock:
        Ref: VSwitch1CidrBlock
      ZoneId:
        Ref: VSwitch1ZoneId
  Vpc:
    Type: ALIYUN::ECS::VPC
    Properties:
      VpcName:
        Fn::Join:
          - '-'
          - - StackId
            - Ref: ALIYUN::StackId
      CidrBlock:
        Ref: VpcCidrBlock
  SecurityGroup:
    Type: ALIYUN::ECS::SecurityGroup
    Properties:
      SecurityGroupIngress:
        - Priority: 1
          IpProtocol: all
          NicType: intranet
          SourceCidrIp: 0.0.0.0/0
          PortRange: '-1/-1'
      VpcId:
        Ref: Vpc
      SecurityGroupEgress:
        - Priority: 1
          IpProtocol: all
          DestCidrIp: 0.0.0.0/0
          NicType: intranet
          PortRange: '-1/-1'
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - VpcCidrBlock
          - VSwitch1ZoneId
          - VSwitch1CidrBlock
          - VSwitch2ZoneId
          - VSwitch2CidrBlock
        Label:
          default: Basic Network Configuration
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "Create a dual-zone VPC network with a security group, automatic subnet CIDR configuration, and support for custom IP ranges.",
    "en": "Create a dual-Availability Zone VPC network, inclusive of security groups, with automatic subnet CIDR configuration and support for custom IP ranges."
  },
  "Parameters": {
    "VSwitch1ZoneId": {
      "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
      "AssociationPropertyMetadata": {
        "ExclusiveTo": [
          "VSwitch2ZoneId"
        ],
        "AutoSelectFirst": true
      },
      "Type": "String",
      "Description": {
        "zh-cn": "The ID of the zone where the vSwitch resides. For more information, see <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.",
        "en": "VSwitch available area id, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>."
      },
      "Label": {
        "zh-cn": "VSwitch 1 Zone ID",
        "en": "VSwitch 1 ZoneId"
      }
    },
    "VSwitch2CidrBlock": {
      "Default": "192.168.2.0/24",
      "Type": "String",
      "Description": {
        "zh-cn": "The CIDR block must be a subnet of the VPC CIDR block.",
        "en": "Must belong to the subnet segment of VPC."
      },
      "Label": {
        "zh-cn": "VSwitch 2 CIDR Block",
        "en": "VSwitch 2 CIDR Block"
      }
    },
    "VSwitch1CidrBlock": {
      "Default": "192.168.1.0/24",
      "Type": "String",
      "Description": {
        "zh-cn": "The CIDR block must be a subnet of the VPC CIDR block.",
        "en": "Must belong to the subnet segment of VPC."
      },
      "Label": {
        "zh-cn": "VSwitch 1 CIDR Block",
        "en": "VSwitch 1 CIDR Block"
      }
    },
    "VpcCidrBlock": {
      "Default": "192.168.0.0/16",
      "Type": "String",
      "Description": {
        "zh-cn": "The IP address range of the VPC in CIDR block format. <br>You can use the following IP address ranges and their subnets: <br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>",
        "en": "The ip address range of the VPC in the CidrBlock form; <br>You can use the following ip address ranges and their subnets: <br><font color='green'>[10.0.0.0/8]</font><br><font color='green'>[172.16.0.0/12]</font><br><font color='green'>[192.168.0.0/16]</font>"
      },
      "Label": {
        "zh-cn": "VPC CIDR Block",
        "en": "VPC CIDR Block"
      }
    },
    "VSwitch2ZoneId": {
      "AssociationPropertyMetadata": {
        "ExclusiveTo": [
          "VSwitch1ZoneId"
        ],
        "AutoSelectFirst": true
      },
      "Description": {
        "zh-cn": "The ID of the zone where the vSwitch resides. The zone must be different from the zone of the other vSwitch. For more information, see <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>.",
        "en": "VSwitch available area id, VSwitch available area id, Different from the available area of another virtual switch; <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>View region and zone info</font></b></a>."
      },
      "Default": "cn-hangzhou-h",
      "Label": {
        "zh-cn": "VSwitch 2 Zone ID",
        "en": "VSwitch 2 ZoneId"
      },
      "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
      "Type": "String"
    }
  },
  "Outputs": {
    "VSwitch1Name": {
      "Description": "Name of created VSwitch1.",
      "Value": {
        "Fn::GetAtt": [
          "VSwitch1",
          "VSwitchName"
        ]
      }
    },
    "VpcName": {
      "Description": "Name of created VPC.",
      "Value": {
        "Fn::GetAtt": [
          "Vpc",
          "VpcName"
        ]
      }
    },
    "VSwitch2Name": {
      "Description": "Name of created VSwitch2.",
      "Value": {
        "Fn::GetAtt": [
          "VSwitch2",
          "VSwitchName"
        ]
      }
    }
  },
  "Resources": {
    "VSwitch2": {
      "Type": "ALIYUN::ECS::VSwitch",
      "Properties": {
        "VSwitchName": {
          "Fn::Join": [
            "-",
            [
              "VSwitch1",
              "StackId",
              {
                "Ref": "ALIYUN::StackId"
              }
            ]
          ]
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": {
          "Ref": "VSwitch2CidrBlock"
        },
        "ZoneId": {
          "Ref": "VSwitch2ZoneId"
        }
      }
    },
    "VSwitch1": {
      "Type": "ALIYUN::ECS::VSwitch",
      "Properties": {
        "VSwitchName": {
          "Fn::Join": [
            "-",
            [
              "VSwitch1",
              "StackId",
              {
                "Ref": "ALIYUN::StackId"
              }
            ]
          ]
        },
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": {
          "Ref": "VSwitch1CidrBlock"
        },
        "ZoneId": {
          "Ref": "VSwitch1ZoneId"
        }
      }
    },
    "Vpc": {
      "Type": "ALIYUN::ECS::VPC",
      "Properties": {
        "VpcName": {
          "Fn::Join": [
            "-",
            [
              "StackId",
              {
                "Ref": "ALIYUN::StackId"
              }
            ]
          ]
        },
        "CidrBlock": {
          "Ref": "VpcCidrBlock"
        }
      }
    },
    "SecurityGroup": {
      "Type": "ALIYUN::ECS::SecurityGroup",
      "Properties": {
        "SecurityGroupIngress": [
          {
            "Priority": 1,
            "IpProtocol": "all",
            "NicType": "intranet",
            "SourceCidrIp": "0.0.0.0/0",
            "PortRange": "-1/-1"
          }
        ],
        "VpcId": {
          "Ref": "Vpc"
        },
        "SecurityGroupEgress": [
          {
            "Priority": 1,
            "IpProtocol": "all",
            "DestCidrIp": "0.0.0.0/0",
            "NicType": "intranet",
            "PortRange": "-1/-1"
          }
        ]
      }
    }
  },
  "Metadata": {
    "ALIYUN::ROS::Interface": {
      "ParameterGroups": [
        {
          "Parameters": [
            "VpcCidrBlock",
            "VSwitch1ZoneId",
            "VSwitch1CidrBlock",
            "VSwitch2ZoneId",
            "VSwitch2CidrBlock"
          ],
          "Label": {
            "default": "Basic Network Configuration"
          }
        }
      ]
    }
  }
}

Cenário 3: Crie uma instância RDS de alta disponibilidade com suporte a implantação multizona e múltiplos vSwitches.

Criação rápida

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: Create an RDS instance supporting multi-zone high availability.
  en: Create an RDS instance supporting multi-zone high availability.
Parameters:
  ZoneId1:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    AssociationPropertyMetadata:
      ExclusiveTo:
        - ZoneId2
    Label:
      en: Primary Availability Zone
      zh-cn: Primary Availability Zone
  ZoneId2:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    AssociationPropertyMetadata:
      ExclusiveTo:
        - ZoneId1
    Label:
      en: Standby Availability Zone
      zh-cn: Standby Availability Zone
  DBInstanceClass:
    Type: String
    Label:
      en: Instance Class
      zh-cn: Instance Class
    AssociationProperty: ALIYUN::RDS::Instance::InstanceType
    AssociationPropertyMetadata:
      ZoneId: ${ZoneId1}
      EngineVersion: '8.0'
      Engine: MySQL
      Category: HighAvailability
      InstanceChargeType: PostPaid
      DBInstanceStorageType: cloud_essd
      CommodityCode: bards
    Default: mysql.n2.medium.2c
  DBUserName:
    Type: String
    Label:
      en: Database Account
      zh-cn: Database Account
    Description:
      en: The value can contain a maximum of 32 letters, including lowercase letters, uppercase letters, digits, and underscores (_). It must start with a letter and end with a letter or digit.
      zh-cn: The value can contain a maximum of 32 letters, including lowercase letters, uppercase letters, digits, and underscores (_). It must start with a letter and end with a letter or digit.
    Default: testuser
  DBPassword:
    Type: String
    Label:
      en: Password
      zh-cn: Password
    Description:
      en: 'The password must be 8 to 32 characters in length and must contain at least three of the following types: uppercase letters, lowercase letter, digits, and special characters. Special characters include <span style="background:#E7E9EB;"><b>!@#$%^&*()_+-=</b></span>'
      zh-cn: 'The password must be 8 to 32 characters in length and must contain at least three of the following types: uppercase letters, lowercase letter, digits, and special characters. Special characters include <span style="background:#E7E9EB;"><b>!@#$%^&*()_+-=</b></span>'
    AssociationProperty: ALIYUN::RDS::Instance::AccountPassword
    NoEcho: true
Resources:
  Vpc:
    Type: ALIYUN::ECS::VPC
    Properties:
      CidrBlock: 192.168.0.0/16
      VpcName: rds-database-agent-vpc
  VSwitch1:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VpcId:
        Ref: Vpc
      CidrBlock: 192.168.1.0/24
      ZoneId:
        Ref: ZoneId1
      VSwitchName: rds-database-vsw-001
  VSwitch2:
    Type: ALIYUN::ECS::VSwitch
    Properties:
      VpcId:
        Ref: Vpc
      CidrBlock: 192.168.2.0/24
      ZoneId:
        Ref: ZoneId2
      VSwitchName: rds-database-vsw-002
  Database:
    Type: ALIYUN::RDS::DBInstance
    Properties:
      DBInstanceClass:
        Ref: DBInstanceClass
      ZoneId:
        Ref: ZoneId1
      SlaveZoneIds:
        - Ref: ZoneId2
      DBInstanceStorage: 20
      Category: HighAvailability
      DBInstanceStorageType: cloud_essd
      VSwitchId:
        Fn::Join:
          - ','
          - - Ref: VSwitch1
            - Ref: VSwitch2
      Engine: MySQL
      PayType: Postpaid
      VpcId:
        Ref: Vpc
      EngineVersion: '8.0'
      SecurityIPList: 192.168.0.0/16
      MasterUsername:
        Ref: DBUserName
      MasterUserPassword:
        Ref: DBPassword
      MasterUserType: Normal
Outputs: {}
Metadata:
  ALIYUN::ROS::Interface:
    ParameterGroups:
      - Parameters:
          - ZoneId1
          - ZoneId2
          - DBInstanceClass
          - DBUserName
          - DBPassword
        Label:
          default:
            en: RDS Configuration
            zh-cn: RDS Configuration
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "Create an RDS instance supporting multi-zone high availability.",
    "en": "Create an RDS instance supporting multi-zone high availability."
  },
  "Parameters": {
    "ZoneId1": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "AssociationPropertyMetadata": {
        "ExclusiveTo": [
          "ZoneId2"
        ]
      },
      "Label": {
        "en": "Primary Availability Zone",
        "zh-cn": "Primary Availability Zone"
      }
    },
    "ZoneId2": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "AssociationPropertyMetadata": {
        "ExclusiveTo": [
          "ZoneId1"
        ]
      },
      "Label": {
        "en": "Standby Availability Zone",
        "zh-cn": "Standby Availability Zone"
      }
    },
    "DBInstanceClass": {
      "Type": "String",
      "Label": {
        "en": "Instance Class",
        "zh-cn": "Instance Class"
      },
      "AssociationProperty": "ALIYUN::RDS::Instance::InstanceType",
      "AssociationPropertyMetadata": {
        "ZoneId": "${ZoneId1}",
        "EngineVersion": "8.0",
        "Engine": "MySQL",
        "Category": "HighAvailability",
        "InstanceChargeType": "PostPaid",
        "DBInstanceStorageType": "cloud_essd",
        "CommodityCode": "bards"
      },
      "Default": "mysql.n2.medium.2c"
    },
    "DBUserName": {
      "Type": "String",
      "Label": {
        "en": "Database Account",
        "zh-cn": "Database Account"
      },
      "Description": {
        "en": "The value can contain a maximum of 32 letters, including lowercase letters, uppercase letters, digits, and underscores (_). It must start with a letter and end with a letter or digit.",
        "zh-cn": "The value can contain a maximum of 32 letters, including lowercase letters, uppercase letters, digits, and underscores (_). It must start with a letter and end with a letter or digit."
      },
      "Default": "testuser"
    },
    "DBPassword": {
      "Type": "String",
      "Label": {
        "en": "Password",
        "zh-cn": "Password"
      },
      "Description": {
        "en": "The password must be 8 to 32 characters in length and must contain at least three of the following types: uppercase letters, lowercase letter, digits, and special characters. Special characters include <span style=\"background:#E7E9EB;\"><b>!@#$%^&*()_+-=</b></span>",
        "zh-cn": "The password must be 8 to 32 characters in length and must contain at least three of the following types: uppercase letters, lowercase letter, digits, and special characters. Special characters include <span style=\"background:#E7E9EB;\"><b>!@#$%^&*()_+-=</b></span>"
      },
      "AssociationProperty": "ALIYUN::RDS::Instance::AccountPassword",
      "NoEcho": true
    }
  },
  "Resources": {
    "Vpc": {
      "Type": "ALIYUN::ECS::VPC",
      "Properties": {
        "CidrBlock": "192.168.0.0/16",
        "VpcName": "rds-database-agent-vpc"
      }
    },
    "VSwitch1": {
      "Type": "ALIYUN::ECS::VSwitch",
      "Properties": {
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": "192.168.1.0/24",
        "ZoneId": {
          "Ref": "ZoneId1"
        },
        "VSwitchName": "rds-database-vsw-001"
      }
    },
    "VSwitch2": {
      "Type": "ALIYUN::ECS::VSwitch",
      "Properties": {
        "VpcId": {
          "Ref": "Vpc"
        },
        "CidrBlock": "192.168.2.0/24",
        "ZoneId": {
          "Ref": "ZoneId2"
        },
        "VSwitchName": "rds-database-vsw-002"
      }
    },
    "Database": {
      "Type": "ALIYUN::RDS::DBInstance",
      "Properties": {
        "DBInstanceClass": {
          "Ref": "DBInstanceClass"
        },
        "ZoneId": {
          "Ref": "ZoneId1"
        },
        "SlaveZoneIds": [
          {
            "Ref": "ZoneId2"
          }
        ],
        "DBInstanceStorage": 20,
        "Category": "HighAvailability",
        "DBInstanceStorageType": "cloud_essd",
        "VSwitchId": {
          "Fn::Join": [
            ",",
            [
              {
                "Ref": "VSwitch1"
              },
              {
                "Ref": "VSwitch2"
              }
            ]
          ]
        },
        "Engine": "MySQL",
        "PayType": "Postpaid",
        "VpcId": {
          "Ref": "Vpc"
        },
        "EngineVersion": "8.0",
        "SecurityIPList": "192.168.0.0/16",
        "MasterUsername": {
          "Ref": "DBUserName"
        },
        "MasterUserPassword": {
          "Ref": "DBPassword"
        },
        "MasterUserType": "Normal"
      }
    }
  },
  "Outputs": {
  },
  "Metadata": {
    "ALIYUN::ROS::Interface": {
      "ParameterGroups": [
        {
          "Parameters": [
            "ZoneId1",
            "ZoneId2",
            "DBInstanceClass",
            "DBUserName",
            "DBPassword"
          ],
          "Label": {
            "default": {
              "en": "RDS Configuration",
              "zh-cn": "RDS Configuration"
            }
          }
        }
      ]
    }
  }
}

Para mais exemplos, consulte modelos públicos que incluem este recurso.