All Products
Search
Document Center

Resource Orchestration Service:ALIYUN::VPC::VSwitchCidrReservation

更新時間:Apr 28, 2024

ALIYUN::VPC::VSwitchCidrReservation is used to create a reserved CIDR block for a vSwitch.

Syntax

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

Properties

Property

Type

Required

Editable

Description

Constraint

VSwitchCidrReservationType

String

No

No

The type of the reserved CIDR block.

Set the value to prefix. A value of prefix specifies that IP addresses are allocated based on the CIDR block.

Note

When you allocate or the system allocates a CIDR block for an elastic network interface (ENI), the CIDR block must be allocated from the reserved CIDR block. If the reserved CIDR block is exhausted, the system returns an error.

VSwitchCidrReservationCidr

String

No

No

The reserved CIDR block.

  • 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 can be up to 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 can be up to 80.

Note

You must specify VSwitchCidrReservationMask or VSwitchCidrReservationCidr.

When you create a reserved CIDR block for a vSwitch, make sure that the reserved CIDR block does not contain the system-reserved IP addresses of the VPC.

VSwitchCidrReservationDescription

String

No

Yes

The description of the reserved CIDR block.

By default, this property is empty.

The description must be 2 to 256 characters in length. It must start with a letter and cannot start with http:// or https://.

IpVersion

String

No

No

The IP version of the reserved CIDR block.

Valid values:

  • IPv4 (default)

  • IPv6

VSwitchId

String

Yes

No

The ID of the vSwitch for which you want to create the reserved CIDR block.

None.

VSwitchCidrReservationName

String

No

Yes

The name of the reserved CIDR block.

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

Tags

List

No

No

The tags.

You can add up to 20 tags. For more information, see Tags properties.

VSwitchCidrReservationMask

String

No

No

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 can be up to 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 can be up to 80.

Tags syntax

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

Tags properties

Property

Type

Required

Editable

Description

Constraint

Value

String

No

No

The tag value.

You can specify up to 20 tag values. The tag value can be an empty string.

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

Key

String

No

No

The tag key.

You can specify up to 20 tag keys. 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 aliyun or acs:.

Return values

Fn::GetAtt

VSwitchCidrReservationId: the ID of the reserved CIDR block.

Examples

  • YAML format

    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 format

    {
      "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"
            ]
          }
        }
      }
    }