Resource 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
Nama properti | Tipe | Wajib | Pembaruan diizinkan | Deskripsi | Batasan |
| String | Ya | Tidak | ID VPC tempat vSwitch akan dibuat. | Tidak ada |
| String | Ya | Tidak | ID zona. | Tidak ada |
| String | Tidak | Ya | Nama vSwitch. | Nama harus terdiri dari 2 hingga 128 karakter. Nama harus dimulai dengan huruf atau karakter Tionghoa, dan tidak boleh dimulai dengan |
| String | Ya | Tidak | Blok CIDR untuk vSwitch. | Blok CIDR harus merupakan subnet dari VPC dan tidak boleh digunakan oleh vSwitch lain. |
| String | Tidak | Ya | Deskripsi vSwitch. | Deskripsi harus terdiri dari 2 hingga 256 karakter dan tidak boleh dimulai dengan |
| Integer | Tidak | Tidak | Blok CIDR IPv6 untuk vSwitch. | Nilai yang valid: 0 hingga 255. Nilai ini 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. |
| List | Tidak | Ya | Tag. | Anda dapat menambahkan hingga 20 tag. Untuk informasi selengkapnya, lihat Properti tag. |
| String | Tidak | Tidak | Blok CIDR IPv6 untuk VPC. | Tidak ada |
ZoneType | String | Tidak | Tidak | Jenis zona yang akan dikueri. | Nilai default: |
Sintaks Tags
"Tags": [
{
"Value": String,
"Key": String
}
]Properti Tags
Nama properti | Tipe | Wajib | Pembaruan diizinkan | Deskripsi | Batasan |
| String | Ya | Tidak | Kunci tag. | Kunci harus terdiri dari 1 hingga 128 karakter. Kunci tidak boleh dimulai dengan |
| String | Tidak | Tidak | Nilai tag. | Nilai dapat terdiri dari 0 hingga 128 karakter. Nilai tidak boleh dimulai dengan |
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.
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 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 available area id, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>View region and zone info</font></a>.
Label:
zh-cn: VSwitch 1 ZoneId
en: VSwitch 1 ZoneId
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: '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: Must be a subnet of the VPC.
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": "ID zona untuk vSwitch, </font><a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'> Lihat informasi wilayah dan zona<font color='blue'></a>.",
"en": "VSwitch available area id, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>View region and zone info</font></a>."
},
"Label": {
"zh-cn": "VSwitch 1 ZoneId",
"en": "VSwitch 1 ZoneId"
}
},
"VpcCidrBlock": {
"Default": "192.168.0.0/16",
"Type": "String",
"Description": {
"zh-cn": "Blok CIDR untuk VPC.<br>Anda dapat menggunakan blok CIDR berikut atau subnet-nya:<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": "Harus merupakan subnet dari VPC.",
"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"
}
}
]
}
}
}Skenario 2: Buat VPC dua zona dan vSwitches.
ROSTemplateFormatVersion: '2015-09-01'
Description:
zh-cn: 创建双可用区VPC网络,含安全组,自动配置子网CIDR,支持自定义IP范围。
en: Buat jaringan VPC dua zona, termasuk grup keamanan, dengan konfigurasi otomatis Blok CIDR subnet dan dukungan untuk rentang IP kustom.
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: ID Zona VSwitch, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>Lihat informasi wilayah dan zona</font></a>.
Label:
zh-cn: 交换机1可用区ID
en: VSwitch 1 Zone ID
VSwitch2CidrBlock:
Default: 192.168.2.0/24
Type: String
Description:
zh-cn: 必须属于VPC的子网段。
en: Harus berupa segmen subnet VPC.
Label:
zh-cn: 交换机2子网网段
en: VSwitch 2 CIDR Block
VSwitch1CidrBlock:
Default: 192.168.1.0/24
Type: String
Description:
zh-cn: 必须属于VPC的子网段。
en: Harus berupa segmen subnet VPC.
Label:
zh-cn: 交换机1子网网段
en: VSwitch 1 CIDR Block
VpcCidrBlock:
Default: 192.168.0.0/16
Type: String
Description:
zh-cn: 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/> en: Rentang alamat IP VPC dalam format Blok CIDR. Anda dapat menggunakan rentang alamat IP berikut beserta subnet-nya: <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 Block
<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: ID Zona VSwitch, berbeda dari ID Zona VSwitch lainnya; <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b><font color='blue'>Lihat informasi wilayah dan zona</font></a>.
<br/> Default: cn-hangzhou-h
<br/> Label:
<br/> zh-cn: 交换机2可用区ID
<br/> en: VSwitch 2 Zone ID
<br/> AssociationProperty: ALIYUN::ECS::Instance:ZoneId
<br/> Type: String
<br/>Outputs:
<br/> VSwitch1Name:
<br/> Description: Name of created VSwitch1.
<br/> Value:
<br/> Fn::GetAtt:
<br/> - VSwitch1
<br/> - VSwitchName
<br/> VpcName:
<br/> Description: Name of created VPC.
<br/> Value:
<br/> Fn::GetAtt:
<br/> - Vpc
<br/> - VpcName
<br/> VSwitch2Name:
<br/> Description: Name of created 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: Konfigurasi Jaringan Dasar
<br/>{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "Buat jaringan VPC dual-Availability Zone, termasuk grup keamanan, dengan konfigurasi CIDR subnet otomatis dan dukungan untuk rentang IP kustom.",
"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": "ID zona VSwitch, </font><a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'> Lihat informasi zona<font color='blue'></a>.",
"en": "VSwitch ZoneId, <a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><font color='blue'>View region and zone info</font></a>."
},
"Label": {
"zh-cn": "ID Zona Switch 1",
"en": "VSwitch 1 ZoneId"
}
},
"VSwitch2CidrBlock": {
"Default": "192.168.2.0/24",
"Type": "String",
"Description": {
"zh-cn": "Harus merupakan segmen subnet VPC.",
"en": "Must belong to the subnet segment of the VPC."
},
"Label": {
"zh-cn": "Segmen Subnet Switch 2",
"en": "VSwitch 2 CIDR Block"
}
},
"VSwitch1CidrBlock": {
"Default": "192.168.1.0/24",
"Type": "String",
"Description": {
"zh-cn": "Harus merupakan segmen subnet VPC.",
"en": "Must belong to the subnet segment of the VPC."
},
"Label": {
"zh-cn": "Segmen Subnet Switch 1",
"en": "VSwitch 1 CIDR Block"
}
},
"VpcCidrBlock": {
"Default": "192.168.0.0/16",
"Type": "String",
"Description": {
"zh-cn": "Rentang alamat IP VPC,
Anda dapat menggunakan rentang alamat IP berikut atau subnet-nya:<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 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>"
},
"Label": {
"zh-cn": "Segmen Jaringan VPC",
"en": "VPC CIDR Block"
}
},
"VSwitch2ZoneId": {
"AssociationPropertyMetadata": {
"ExclusiveTo": [
"VSwitch1ZoneId"
],
"AutoSelectFirst": true
},
"Description": {
"zh-cn": "ID zona VSwitch, berbeda dari ID zona virtual switch lainnya;</font><a href='https://www.alibabacloud.com/help/document_detail/123712.html' target='_blank'><b> Lihat informasi zona<font color='blue'></a>.",
"en": "VSwitch ZoneId, different from the ZoneId 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></a>."
},
"Default": "cn-hangzhou-h",
"Label": {
"zh-cn": "ID Zona Switch 2",
"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"
}
}
]
}
}
}Skenario 3: Buat instans RDS ketersediaan tinggi yang mendukung penerapan multi-zona dan beberapa vSwitch.
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 !@#$%^&*()_+-='
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 Configuration
zh-cn: RDS Configuration
{
"ROSTemplateFormatVersion": "2015-09-01",
"Description": {
"zh-cn": "Buat instans RDS yang mendukung ketersediaan tinggi multi-zona.",
"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": "Zona Utama"
}
},
"ZoneId2": {
"Type": "String",
"AssociationProperty": "ALIYUN::ECS::Instance::ZoneId",
"AssociationPropertyMetadata": {
"ExclusiveTo": [
"ZoneId1"
]
},
"Label": {
"en": "Secondary Availability Zone",
"zh-cn": "Zona Cadangan"
}
},
"DBInstanceClass": {
"Type": "String",
"Label": {
"en": "Instance Class",
"zh-cn": "Kelas Instans"
},
"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": "Akun Database"
},
"Description": {
"en": "The value can be up to 32 characters in length and must start with a letter and end with a letter or digit. It can contain only lowercase letters, uppercase letters, digits, and underscores (_).",
"zh-cn": "Terdiri dari huruf kecil, huruf besar, angka, dan garis bawah (_), dimulai dengan huruf dan diakhiri dengan huruf atau angka, maksimal 32 karakter."
},
"Default": "testuser"
},
"DBPassword": {
"Type": "String",
"Label": {
"en": "Password",
"zh-cn": "Kata Sandi"
},
"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 letters, digits, and special characters. Special characters include !@#$%^&*()_+-=",
"zh-cn": "Harus mengandung minimal tiga jenis karakter dari: huruf besar, huruf kecil, angka, dan simbol khusus. Panjang 8–32 karakter. Simbol khusus meliputi !@#$%^&*()_+-="
},
"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": "Konfigurasi RDS"
}
}
}
]
}
}
}Untuk contoh lainnya, lihat templat publik yang mencakup resource ini.