すべてのプロダクト
Search
ドキュメントセンター

Resource Orchestration Service:ALIYUN::ECS::VSwitch

最終更新日:Feb 07, 2026

ALIYUN::ECS::VSwitch リソースは vSwitch を作成します。

構文

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

プロパティ

プロパティ名

タイプ

必須

更新の許可

説明

制約

VpcId

String

はい

いいえ

vSwitch を作成する VPC の ID。

なし

ZoneId

String

はい

いいえ

ゾーンの ID。

なし

VSwitchName

String

いいえ

はい

vSwitch の名前。

名前は 2~128 文字の長さである必要があります。先頭文字には英字または漢字を指定する必要があります。先頭に http:// または https:// を指定することはできません。使用できる文字は、英字、漢字、数字、アンダースコア (_ )、およびハイフン (- ) です。

CidrBlock

String

はい

いいえ

vSwitch の CIDR ブロック。

CIDR ブロックは VPC のサブネットである必要があり、他の vSwitch で使用することはできません。

Description

String

いいえ

はい

vSwitch の説明。

説明は 2~256 文字で、http:// または https:// で始めることはできません。

Ipv6CidrBlock

Integer

いいえ

いいえ

vSwitch の IPv6 CIDR ブロック。

有効値:0~255。値は 10 進数の整数です。

デフォルトでは、vSwitch の IPv6 CIDR ブロックのマスク長は 64 ビットです。

VPC IPv6 CIDR ブロックの最後の 8 ビットをカスタマイズできます。

Tags

List

いいえ

はい

タグ。

最大 20 個のタグを追加できます。

詳細については、「タグのプロパティ」をご参照ください。

VpcIpv6CidrBlock

String

いいえ

いいえ

VPC の IPv6 CIDR ブロック。

なし

ZoneType

String

いいえ

いいえ

クエリするゾーンのタイプ。

デフォルト値:AvailabilityZone

タグの構文

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

タグのプロパティ

プロパティ名

タイプ

必須

更新の許可

説明

制約

Key

String

はい

いいえ

タグキー。

キーの長さは 1~128 文字である必要があります。「aliyun」または「acs:」で始まることはできません。「http://」または「https://」を含むことはできません。

Value

String

いいえ

いいえ

タグ値。

値の長さは 0~128 文字にすることができます。aliyun または acs: で始まることはできません。http:// または https:// を含むことはできません。

戻り値

Fn::GetAtt

  • CidrBlock:vSwitch の IPv4 CIDR ブロック。

  • Ipv6CidrBlock:vSwitch の IPv6 CIDR ブロック。

  • VSwitchId:vSwitch の ID。

  • VSwitchName:vSwitch の名前。

シナリオ 1:VPC と vSwitch の作成

クイック作成

Outputs:
  VSwitch1Name:
    Description: 作成された vSwitch の名前。
    Value:
      Fn::GetAtt:
        - VSwitch
        - VSwitchName
  VpcName:
    Description: 作成された 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 for the vSwitch, </font><a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'>View region and zone info<font color='blue'></a>.
      en: vSwitch の利用可能なエリア ID、<a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>リージョンとゾーンの情報を表示</font></a>。
    Label:
      zh-cn: VSwitch 1 ZoneId
      en: vSwitch 1 ゾーン ID
  VpcCidrBlock:
    Default: 192.168.0.0/16
    Type: String
    Description:
      zh-cn: 'The CIDR block for the VPC.<br>You can use the following CIDR blocks 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: 'CidrBlock 形式の VPC の IP アドレス範囲。<br>次の IP アドレス範囲とそのサブネットを使用できます:<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 ブロック
  VSwitchCidrBlock:
    Default: 192.168.1.0/24
    Type: String
    Description:
      zh-cn: Must be a subnet of the VPC.
      en: VPC のサブネットセグメントに属している必要があります。
    Label:
      zh-cn: VSwitch 1 CIDR Block
      en: vSwitch 1 CIDR ブロック
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: 基本的なネットワーク構成
{
  "Outputs": {
    "VSwitch1Name": {
      "Description": "作成された vSwitch の名前。",
      "Value": {
        "Fn::GetAtt": [
          "VSwitch",
          "VSwitchName"
        ]
      }
    },
    "VpcName": {
      "Description": "作成された VPC の名前。",
      "Value": {
        "Fn::GetAtt": [
          "Vpc",
          "VpcName"
        ]
      }
    }
  },
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "ZoneId": {
      "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
      "Type": "String",
      "Description": {
        "zh-cn": "VSwitch zone ID, </font><a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'> View zone information<font color='blue'></a>.",
        "en": "vSwitch の利用可能なエリア ID、<a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>リージョンとゾーンの情報を表示</font></a>。"
      },
      "Label": {
        "zh-cn": "VSwitch 1 Zone ID",
        "en": "vSwitch 1 ゾーン ID"
      }
    },
    "VpcCidrBlock": {
      "Default": "192.168.0.0/16",
      "Type": "String",
      "Description": {
        "zh-cn": "The IP address range of the VPC, <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": "CidrBlock 形式の VPC の IP アドレス範囲。<br>次の IP アドレス範囲とそのサブネットを使用できます:<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 ブロック"
      }
    },
    "VSwitchCidrBlock": {
      "Default": "192.168.1.0/24",
      "Type": "String",
      "Description": {
        "zh-cn": "Must belong to a subnet of the VPC.",
        "en": "VPC のサブネットセグメントに属している必要があります。"
      },
      "Label": {
        "zh-cn": "VSwitch 1 CIDR Block",
        "en": "vSwitch 1 CIDR ブロック"
      }
    }
  },
  "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": "基本的なネットワーク構成"
          }
        }
      ]
    }
  }
}

シナリオ 2:デュアルゾーン VPC と vSwitch の作成

クイック作成

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: 创建双可用区VPC网络,含安全组,自动配置子网CIDR,支持自定义IP范围。
  en: セキュリティグループを含み、サブネット CIDR の自動構成とカスタム IP 範囲をサポートするデュアルゾーン VPC ネットワークを作成します。
Parameters:
  VSwitch1ZoneId:
    AssociationProperty: ALIYUN::ECS::Instance:ZoneId
    AssociationPropertyMetadata:
      ExclusiveTo:
        - VSwitch2ZoneId
      AutoSelectFirst: true
    Type: String
    Description:
      zh-cn: VSwitch可用区id,</font><a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'> 查看可用区信息<font color='blue'></a>。
      en: vSwitch ゾーン ID、<a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>リージョンとゾーンの情報を表示</font></a>。
    Label:
      zh-cn: 交换机1可用区ID
      en: vSwitch 1 ゾーン ID
  VSwitch2CidrBlock:
    Default: 192.168.2.0/24
    Type: String
    Description:
      zh-cn: 必须属于VPC的子网段。
      en: VPC のサブネットセグメントである必要があります。
    Label:
      zh-cn: 交换机2子网网段
      en: vSwitch 2 CIDR ブロック
  VSwitch1CidrBlock:
    Default: 192.168.1.0/24
    Type: String
    Description:
      zh-cn: 必须属于VPC的子网段。
      en: VPC のサブネットセグメントである必要があります。
    Label:
      zh-cn: 交换机1子网网段
      en: vSwitch 1 CIDR ブロック
  VpcCidrBlock:
    Default: 192.168.0.0/16
    Type: String
    Description:
      zh-cn: VPCのip地址段范围,
您可以使用以下的ip地址段或其子网:<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> <br/> en: CIDR ブロック形式の VPC の IP アドレス範囲。次の IP アドレス範囲とそのサブネットを使用できます:<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> <br/> Label: <br/> zh-cn: 专有网络网段 <br/> en: VPC CIDR ブロック <br/> VSwitch2ZoneId: <br/> AssociationPropertyMetadata: <br/> ExclusiveTo: <br/> - VSwitch1ZoneId <br/> AutoSelectFirst: true <br/> Description: <br/> zh-cn: VSwitch可用区id,不同其他虚拟交换机的可用区Id;</font><a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b> 查看可用区信息<font color='blue'></a>。 <br/> en: vSwitch ゾーン ID、他の vSwitch のゾーン ID とは異なります。<a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>リージョンとゾーンの情報を表示</font></a>。 <br/> Default: cn-hangzhou-h <br/> Label: <br/> zh-cn: 交换机2可用区ID <br/> en: vSwitch 2 ゾーン ID <br/> AssociationProperty: ALIYUN::ECS::Instance:ZoneId <br/> Type: String <br/>Outputs: <br/> VSwitch1Name: <br/> Description: 作成された VSwitch1 の名前。 <br/> Value: <br/> Fn::GetAtt: <br/> - VSwitch1 <br/> - VSwitchName <br/> VpcName: <br/> Description: 作成された VPC の名前。 <br/> Value: <br/> Fn::GetAtt: <br/> - Vpc <br/> - VpcName <br/> VSwitch2Name: <br/> Description: 作成された VSwitch2 の名前。 <br/> Value: <br/> Fn::GetAtt: <br/> - VSwitch2 <br/> - VSwitchName <br/>Resources: <br/> VSwitch2: <br/> Type: ALIYUN::ECS::VSwitch <br/> Properties: <br/> VSwitchName: <br/> Fn::Join: <br/> - '-' <br/> - - VSwitch1 <br/> - StackId <br/> - Ref: ALIYUN::StackId <br/> VpcId: <br/> Ref: Vpc <br/> CidrBlock: <br/> Ref: VSwitch2CidrBlock <br/> ZoneId: <br/> Ref: VSwitch2ZoneId <br/> VSwitch1: <br/> Type: ALIYUN::ECS::VSwitch <br/> Properties: <br/> VSwitchName: <br/> Fn::Join: <br/> - '-' <br/> - - VSwitch1 <br/> - StackId <br/> - Ref: ALIYUN::StackId <br/> VpcId: <br/> Ref: Vpc <br/> CidrBlock: <br/> Ref: VSwitch1CidrBlock <br/> ZoneId: <br/> Ref: VSwitch1ZoneId <br/> Vpc: <br/> Type: ALIYUN::ECS::VPC <br/> Properties: <br/> VpcName: <br/> Fn::Join: <br/> - '-' <br/> - - StackId <br/> - Ref: ALIYUN::StackId <br/> CidrBlock: <br/> Ref: VpcCidrBlock <br/> SecurityGroup: <br/> Type: ALIYUN::ECS::SecurityGroup <br/> Properties: <br/> SecurityGroupIngress: <br/> - Priority: 1 <br/> IpProtocol: all <br/> NicType: intranet <br/> SourceCidrIp: 0.0.0.0/0 <br/> PortRange: '-1/-1' <br/> VpcId: <br/> Ref: Vpc <br/> SecurityGroupEgress: <br/> - Priority: 1 <br/> IpProtocol: all <br/> DestCidrIp: 0.0.0.0/0 <br/> NicType: intranet <br/> PortRange: '-1/-1' <br/>Metadata: <br/> ALIYUN::ROS::Interface: <br/> ParameterGroups: <br/> - Parameters: <br/> - VpcCidrBlock <br/> - VSwitch1ZoneId <br/> - VSwitch1CidrBlock <br/> - VSwitch2ZoneId <br/> - VSwitch2CidrBlock <br/> Label: <br/> default: 基本的なネットワーク構成 <br/>
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建双可用区VPC网络,含安全组,自动配置子网CIDR,支持自定义IP范围。",
    "en": "セキュリティグループを含み、サブネット CIDR の自動構成とカスタム IP 範囲をサポートするデュアルアベイラビリティゾーン VPC ネットワークを作成します。"
  },
  "Parameters": {
    "VSwitch1ZoneId": {
      "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
      "AssociationPropertyMetadata": {
        "ExclusiveTo": [
          "VSwitch2ZoneId"
        ],
        "AutoSelectFirst": true
      },
      "Type": "String",
      "Description": {
        "zh-cn": "VSwitch可用区id,</font><a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'> 查看可用区信息<font color='blue'></a>。",
        "en": "vSwitch ゾーン ID、<a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>リージョンとゾーンの情報を表示</font></a>。"
      },
      "Label": {
        "zh-cn": "交换机1可用区ID",
        "en": "vSwitch 1 ゾーン ID"
      }
    },
    "VSwitch2CidrBlock": {
      "Default": "192.168.2.0/24",
      "Type": "String",
      "Description": {
        "zh-cn": "必须属于VPC的子网段。",
        "en": "VPC のサブネットセグメントに属している必要があります。"
      },
      "Label": {
        "zh-cn": "交换机2子网网段",
        "en": "vSwitch 2 CIDR ブロック"
      }
    },
    "VSwitch1CidrBlock": {
      "Default": "192.168.1.0/24",
      "Type": "String",
      "Description": {
        "zh-cn": "必须属于VPC的子网段。",
        "en": "VPC のサブネットセグメントに属している必要があります。"
      },
      "Label": {
        "zh-cn": "交换机1子网网段",
        "en": "vSwitch 1 CIDR ブロック"
      }
    },
    "VpcCidrBlock": {
      "Default": "192.168.0.0/16",
      "Type": "String",
      "Description": {
        "zh-cn": "VPCのip地址段范围,
您可以使用以下的ip地址段或其子网:<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>", <br/> "en": "CIDR ブロック形式の VPC の IP アドレス範囲。<br>次の IP アドレス範囲とそのサブネットを使用できます:<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>" <br/> }, <br/> "Label": { <br/> "zh-cn": "专有网络网段", <br/> "en": "VPC CIDR ブロック" <br/> } <br/> }, <br/> "VSwitch2ZoneId": { <br/> "AssociationPropertyMetadata": { <br/> "ExclusiveTo": [ <br/> "VSwitch1ZoneId" <br/> ], <br/> "AutoSelectFirst": true <br/> }, <br/> "Description": { <br/> "zh-cn": "VSwitch可用区id,不同其他虚拟交换机的可用区Id;</font><a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b> 查看可用区信息<font color='blue'></a>。", <br/> "en": "vSwitch ゾーン ID、他の仮想スイッチのゾーン ID とは異なります。<a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>リージョンとゾーンの情報を表示</font></a>。" <br/> }, <br/> "Default": "cn-hangzhou-h", <br/> "Label": { <br/> "zh-cn": "交换机2可用区ID", <br/> "en": "vSwitch 2 ゾーン ID" <br/> }, <br/> "AssociationProperty": "ALIYUN::ECS::Instance:ZoneId", <br/> "Type": "String" <br/> } <br/> }, <br/> "Outputs": { <br/> "VSwitch1Name": { <br/> "Description": "作成された VSwitch1 の名前。", <br/> "Value": { <br/> "Fn::GetAtt": [ <br/> "VSwitch1", <br/> "VSwitchName" <br/> ] <br/> } <br/> }, <br/> "VpcName": { <br/> "Description": "作成された VPC の名前。", <br/> "Value": { <br/> "Fn::GetAtt": [ <br/> "Vpc", <br/> "VpcName" <br/> ] <br/> } <br/> }, <br/> "VSwitch2Name": { <br/> "Description": "作成された VSwitch2 の名前。", <br/> "Value": { <br/> "Fn::GetAtt": [ <br/> "VSwitch2", <br/> "VSwitchName" <br/> ] <br/> } <br/> } <br/> }, <br/> "Resources": { <br/> "VSwitch2": { <br/> "Type": "ALIYUN::ECS::VSwitch", <br/> "Properties": { <br/> "VSwitchName": { <br/> "Fn::Join": [ <br/> "-", <br/> [ <br/> "VSwitch1", <br/> "StackId", <br/> { <br/> "Ref": "ALIYUN::StackId" <br/> } <br/> ] <br/> ] <br/> }, <br/> "VpcId": { <br/> "Ref": "Vpc" <br/> }, <br/> "CidrBlock": { <br/> "Ref": "VSwitch2CidrBlock" <br/> }, <br/> "ZoneId": { <br/> "Ref": "VSwitch2ZoneId" <br/> } <br/> } <br/> }, <br/> "VSwitch1": { <br/> "Type": "ALIYUN::ECS::VSwitch", <br/> "Properties": { <br/> "VSwitchName": { <br/> "Fn::Join": [ <br/> "-", <br/> [ <br/> "VSwitch1", <br/> "StackId", <br/> { <br/> "Ref": "ALIYUN::StackId" <br/> } <br/> ] <br/> ] <br/> }, <br/> "VpcId": { <br/> "Ref": "Vpc" <br/> }, <br/> "CidrBlock": { <br/> "Ref": "VSwitch1CidrBlock" <br/> }, <br/> "ZoneId": { <br/> "Ref": "VSwitch1ZoneId" <br/> } <br/> } <br/> }, <br/> "Vpc": { <br/> "Type": "ALIYUN::ECS::VPC", <br/> "Properties": { <br/> "VpcName": { <br/> "Fn::Join": [ <br/> "-", <br/> [ <br/> "StackId", <br/> { <br/> "Ref": "ALIYUN::StackId" <br/> } <br/> ] <br/> ] <br/> }, <br/> "CidrBlock": { <br/> "Ref": "VpcCidrBlock" <br/> } <br/> } <br/> }, <br/> "SecurityGroup": { <br/> "Type": "ALIYUN::ECS::SecurityGroup", <br/> "Properties": { <br/> "SecurityGroupIngress": [ <br/> { <br/> "Priority": 1, <br/> "IpProtocol": "all", <br/> "NicType": "intranet", <br/> "SourceCidrIp": "0.0.0.0/0", <br/> "PortRange": "-1/-1" <br/> } <br/> ], <br/> "VpcId": { <br/> "Ref": "Vpc" <br/> }, <br/> "SecurityGroupEgress": [ <br/> { <br/> "Priority": 1, <br/> "IpProtocol": "all", <br/> "DestCidrIp": "0.0.0.0/0", <br/> "NicType": "intranet", <br/> "PortRange": "-1/-1" <br/> } <br/> ] <br/> } <br/> } <br/> }, <br/> "Metadata": { <br/> "ALIYUN::ROS::Interface": { <br/> "ParameterGroups": [ <br/> { <br/> "Parameters": [ <br/> "VpcCidrBlock", <br/> "VSwitch1ZoneId", <br/> "VSwitch1CidrBlock", <br/> "VSwitch2ZoneId", <br/> "VSwitch2CidrBlock" <br/> ], <br/> "Label": { <br/> "default": "基本的なネットワーク構成" <br/> } <br/> } <br/> ] <br/> } <br/> } <br/>}

シナリオ 3:マルチゾーンデプロイメントと複数の vSwitch をサポートする高可用性 RDS インスタンスの作成

クイック作成

ROSTemplateFormatVersion: '2015-09-01'
Description:
  zh-cn: Create an RDS instance supporting multi-zone high availability.
  en: マルチゾーン高可用性をサポートする RDS インスタンスを作成します。
Parameters:
  ZoneId1:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    AssociationPropertyMetadata:
      ExclusiveTo:
        - ZoneId2
    Label:
      en: プライマリアベイラビリティゾーン
      zh-cn: Primary Availability Zone
  ZoneId2:
    Type: String
    AssociationProperty: ALIYUN::ECS::Instance::ZoneId
    AssociationPropertyMetadata:
      ExclusiveTo:
        - ZoneId1
    Label:
      en: スタンバイアベイラビリティゾーン
      zh-cn: Standby Availability Zone
  DBInstanceClass:
    Type: String
    Label:
      en: インスタンスクラス
      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: データベースアカウント
      zh-cn: Database Account
    Description:
      en: 値には、小文字、大文字、数字、アンダースコア (_) を含む最大 32 文字を含めることができます。先頭は文字で、末尾は文字または数字である必要があります。
      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: パスワード
      zh-cn: Password
    Description:
      en: 'パスワードは 8~32 文字の長さで、大文字、小文字、数字、特殊文字の 4 種類のうち少なくとも 3 種類を含む必要があります。特殊文字には !@#$%^&*()_+-= が含まれます'
      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 letters, 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: RDS 構成
            zh-cn: RDS Configuration
{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Description": {
    "zh-cn": "创建支持多可用区高可用的RDS实例。",
    "en": "マルチゾーン高可用性をサポートする RDS インスタンスを作成します。"
  },
  "Parameters": {
    "ZoneId1": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "AssociationPropertyMetadata": {
        "ExclusiveTo": [
          "ZoneId2"
        ]
      },
      "Label": {
        "en": "プライマリアベイラビリティゾーン",
        "zh-cn": "主可用区"
      }
    },
    "ZoneId2": {
      "Type": "String",
      "AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
      "AssociationPropertyMetadata": {
        "ExclusiveTo": [
          "ZoneId1"
        ]
      },
      "Label": {
        "en": "セカンダリアベイラビリティゾーン",
        "zh-cn": "备可用区"
      }
    },
    "DBInstanceClass": {
      "Type": "String",
      "Label": {
        "en": "インスタンスクラス",
        "zh-cn": "实例规格"
      },
      "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": "データベースアカウント",
        "zh-cn": "数据库账号"
      },
      "Description": {
        "en": "値は最大 32 文字で、先頭は文字、末尾は文字または数字である必要があります。小文字、大文字、数字、アンダースコア (_) のみを含めることができます。",
        "zh-cn": "由小写字母、大写字母、数字、下划线(_)组成,以字母开头,以字母或数字结尾,最多32个字符。"
      },
      "Default": "testuser"
    },
    "DBPassword": {
      "Type": "String",
      "Label": {
        "en": "パスワード",
        "zh-cn": "密码"
      },
      "Description": {
        "en": "パスワードは 8~32 文字の長さで、大文字、小文字、数字、特殊文字の 4 種類のうち少なくとも 3 種類を含む必要があります。特殊文字には !@#$%^&*()_+-= が含まれます",
        "zh-cn": "必须包含三种及以上类型: 大写字母、小写字母、数字、特殊符号。长度为8~32位。特殊字符包括!@#$%^&*()_+-="
      },
      "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配置"
            }
          }
        }
      ]
    }
  }
}

その他の例については、「このリソースを含むパブリックテンプレート」をご参照ください。