All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::VSwitch

Last Updated:Sep 08, 2026

ALIYUN::ECS::VSwitch digunakan untuk membuat vSwitch.

Sintaks

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

Properti

Properti

Tipe

Wajib

Dapat Diedit

Deskripsi

Batasan

VpcId

String

Ya

Tidak

ID VPC tempat vSwitch dibuat.

Tidak ada

ZoneId

String

Ya

Tidak

ID zona.

Tidak ada

VSwitchName

String

Tidak

Ya

Nama vSwitch.

Nama harus terdiri dari 2 hingga 128 karakter. Nama harus dimulai dengan huruf atau karakter Tionghoa. Nama tidak boleh dimulai dengan http:// atau https://. Nama dapat berisi huruf, karakter Tionghoa, angka, garis bawah (_), dan tanda hubung (-).

CidrBlock

String

Ya

Tidak

Blok CIDR untuk vSwitch.

Blok CIDR harus merupakan subnet dari VPC dan tidak boleh digunakan oleh vSwitch lain.

Description

String

Tidak

Ya

Deskripsi vSwitch.

Deskripsi harus terdiri dari 2 hingga 256 karakter. Deskripsi tidak boleh dimulai dengan http:// atau https://.

Ipv6CidrBlock

Integer

Tidak

Tidak

Blok CIDR IPv6 untuk vSwitch.

Nilai valid: 0 hingga 255. Nilainya adalah bilangan bulat desimal.

Secara default, masker blok CIDR IPv6 vSwitch memiliki panjang 64 bit.

Anda dapat menyesuaikan 8 bit terakhir dari blok CIDR IPv6 VPC.

Tags

List

Tidak

Ya

Tag vSwitch.

Anda dapat menambahkan hingga 20 tag.

Untuk informasi selengkapnya, lihat properti Tags.

VpcIpv6CidrBlock

String

Tidak

Tidak

Blok CIDR IPv6 untuk VPC.

Tidak ada

ZoneType

String

Tidak

Tidak

Jenis zona yang akan dikueri.

Nilai default: AvailabilityZone.

Sintaks Tags

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

Properti Tags

Properti

Tipe

Wajib

Dapat Diedit

Deskripsi

Batasan

Key

String

Ya

Tidak

Kunci tag.

Kunci harus terdiri dari 1 hingga 128 karakter. Kunci tidak boleh dimulai dengan aliyun atau acs:. Kunci tidak boleh berisi http:// atau https://.

Value

String

Tidak

Tidak

Nilai tag.

Nilai dapat terdiri dari 0 hingga 128 karakter. Nilai tidak boleh dimulai dengan aliyun atau acs:. Nilai tidak boleh berisi http:// atau https://.

Nilai kembalian

Fn::GetAtt

  • CidrBlock: Blok CIDR IPv4 dari vSwitch.

  • Ipv6CidrBlock: Blok CIDR IPv6 dari vSwitch.

  • VSwitchId: ID vSwitch.

  • VSwitchName: Nama vSwitch.

Contoh

Skenario 1: Buat VPC dan vSwitch.

Buat cepat

Outputs:
  VSwitch1Name:
    Description: Nama VSwitch yang dibuat.
    Value:
      Fn::GetAtt:
        - VSwitch
        - VSwitchName
  VpcName:
    Description: Nama VPC yang dibuat.
    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'><font color='blue'>View region and zone info</font></a>.
      en: ID zona VSwitch yang tersedia, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>Lihat info wilayah dan zona</font></a>.
    Label:
      zh-cn: VSwitch 1 Zone ID
      en: ZoneId VSwitch 1
  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: 'Rentang alamat IP VPC dalam format Blok CIDR; <br>Anda dapat menggunakan rentang alamat IP berikut dan subnetnya: <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: Blok CIDR VPC
  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: Harus termasuk dalam segmen subnet VPC.
    Label:
      zh-cn: VSwitch 1 CIDR Block
      en: Blok CIDR VSwitch 1
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: Konfigurasi Jaringan Dasar
{
  "Outputs": {
    "VSwitch1Name": {
      "Description": "Nama VSwitch yang dibuat.",
      "Value": {
        "Fn::GetAtt": [
          "VSwitch",
          "VSwitchName"
        ]
      }
    },
    "VpcName": {
      "Description": "Nama VPC yang dibuat.",
      "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'><font color='blue'>View region and zone info</font></a>.",
        "en": "ID zona yang tersedia untuk VSwitch, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>Lihat info wilayah dan zona</font></a>."
      },
      "Label": {
        "zh-cn": "VSwitch 1 Zone ID",
        "en": "ID Zona VSwitch 1"
      }
    },
    "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": "Rentang alamat IP dari VPC dalam format Blok CIDR. <br>Anda dapat menggunakan rentang alamat IP berikut dan subnetnya: <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": "Blok CIDR VPC"
      }
    },
    "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": "Harus termasuk dalam segmen subnet VPC."
      },
      "Label": {
        "zh-cn": "VSwitch 1 CIDR Block",
        "en": "Blok CIDR VSwitch 1"
      }
    }
  },
  "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": "Konfigurasi Jaringan Dasar"
          }
        }
      ]
    }
  }
}

Skenario 2: Buat VPC dua zona dan vSwitch.

Buat cepat

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: Buat jaringan VPC Zona Ketersediaan ganda, termasuk grup keamanan, dengan konfigurasi CIDR subnet otomatis dan dukungan untuk rentang IP kustom.
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'><font color='blue'>View region and zone info</font></a>.
      en: ID zona yang tersedia untuk VSwitch, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>Lihat info wilayah dan zona</font></a>.
    Label:
      zh-cn: VSwitch 1 Zone ID
      en: ZoneId VSwitch 1
  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: Harus merupakan subnet dari Blok CIDR VPC.
    Label:
      zh-cn: VSwitch 2 CIDR Block
      en: Blok CIDR VSwitch 2
  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: Harus merupakan subnet dari Blok CIDR VPC.
    Label:
      zh-cn: VSwitch 1 CIDR Block
      en: Blok CIDR VSwitch 1
  VpcCidrBlock:
    Default: 192.168.0.0/16
    Type: String
    Description:
      zh-cn: 'The IP address range of the VPC in CIDR block format. 
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: 'Rentang alamat IP dari VPC dalam format Blok CIDR; <br>Anda dapat menggunakan rentang alamat IP berikut dan subnetnya: <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: Blok CIDR VPC 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></a>. en: ID zona yang tersedia untuk VSwitch, harus berbeda dari zona vSwitch lainnya; <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>Lihat info wilayah dan zona</font></a>. Default: cn-hangzhou-h Label: zh-cn: VSwitch 2 Zone ID en: ZoneId VSwitch 2 AssociationProperty: ALIYUN::ECS::Instance:ZoneId Type: String Outputs: VSwitch1Name: Description: Nama dari VSwitch1 yang dibuat. Value: Fn::GetAtt: - VSwitch1 - VSwitchName VpcName: Description: Nama dari VPC yang dibuat. Value: Fn::GetAtt: - Vpc - VpcName VSwitch2Name: Description: Nama dari VSwitch2 yang dibuat. 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: Konfigurasi Jaringan Dasar
{
  "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": "Buat jaringan VPC zona-ganda, termasuk grup keamanan, dengan konfigurasi CIDR subnet otomatis dan dukungan untuk rentang IP kustom."
  },
  "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'><font color='blue'>View region and zone info</font></a>.",
        "en": "ID zona vSwitch yang tersedia, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>Lihat info wilayah dan zona</font></a>."
      },
      "Label": {
        "zh-cn": "VSwitch 1 Zone ID",
        "en": "ID Zona VSwitch 1"
      }
    },
    "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": "Harus merupakan bagian dari segmen subnet VPC."
      },
      "Label": {
        "zh-cn": "VSwitch 2 CIDR Block",
        "en": "Blok CIDR VSwitch 2"
      }
    },
    "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": "Harus merupakan bagian dari segmen subnet VPC."
      },
      "Label": {
        "zh-cn": "VSwitch 1 CIDR Block",
        "en": "Blok CIDR VSwitch 1"
      }
    },
    "VpcCidrBlock": {
      "Default": "192.168.0.0/16",
      "Type": "String",
      "Description": {
        "zh-cn": "The IP address range of the VPC in CIDR block format. 
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": "Rentang alamat IP dari VPC dalam format Blok CIDR; <br>Anda dapat menggunakan rentang alamat IP dan subnet berikut: <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": "Blok CIDR VPC" } }, "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></a>.", "en": "ID zona vSwitch yang tersedia, berbeda dari zona yang tersedia dari vSwitch lain; <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>Lihat info wilayah dan zona</font></a>." }, "Default": "cn-hangzhou-h", "Label": { "zh-cn": "VSwitch 2 Zone ID", "en": "ID Zona VSwitch 2" }, "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId", "Type": "String" } }, "Outputs": { "VSwitch1Name": { "Description": "Nama VSwitch1 yang dibuat.", "Value": { "Fn::GetAtt": [ "VSwitch1", "VSwitchName" ] } }, "VpcName": { "Description": "Nama VPC yang dibuat.", "Value": { "Fn::GetAtt": [ "Vpc", "VpcName" ] } }, "VSwitch2Name": { "Description": "Nama VSwitch2 yang dibuat.", "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": "Konfigurasi Jaringan Dasar" } } ] } } }

Skenario 3: Buat instans RDS ketersediaan tinggi yang mendukung penerapan multi-zona dan beberapa vSwitch.

Buat cepat

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: Create an RDS instance supporting multi-zone high availability.
  en: Buat instans RDS yang mendukung ketersediaan tinggi multi-zona.
Parameters:
  ZoneId1:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    AssociationPropertyMetadata:
      ExclusiveTo:
        - ZoneId2
    Label:
      en: Zona Ketersediaan Utama
      zh-cn: Primary Availability Zone
  ZoneId2:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    AssociationPropertyMetadata:
      ExclusiveTo:
        - ZoneId1
    Label:
      en: Zona Ketersediaan Siaga
      zh-cn: Standby Availability Zone
  DBInstanceClass:
    Type: String
    Label:
      en: Kelas Instans
      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: Akun Database
      zh-cn: Database Account
    Description:
      en: Nilai dapat berisi maksimal 32 huruf, termasuk huruf kecil, huruf besar, angka, dan garis bawah (_). Harus diawali dengan huruf dan diakhiri dengan huruf atau angka.
      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: Kata Sandi
      zh-cn: Password
    Description:
      en: 'Panjang kata sandi harus 8 hingga 32 karakter dan harus berisi setidaknya tiga dari jenis berikut: huruf besar, huruf kecil, angka, dan karakter khusus. Karakter khusus meliputi !@#$%^&*()_+-='
      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 !@#$%^&*()_+-='
    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: Konfigurasi RDS
            zh-cn: RDS Configuration
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "Create an RDS instance supporting multi-zone high availability.",
    "en": "Buat instans RDS yang mendukung ketersediaan tinggi multi-zona."
  },
  "Parameters": {
    "ZoneId1": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "AssociationPropertyMetadata": {
        "ExclusiveTo": [
          "ZoneId2"
        ]
      },
      "Label": {
        "en": "Zona Ketersediaan Utama",
        "zh-cn": "Primary Availability Zone"
      }
    },
    "ZoneId2": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "AssociationPropertyMetadata": {
        "ExclusiveTo": [
          "ZoneId1"
        ]
      },
      "Label": {
        "en": "Zona Ketersediaan Siaga",
        "zh-cn": "Standby Availability Zone"
      }
    },
    "DBInstanceClass": {
      "Type": "String",
      "Label": {
        "en": "Kelas Instans",
        "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": "Akun Database",
        "zh-cn": "Database Account"
      },
      "Description": {
        "en": "Nilai dapat berisi maksimal 32 huruf, termasuk huruf kecil, huruf besar, angka, dan garis bawah (_). Harus diawali dengan huruf dan diakhiri dengan huruf atau angka.",
        "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": "Kata Sandi",
        "zh-cn": "Password"
      },
      "Description": {
        "en": "Kata sandi harus memiliki panjang 8 hingga 32 karakter dan harus berisi setidaknya tiga dari jenis berikut: huruf besar, huruf kecil, angka, dan karakter khusus. Karakter khusus meliputi !@#$%^&*()_+-=",
        "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 !@#$%^&*()_+-="
      },
      "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": "Konfigurasi RDS",
              "zh-cn": "RDS Configuration"
            }
          }
        }
      ]
    }
  }
}

Untuk contoh lainnya, lihat templat publik yang menyertakan resource ini.