ALIYUN::ECS::VSwitch is used to create a vSwitch.
Syntax
{
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"VSwitchName": String,
"VpcId": String,
"Description": String,
"Tags": List,
"Ipv6CidrBlock": Integer,
"ZoneId": String,
"CidrBlock": String,
"VpcIpv6CidrBlock": String
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
VpcId |
String | Yes | No | The ID of the virtual private cloud (VPC) in which you create the vSwitch. | None. |
ZoneId |
String | Yes | No | The ID of the zone. | None. |
VSwitchName |
String | No | Yes | The name of the vSwitch. | The name must be 2 to 128 characters in length, and can contain letters, digits, underscores
(_), and hyphens (-). The name must start with a letter but cannot start with http:// or https:// .
|
CidrBlock |
String | Yes | No | The CIDR block of the vSwitch. | The CIDR block of a vSwitch must be a subset of the CIDR block of the VPC to which the vSwitch belongs and cannot be used by other vSwitches. |
Description |
String | No | Yes | The description of the vSwitch. | The description must be 2 to 256 characters in length. The description cannot start
with http:// or https:// .
|
Ipv6CidrBlock |
Integer | No | No | The IPv6 CIDR block of the vSwitch. | Valid values: 0 to 255. The value must be a decimal integer.
By default, the mask of the IPv6 CIDR block of the vSwitch is 64 bits in length. You can specify a custom content for the last eight bits of the mask of the IPv6 CIDR block of the VPC. |
Tags |
List | No | Yes | The tags. | You can specify up to 20 tags.
For more information, see Tags properties. |
VpcIpv6CidrBlock |
String | No | No | The IPv6 CIDR block of the VPC. | None. |
Tags syntax
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Key |
String | Yes | No | The tag key. | The key must be 1 to 128 characters in length, and cannot contain http:// or https:// . The key cannot start with aliyun or acs: .
|
Value |
String | No | No | The tag value. | The value must be 0 to 128 characters in length, and cannot contain http:// or https:// . The value cannot start with aliyun or acs: .
|
Return values
Fn::GetAtt
- CidrBlock: the CIDR block of the vSwitch.
- Ipv6CidrBlock: the IPv6 CIDR block of the vSwitch.
- VSwitchId: the ID of the vSwitch.
Examples
JSON
format
{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"VSwitchZoneId": {
"AssociationProperty": "ALIYUN::ECS::Instance:ZoneId",
"Type": "String",
"Description": "The ID of the zone",
"Label": {
"en": "VSwitch Availability Zone"
}
}
},
"Resources": {
"EcsVSwitch": {
"Type": "ALIYUN::ECS::VSwitch",
"Properties": {
"VpcId": {
"Ref": "EcsVpc"
},
"ZoneId": {
"Ref": "VSwitchZoneId"
},
"CidrBlock": "192.168.0.0/24"
}
},
"EcsVpc": {
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"CidrBlock": "192.168.0.0/16",
"VpcName": {
"Fn::Join": [
"-",
[
"StackId",
{
"Ref": "ALIYUN::StackId"
}
]
]
}
}
}
},
"Outputs": {
}
}
To view more examples, visit SnatEntry.json and SnatEntry.yml. In the examples, the ALIYUN::ECS::VPC, ALIYUN::ECS::VSwitch, ALIYUN::VPC::SnatEntry, ALIYUN::VPC::CommonBandwidthPackage, ALIYUN::VPC::CommonBandwidthPackageIp, ALIYUN::VPC::Ipv6Gateway, and ALIYUN::VPC::Ipv6InternetBandwidth resource types are used.