All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::ECS::VPC

Last Updated:Sep 23, 2024

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 VPC name.

The name must be 2 to 128 characters in length. It must start with a letter and cannot start with http:// or https://. It can contain letters, digits, underscores (_), and hyphens (-).

CidrBlock

String

No

Yes

The 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. It 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.

Valid values:

  • true

  • false (default)

Tags

List

No

Yes

The tags.

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.

  • Set the value to BGP, which specifies Alibaba Cloud Border Gateway Protocol (BGP) IPv6. Default value: BGP.

UserCidr

String

No

No

The user CIDR blocks.

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 tag key.

The tag key must be 1 to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Value

String

No

No

The tag value.

The tag value can be up to 128 characters in length, and cannot contain http:// or https://. It cannot start with aliyun or acs:.

Return values

Fn::GetAtt

  • VpcId: the VPC ID.

  • VRouterId: the vRouter ID.

  • RouteTableId: the ID of the route table.

  • VpcName: the VPC name.

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.