ALIYUN::ECS::VPC類型用于創建專有網絡。
語法
{
"Type": "ALIYUN::ECS::VPC",
"Properties": {
"Description": String,
"Tags": List,
"Ipv6CidrBlock": String,
"EnableIpv6": Boolean,
"ResourceGroupId": String,
"VpcName": String,
"CidrBlock": String,
"Ipv6Isp": String,
"UserCidr": String,
"SecondaryCidrBlocks": List
}
}
屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
ResourceGroupId | String | 否 | 是 | 資源組ID。 | 無 |
VpcName | String | 否 | 是 | 專有網絡名稱。 | 長度為2~128個字符。必須以英文字母或漢字開頭,不能以 |
CidrBlock | String | 否 | 是 | 專有網絡網段。 | 取值:
|
Description | String | 否 | 是 | 專有網絡描述。 | 長度為2~256個字符。不能以 |
Ipv6CidrBlock | String | 否 | 否 | 專有網絡的IPv6網段。 | 無 |
EnableIpv6 | Boolean | 否 | 是 | 是否開啟IPv6網段。 | 取值:
|
Tags | List | 否 | 是 | 標簽。 | 最多支持20個標簽。 更多信息,請參見Tags屬性。 |
Ipv6Isp | String | 否 | 否 | 專有網絡的IPv6地址段類型。 | 取值:
說明 如果是開通了單線帶寬白名單的用戶,該參數可以設置為ChinaTelecom(中國電信)、ChinaUnicom(中國聯通)和ChinaMobile(中國移動)。 |
UserCidr | String | 否 | 否 | 用戶網段。 | 如需定義多個網段,請使用半角逗號(,)分隔。最多支持3個網段。 說明 關于用戶網段的更多信息,請參見網段常見問題。 |
SecondaryCidrBlocks | List | 否 | 否 | SecondaryCidrBlocks。 | 無 |
Tags語法
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags屬性
屬性名稱 | 類型 | 必須 | 允許更新 | 描述 | 約束 |
Key | String | 是 | 否 | 標簽鍵。 | 長度為1~128個字符,不能以 |
Value | String | 否 | 否 | 標簽值。 | 長度為0~128個字符,不能以 |
返回值
Fn::GetAtt
VpcId:專有網絡ID。
VRouterId:路由器ID。
RouteTableId:路由表ID。
VpcName:專有網絡名稱。
示例
ROSTemplateFormatVersion: '2015-09-01' Parameters: {} Resources: Vpc: Type: ALIYUN::ECS::VPC Properties: CidrBlock: 192.168.0.0/24 VpcName: TestVpc Outputs: VRouterId: Description: Router id of created VPC. Value: Fn::GetAtt: - Vpc - VRouterId RouteTableId: Description: The router table id of created VPC. Value: Fn::GetAtt: - Vpc - RouteTableId VpcId: Description: Id of created VPC. Value: Fn::GetAtt: - Vpc - VpcId
{ "ROSTemplateFormatVersion": "2015-09-01", "Parameters": { }, "Resources": { "Vpc": { "Type": "ALIYUN::ECS::VPC", "Properties": { "CidrBlock": "192.168.0.0/24", "VpcName": "TestVpc" } } }, "Outputs": { "VRouterId": { "Description": "Router id of created VPC.", "Value": { "Fn::GetAtt": [ "Vpc", "VRouterId" ] } }, "RouteTableId": { "Description": "The router table id of created VPC.", "Value": { "Fn::GetAtt": [ "Vpc", "RouteTableId" ] } }, "VpcId": { "Description": "Id of created VPC.", "Value": { "Fn::GetAtt": [ "Vpc", "VpcId" ] } } } }
更多示例,請參見創建專有網絡、創建專有網絡中的交換機、在SNAT列表中添加SNAT條目、創建共享帶寬實例、添加EIP到共享帶寬中、創建IPv6網關和為IPv6地址購買公網帶寬的組合示例:JSON示例和YAML示例。