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

PropertyTypeRequiredEditableDescriptionConstraint
ResourceGroupIdStringNoYesThe ID of the resource group. None.
VpcName StringNo 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 YesThe CIDR block of the VPC. Valid values:
  • 10.0.0.0/8
  • 172.16.0.0/12
  • 192.168.0.0/16 and its subnets
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://.
Ipv6CidrBlockStringNo No The IPv6 CIDR block of the VPC. None.
EnableIpv6BooleanNo YesSpecifies whether to enable IPv6 CIDR blocks. Default value: false. Valid values:
  • true
  • false
TagsListNoYesThe tags of the VPC. You can add up to 20 tags.

For more information, see Tags properties.

Ipv6IspStringNoNoThe type of the IPv6 CIDR block of the VPC.
  • Set the value to BGP, which specifies Alibaba Cloud Border Gateway Protocol (BGP) IPv6. This is the default value.
UserCidrStringNoNoThe 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.
SecondaryCidrBlocksListNoNoThe secondary CIDR Blocks. None.

Tags syntax

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

Tags properties

PropertyTypeRequiredEditableDescriptionConstraint
KeyStringYesNoThe 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:.
ValueStringNoNoThe 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

  • YAML 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
  • 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.