ALIYUN::ECS::VPC is used to create a virtual private cloud (VPC).
Syntax
{
"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
}
}
Properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
ResourceGroupId | String | No | Yes | The ID of the resource group. | None. |
VpcName | String | No | Yes | The name of the VPC. | 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 | No | Yes | The CIDR block of the VPC. | Valid values:
|
Description | String | No | Yes | The description of the VPC. | The description must be 2 to 256 characters in length. The description cannot start with http:// or https:// . |
Ipv6CidrBlock | String | No | No | The IPv6 CIDR block of the VPC. | None. |
EnableIpv6 | Boolean | No | Yes | Specifies whether to enable IPv6 CIDR blocks. | Default value: false. Valid values:
|
Tags | List | No | Yes | The tags of the VPC. | You can add up to 20 tags. For more information, see Tags properties. |
Ipv6Isp | String | No | No | The type of the IPv6 CIDR block of the VPC. |
|
UserCidr | String | No | No | The user CIDR block. | You can specify up to three CIDR blocks. Separate multiple CIDR blocks with commas (,). Note For more information about user CIDR blocks, see FAQ about CIDR blocks. |
SecondaryCidrBlocks | List | No | No | The secondary CIDR Blocks. | None. |
Tags syntax
"Tags": [
{
"Value": String,
"Key": String
}
]
Tags properties
Property | Type | Required | Editable | Description | Constraint |
---|---|---|---|---|---|
Key | String | Yes | No | The key of the tag. | The tag key must be 1 to 128 characters in length, and cannot contain http:// or https:// . The tag key cannot start with aliyun or acs: . |
Value | String | No | No | The value of the tag. | The tag value can be up to 128 characters in length, and cannot contain http:// or https:// . The tag value cannot start with aliyun or acs: . |
Return values
Fn::GetAtt
- VpcId: the ID of the VPC.
- VRouterId: the ID of the VRouter.
- RouteTableId: the ID of the route table.
Examples
JSON
format{ "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" ] } } } }
For more examples, visit SnatEntry.json and SnatEntry.yml. In the examples, the following resource types are used: ALIYUN::ECS::VPC, ALIYUN::ECS::VSwitch, ALIYUN::VPC::SnatEntry, ALIYUN::VPC::CommonBandwidthPackage, ALIYUN::VPC::CommonBandwidthPackageIp, ALIYUN::VPC::Ipv6Gateway, and ALIYUN::VPC::Ipv6InternetBandwidth.