ALIYUN::ECS::VPC is used to create a VPC.

Syntax

{
  "Type": "ALIYUN::ECS::VPC",
  "Properties": {
    "ResourceGroupId": String,
    "VpcName": String,
    "CidrBlock": String,
    "Description": String
  }
}

Properties

Name Type Required Editable Description Validity
ResourceGroupId String No No The ID of the resource group to which created instances belong. None
VpcName String No No The name of the VPC. The name must be 2 to 128 characters in length and can contain letters, digits, underscores (_), and hyphens (-). It must start with a letter but cannot start with http:// or https://.
CidrBlock String No No The CIDR block of the VPC. Valid values: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, and their subnets.
Description String No No The description of the VPC. The description must be 2 to 256 characters in length and cannot start with http:// or https://.

Response parameters

Fn::GetAtt

  • VpcId: the VPC ID allocated by the system.
  • VRouterId: the ID of the VRouter.
  • RouteTableId: the ID of the routing table.

Examples

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Resources": {
    "EcsVpc": {
      "Type": "ALIYUN::ECS::VPC",
      "Properties": {
        "CidrBlock": "172.16.0.0/12",
        "VpcName": "vpc-test-del"
      }
    }
  },
  "Outputs": {
    "VpcId": {
      "Value": {
        "Fn::GetAtt": [
          "EcsVpc",
          "VpcId"
        ]
      }
    },
    "VRouterId": {
      "Value": {
        "Fn::GetAtt": [
          "EcsVpc",
          "VRouterId"
        ]
      }
    },
    "RouteTableId": {
      "Value": {
        "Fn::GetAtt": [
          "EcsVpc",
          "RouteTableId"
        ]
      }
    }
  }
}