ALIYUN::VPC::VpcCidrBlockAssociation类型用于为VPC添加附加网段。
语法
{
"Type": "ALIYUN::VPC::VpcCidrBlockAssociation",
"Properties": {
"VpcId": String,
"Ipv6Isp": String,
"IpVersion": String,
"IpamPoolId": String,
"IPv6CidrBlock": String,
"SecondaryCidrMask": Integer,
"SecondaryCidrBlock": String
}
}
属性
属性名称 | 类型 | 必须 | 允许更新 | 描述 | 约束 |
VpcId | String | 是 | 否 | 需要添加附加网段的VPC的ID。 | 无 |
Ipv6Isp | String | 否 | 否 | VPC的IPv6地址段类型。 | 取值:
说明 如果是开通了单线带宽白名单的用户,该字段可以设置为ChinaTelecom(中国电信)、ChinaUnicom(中国联通)和ChinaMobile(中国移动)。 |
IpVersion | String | 否 | 否 | IP地址的版本类型。 | 取值:
|
IpamPoolId | String | 否 | 否 | IPv4类型的IPAM地址池实例ID。 | 无 |
IPv6CidrBlock | String | 否 | 否 | VPC的指定IPv6网段。 | 说明 参数SecondaryCidrBlock和参数Ipv6CidrBlock必须输入一个且不能都输入。 |
SecondaryCidrMask | Integer | 否 | 否 | 通过输入掩码的方式从IPAM地址池为VPC添加附加网段。 | 说明 指定IPAM地址池为 VPC添加附加网段,参数 SecondaryCidrBlock 或 SecondaryCidrMask 至少输入一个。 |
SecondaryCidrBlock | String | 否 | 否 | 需要添加的附加IPv4网段。 | 网段要求如下:
配置限制如下:
说明 不通过IPAM地址池为 VPC添加附加网段时,参数SecondaryCidrBlock和参数Ipv6CidrBlock必须输入一个且不能都输入。 |
返回值
Fn::GetAtt
VpcId:添加附加网段的VPC的ID。
示例
YAML
格式
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
格式
{
"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"
]
}
}
}
}