ALIYUN::VPC::VSwitchCidrReservation

ALIYUN::VPC::VSwitchCidrReservation类型用于创建交换机预留网段。

语法

{
  "Type": "ALIYUN::VPC::VSwitchCidrReservation",
  "Properties": {
    "VSwitchCidrReservationType": String,
    "VSwitchCidrReservationCidr": String,
    "VSwitchCidrReservationDescription": String,
    "IpVersion": String,
    "VSwitchId": String,
    "VSwitchCidrReservationName": String,
    "Tags": List,
    "VSwitchCidrReservationMask": String
  }
}

属性

属性名称

类型

必须

允许更新

描述

约束

VSwitchCidrReservationType

String

交换机预留网段的类型。

取值:prefix,表示按段分配地址。

说明

用户及云服务自动为弹性网卡ENI(Elastic Network Interface)分配网段时,必须从预留地址段分配。如果预留地址段的地址已经分配完,则系统会报错。

VSwitchCidrReservationCidr

String

交换机预留网段。

  • IpVersion取值为IPv4时,交换机预留网段必须是其所属交换机IPv4网段的真子集且网段的掩码长度不超过28。

  • IpVersion取值为IPv6时,交换机预留网段必须是其所属交换机IPv6网段的真子集且网段的掩码长度不超过80。

说明

VSwitchCidrReservationMask参数和VSwitchCidrReservationCidr参数必须输入一个。

当您在交换机下添加预留网段后,该预留网段不能包含交换机对应的VPC的系统保留地址。

VSwitchCidrReservationDescription

String

交换机预留网段的描述信息。

不填则为空,默认值为空。

描述长度为2~256个字符,以英文字母或中文开头,不能以http://https://开头。

IpVersion

String

交换机预留网段的IP版本。

取值:

  • IPv4(默认值):IPv4版本。

  • IPv6:IPv6版本。

VSwitchId

String

要创建的交换机预留网段所属的交换机ID。

VSwitchCidrReservationName

String

交换机预留网段的名称。

名称长度为2~128个字符,以英文字母或中文开头,可包含数字、下划线(_)和短划线(-)。

Tags

List

标签列表。

最多支持20个,更多信息,请参见Tags属性

VSwitchCidrReservationMask

String

交换机预留网段的掩码。

  • IpVersion取值为IPv4时,交换机预留网段的掩码长度范围必须要大于所属交换机的IPv4网段掩码长度且最大不超过28。

  • IpVersion取值为IPv6时,交换机预留网段的掩码长度范围必须要大于所属交换机的IPv6网段掩码长度且最大不超过80。

Tags语法

"Tags": [
  {
    "Value": String,
    "Key": String
  }
]

Tags属性

属性名称

类型

必须

允许更新

描述

约束

Value

String

资源的标签值。

最多支持输入20个标签值。如需传入该值,可以输入空字符串。

最多支持128个字符,不能以aliyunacs:开头,不能包含http://或者https://

Key

String

资源的标签键。

最多支持输入20个标签键。如需传入该值,则不能输入空字符串。

一个标签键最多支持128个字符,不能以aliyunacs:开头,不能包含http://或者https://

返回值

Fn::GetAtt

VSwitchCidrReservationId:交换机预留网段的实例ID。

示例

  • YAML格式

    ROSTemplateFormatVersion: '2015-09-01'
    Parameters:
      IpVersion:
        AllowedValues:
        - IPv6
        - IPv4
        Description:
          en: 'The IP version of the reserved CIDR block. Valid values:
    
            IPv4 (default)
    
            IPv6'
        Required: false
        Type: String
      Tags:
        AssociationProperty: List[Parameters]
        AssociationPropertyMetadata:
          ListMetadata:
            Order:
            - Key
            - Value
          Parameters:
            Key:
              Description:
                en: 'The key of tag N to add to the capacity reservation. Valid values
                  of N: 1 to 20. The tag key cannot be an empty string. The tag key can
                  be up to 128 characters in length and cannot contain http:// or https://.
                  It cannot start with acs: or aliyun.'
              Required: false
              Type: String
            Value:
              Description:
                en: 'The value of tag N to add to the capacity reservation. Valid values
                  of N: 1 to 20. The tag value can be an empty string. The tag value can
                  be up to 128 characters in length and cannot start with acs:. The tag
                  value cannot contain http:// or https://.'
              Required: false
              Type: String
        MaxLength: 20
        Required: false
        Type: Json
      VSwitchCidrReservationCidr:
        Description:
          en: 'The reserved CIDR block of the vSwitch.
    
            When IpVersion is set to IPv4, the reserved CIDR block must be a proper subset
            of the IPv4 CIDR block of the vSwitch and the subnet mask length of the reserved
            CIDR block cannot be greater than 28.
    
            When IpVersion is set to IPv6, the reserved CIDR block must be a proper subset
            of the IPv6 CIDR block of the vSwitch and the subnet mask length of the reserved
            CIDR block cannot be greater than 80.
    
            Note You must specify one of VSwitchCidrReservationMask and VSwitchCidrReservationCidr.'
        Required: false
        Type: String
      VSwitchCidrReservationDescription:
        Description:
          en: 'The description of the reserved CIDR block. This parameter is empty by
            default.
    
            The description must be 2 to 256 characters in length. It must start with
            a letter and cannot start with http:// or https://.'
        Required: false
        Type: String
      VSwitchCidrReservationMask:
        Description:
          en: 'The subnet mask of the reserved CIDR block.
    
            When IpVersion is set to IPv4, the subnet mask length of the CIDR block must
            be greater than the IPv4 subnet mask length of the vSwitch and cannot be greater
            than 28.
    
            When IpVersion is set to IPv6, the subnet mask length of the CIDR block must
            be greater than the IPv6 subnet mask length of the vSwitch and cannot be greater
            than 80.
    
            Note You must specify one of VSwitchCidrReservationMask and VSwitchCidrReservationCidr.'
        Required: false
        Type: String
      VSwitchCidrReservationName:
        Description:
          en: 'The name of the reserved CIDR block.
    
            The name must be 2 to 128 characters in length and can contain digits, underscores
            (_), and hyphens (-). It must start with a letter.'
        Required: false
        Type: String
      VSwitchCidrReservationType:
        AllowedValues:
        - prefix
        Description:
          en: 'The type of reserved CIDR block. Set the value to prefix.
    
            Note When a user or a cloud service allocates a CIDR block to an elastic network
            interface (ENI), the CIDR block must be allocated from the reserved CIDR block.
            If the reserved CIDR block is exhausted, an error is returned.'
        Required: false
        Type: String
      VSwitchId:
        AssociationProperty: ALIYUN::VPC::VSwitch::VSwitchId
        AssociationPropertyMetadata:
          VpcId: ${VpcId}
          ZoneId: ${ZoneId}
        Description:
          en: The ID of the vSwitch to which the reserved CIDR block belongs.
        Required: true
        Type: String
    Resources:
      VSwitchCidrReservation:
        Properties:
          IpVersion:
            Ref: IpVersion
          Tags:
            Ref: Tags
          VSwitchCidrReservationCidr:
            Ref: VSwitchCidrReservationCidr
          VSwitchCidrReservationDescription:
            Ref: VSwitchCidrReservationDescription
          VSwitchCidrReservationMask:
            Ref: VSwitchCidrReservationMask
          VSwitchCidrReservationName:
            Ref: VSwitchCidrReservationName
          VSwitchCidrReservationType:
            Ref: VSwitchCidrReservationType
          VSwitchId:
            Ref: VSwitchId
        Type: ALIYUN::VPC::VSwitchCidrReservation
    Outputs:
      VSwitchCidrReservationId:
        Description: The ID of the reserved CIDR block.
        Value:
          Fn::GetAtt:
          - VSwitchCidrReservation
          - VSwitchCidrReservationId
                            
  • JSON格式

    {
      "ROSTemplateFormatVersion": "2015-09-01",
      "Parameters": {
        "VSwitchCidrReservationType": {
          "Type": "String",
          "Description": {
            "en": "The type of reserved CIDR block. Set the value to prefix.\nNote When a user or a cloud service allocates a CIDR block to an elastic network interface (ENI), the CIDR block must be allocated from the reserved CIDR block. If the reserved CIDR block is exhausted, an error is returned."
          },
          "AllowedValues": [
            "prefix"
          ],
          "Required": false
        },
        "VSwitchCidrReservationCidr": {
          "Type": "String",
          "Description": {
            "en": "The reserved CIDR block of the vSwitch.\nWhen IpVersion is set to IPv4, the reserved CIDR block must be a proper subset of the IPv4 CIDR block of the vSwitch and the subnet mask length of the reserved CIDR block cannot be greater than 28.\nWhen IpVersion is set to IPv6, the reserved CIDR block must be a proper subset of the IPv6 CIDR block of the vSwitch and the subnet mask length of the reserved CIDR block cannot be greater than 80.\nNote You must specify one of VSwitchCidrReservationMask and VSwitchCidrReservationCidr."
          },
          "Required": false
        },
        "VSwitchCidrReservationDescription": {
          "Type": "String",
          "Description": {
            "en": "The description of the reserved CIDR block. This parameter is empty by default.\nThe description must be 2 to 256 characters in length. It must start with a letter and cannot start with http:// or https://."
          },
          "Required": false
        },
        "IpVersion": {
          "Type": "String",
          "Description": {
            "en": "The IP version of the reserved CIDR block. Valid values:\nIPv4 (default)\nIPv6"
          },
          "AllowedValues": [
            "IPv6",
            "IPv4"
          ],
          "Required": false
        },
        "VSwitchId": {
          "AssociationPropertyMetadata": {
            "VpcId": "${VpcId}",
            "ZoneId": "${ZoneId}"
          },
          "AssociationProperty": "ALIYUN::VPC::VSwitch::VSwitchId",
          "Type": "String",
          "Description": {
            "en": "The ID of the vSwitch to which the reserved CIDR block belongs."
          },
          "Required": true
        },
        "VSwitchCidrReservationName": {
          "Type": "String",
          "Description": {
            "en": "The name of the reserved CIDR block.\nThe name must be 2 to 128 characters in length and can contain digits, underscores (_), and hyphens (-). It must start with a letter."
          },
          "Required": false
        },
        "Tags": {
          "AssociationPropertyMetadata": {
            "Parameters": {
              "Value": {
                "Type": "String",
                "Description": {
                  "en": "The value of tag N to add to the capacity reservation. Valid values of N: 1 to 20. The tag value can be an empty string. The tag value can be up to 128 characters in length and cannot start with acs:. The tag value cannot contain http:// or https://."
                },
                "Required": false
              },
              "Key": {
                "Type": "String",
                "Description": {
                  "en": "The key of tag N to add to the capacity reservation. Valid values of N: 1 to 20. The tag key cannot be an empty string. The tag key can be up to 128 characters in length and cannot contain http:// or https://. It cannot start with acs: or aliyun."
                },
                "Required": false
              }
            },
            "ListMetadata": {
              "Order": [
                "Key",
                "Value"
              ]
            }
          },
          "AssociationProperty": "List[Parameters]",
          "Type": "Json",
          "Required": false,
          "MaxLength": 20
        },
        "VSwitchCidrReservationMask": {
          "Type": "String",
          "Description": {
            "en": "The subnet mask of the reserved CIDR block.\nWhen IpVersion is set to IPv4, the subnet mask length of the CIDR block must be greater than the IPv4 subnet mask length of the vSwitch and cannot be greater than 28.\nWhen IpVersion is set to IPv6, the subnet mask length of the CIDR block must be greater than the IPv6 subnet mask length of the vSwitch and cannot be greater than 80.\nNote You must specify one of VSwitchCidrReservationMask and VSwitchCidrReservationCidr."
          },
          "Required": false
        }
      },
      "Resources": {
        "VSwitchCidrReservation": {
          "Type": "ALIYUN::VPC::VSwitchCidrReservation",
          "Properties": {
            "VSwitchCidrReservationType": {
              "Ref": "VSwitchCidrReservationType"
            },
            "VSwitchCidrReservationCidr": {
              "Ref": "VSwitchCidrReservationCidr"
            },
            "VSwitchCidrReservationDescription": {
              "Ref": "VSwitchCidrReservationDescription"
            },
            "IpVersion": {
              "Ref": "IpVersion"
            },
            "VSwitchId": {
              "Ref": "VSwitchId"
            },
            "VSwitchCidrReservationName": {
              "Ref": "VSwitchCidrReservationName"
            },
            "Tags": {
              "Ref": "Tags"
            },
            "VSwitchCidrReservationMask": {
              "Ref": "VSwitchCidrReservationMask"
            }
          }
        }
      },
      "Outputs": {
        "VSwitchCidrReservationId": {
          "Description": "The ID of the reserved CIDR block.",
          "Value": {
            "Fn::GetAtt": [
              "VSwitchCidrReservation",
              "VSwitchCidrReservationId"
            ]
          }
        }
      }
    }