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,
"Ipv6CidrMask": Integer
}
}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:
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:
|
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. |
Ipv6CidrMask | Integer | No | No | The subnet mask of the VPC's IPv6 CIDR block allocated from an IPAM pool. | None |
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:
The following limits apply:
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
ROSTemplateFormatVersion: '2015-09-01'
Parameters:
SecondaryCidrBlock:
Type: String
Description:
en: |-
The secondary IPv4 CIDR block to add.
Supported blocks include standard CIDR blocks (e.g., 10.0.0.0/8) and their subnets, or custom blocks outside of reserved ranges (e.g., 100.64.0.0/10).
The subnet mask must be between 8 and 28 bits, and the CIDR block cannot overlap with the primary or any other secondary CIDR block.
Note: You must specify either this parameter or 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 associated VPC.
Value:
Fn::GetAtt:
- VpcCidrBlockAssociation
- VpcId{
"ROSTemplateFormatVersion": "2015-09-01",
"Parameters": {
"SecondaryCidrBlock": {
"Type": "String",
"Description": {
"en": "The secondary IPv4 CIDR block to add.\nSupported blocks include standard CIDR blocks (e.g., 10.0.0.0/8) and their subnets, or custom blocks outside of reserved ranges (e.g., 100.64.0.0/10). \nThe subnet mask must be between 8 and 28 bits, and the CIDR block cannot overlap with the primary or any other secondary CIDR block.\nNote: You must specify either this parameter or 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 associated VPC.",
"Value": {
"Fn::GetAtt": [
"VpcCidrBlockAssociation",
"VpcId"
]
}
}
}
}