All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::VPC::VpcCidrBlockAssociation

Last Updated:Nov 13, 2024

ALIYUN::VPC::VpcCidrBlockAssociation is used to add a secondary CIDR block to a virtual private cloud (VPC).

Syntax

{
  "Type": "ALIYUN::VPC::VpcCidrBlockAssociation",
  "Properties": {
    "VpcId": String,
    "Ipv6Isp": String,
    "IpVersion": String,
    "IpamPoolId": String,
    "IPv6CidrBlock": String,
    "SecondaryCidrMask": Integer,
    "SecondaryCidrBlock": String
  }
}

Properties

Property

Type

Required

Editable

Description

Constraint

VpcId

String

Yes

No

The ID of the VPC to which you want to add a secondary CIDR block.

None.

Ipv6Isp

String

No

No

The type of the IPv6 CIDR block that you want to add to the VPC.

Valid values:

  • BGP (default): Alibaba Cloud Border Gateway Protocol (BGP)

  • ChinaMobile: China Mobile (single ISP)

  • ChinaUnicom: China Unicom (single ISP)

  • ChinaTelecom: China Telecom (single ISP)

Note

If you have the permissions to use single-ISP bandwidth, the valid values of this property are ChinaTelecom, ChinaUnicom, and ChinaMobile.

IpVersion

String

No

No

The IP version of the IP address.

Valid values:

  • IPV4: IPv4.

  • IPV6: IPv6. If you set IpVersion to IPV6 and leave SecondaryCidrBlock empty, you can add a secondary IPv6 CIDR block to the VPC.

IpamPoolId

String

No

No

The ID of the IP Address Manager (IPAM) pool of the IPv4 type.

None.

IPv6CidrBlock

String

No

No

The IPv6 CIDR block that you want to add to the VPC.

Note

You must specify one of SecondaryCidrBlock and Ipv6CidrBlock.

SecondaryCidrMask

Integer

No

No

The subnet mask that you want to use to add a secondary CIDR block from the IPAM pool to the VPC.

Note

If you use an IPAM pool to add a secondary CIDR block to a VPC, you must specify at least one of SecondaryCidrBlock and SecondaryCidrMask.

SecondaryCidrBlock

String

No

No

The secondary IPv4 CIDR block that you want to add to the VPC.

Take note of the following requirements on CIDR blocks:

  • You can specify one of the following standard CIDR blocks or their subnets as the secondary IPv4 CIDR block: 192.168.0.0/16, 172.16.0.0/12, and 10.0.0.0/8.

  • You can specify a custom CIDR block other than one of the following CIDR blocks or their subnets as the secondary IPv4 CIDR block: 100.64.0.0/10, 224.0.0.0/4, 127.0.0.0/8, and 169.254.0.0/16.

The following limits apply:

  • The secondary IPv4 CIDR block cannot start with 0. The subnet mask must be 8 to 28 bits in length.

  • The secondary IPv4 CIDR block cannot overlap with the primary CIDR block or an existing secondary CIDR block of the VPC.

Note

If you do not use an IPAM pool to add a secondary CIDR block to a VPC, you must specify one of SecondaryCidrBlock and Ipv6CidrBlock.

Return values

Fn::GetAtt

VpcId: the ID of the VPC to which the secondary CIDR block is added.

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  SecondaryCidrBlock:
    Type: String
    Description:
      en: |-
        The IPv4 CIDR block to be added. Take note of the following requirements:
        You can specify one of the following standard IPv4 CIDR blocks or their subnets as the secondary IPv4 CIDR block of the VPC: 192.168.0.0/16, 172.16.0.0/12, and 10.0.0.0/8.
        You can also use a custom CIDR block other than 100.64.0.0/10, 224.0.0.0/4, 127.0.0.0/8, 169.254.0.0/16, or their subnets as the secondary IPv4 CIDR block of the VPC.
        The CIDR block must meet the following requirements:
        The CIDR block cannot start with 0. The subnet mask must be 8 to 28 bits in length.
        The CIDR block cannot overlap with the primary CIDR block or an existing secondary CIDR block of the VPC.
        Note You must and can specify only one of SecondaryCidrBlock and Ipv6CidrBlock.
    Required: false
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description:
      en: The ID of the VPC to which you want to add a secondary CIDR block.
    Required: true
Resources:
  VpcCidrBlockAssociation:
    Type: ALIYUN::VPC::VpcCidrBlockAssociation
    Properties:
      SecondaryCidrBlock:
        Ref: SecondaryCidrBlock
      VpcId:
        Ref: VpcId
Outputs:
  VpcId:
    Description: The ID of the VPC to which you want to add a secondary CIDR block.
    Value:
      Fn::GetAtt:
        - VpcCidrBlockAssociation
        - VpcId

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "SecondaryCidrBlock": {
      "Type": "String",
      "Description": {
        "en": "The IPv4 CIDR block to be added. Take note of the following requirements:\nYou can specify one of the following standard IPv4 CIDR blocks or their subnets as the secondary IPv4 CIDR block of the VPC: 192.168.0.0/16, 172.16.0.0/12, and 10.0.0.0/8.\nYou can also use a custom CIDR block other than 100.64.0.0/10, 224.0.0.0/4, 127.0.0.0/8, 169.254.0.0/16, or their subnets as the secondary IPv4 CIDR block of the VPC.\nThe CIDR block must meet the following requirements:\nThe CIDR block cannot start with 0. The subnet mask must be 8 to 28 bits in length.\nThe CIDR block cannot overlap with the primary CIDR block or an existing secondary CIDR block of the VPC.\nNote You must and can specify only one of SecondaryCidrBlock and Ipv6CidrBlock."
      },
      "Required": false
    },
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": {
        "en": "The ID of the VPC to which you want to add a secondary CIDR block."
      },
      "Required": true
    }
  },
  "Resources": {
    "VpcCidrBlockAssociation": {
      "Type": "ALIYUN::VPC::VpcCidrBlockAssociation",
      "Properties": {
        "SecondaryCidrBlock": {
          "Ref": "SecondaryCidrBlock"
        },
        "VpcId": {
          "Ref": "VpcId"
        }
      }
    }
  },
  "Outputs": {
    "VpcId": {
      "Description": "The ID of the VPC to which you want to add a secondary CIDR block.",
      "Value": {
        "Fn::GetAtt": [
          "VpcCidrBlockAssociation",
          "VpcId"
        ]
      }
    }
  }
}