Todos os produtos
Search
Central de documentação

Resource Orchestration Service:ALIYUN::VPC::VSwitchCidrReservation

Última atualização: Jun 27, 2026

Cria um bloco CIDR reservado para um vSwitch.

Sintaxe

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

Propriedades

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

VSwitchCidrReservationType

String

Não

Não

Tipo do bloco CIDR reservado.

Defina o valor como prefix. Esse valor indica que a alocação de endereços IP ocorre com base no bloco CIDR.

Nota

Ao alocar um bloco CIDR para uma interface de rede elástica (ENI), seja manualmente ou pelo sistema, utilize o bloco CIDR reservado. Se o bloco reservado estiver esgotado, o sistema retornará um erro.

VSwitchCidrReservationCidr

String

Não

Não

Bloco CIDR reservado.

  • Se IpVersion for definido como IPv4, o bloco CIDR reservado deve ser um subconjunto próprio do bloco CIDR IPv4 do vSwitch. O comprimento da máscara de sub-rede pode ser de até 28.

  • Se IpVersion for definido como IPv6, o bloco CIDR reservado deve ser um subconjunto próprio do bloco CIDR IPv6 do vSwitch. O comprimento da máscara de sub-rede pode ser de até 80.

Nota

Especifique VSwitchCidrReservationMask ou VSwitchCidrReservationCidr.

Ao criar um bloco CIDR reservado para um vSwitch, certifique-se de que ele não contenha os endereços IP reservados pelo sistema na VPC.

VSwitchCidrReservationDescription

String

Não

Sim

Descrição do bloco CIDR reservado.

Por padrão, esta propriedade está vazia.

A descrição deve ter entre 2 e 256 caracteres, começar com uma letra e não pode iniciar com http:// ou https://.

IpVersion

String

Não

Não

Versão do IP do bloco CIDR reservado.

Valores válidos:

  • IPv4 (padrão)

  • IPv6

VSwitchId

String

Sim

Não

ID do vSwitch ao qual o bloco CIDR será reservado.

Nenhuma.

VSwitchCidrReservationName

String

Não

Sim

Nome do bloco CIDR reservado.

O nome deve ter entre 2 e 128 caracteres, começar com uma letra e pode conter letras, dígitos, sublinhados (_) e hifens (-).

Tags

List

Não

Não

As tags.

Adicione até 20 tags. Para mais informações, consulte Propriedades de Tags.

VSwitchCidrReservationMask

String

Não

Não

Máscara de sub-rede do bloco CIDR reservado.

  • Se IpVersion for definido como IPv4, o comprimento da máscara de sub-rede do bloco CIDR deve ser maior que o da máscara IPv4 do vSwitch, com limite de 28.

  • Se IpVersion for definido como IPv6, o comprimento da máscara de sub-rede do bloco CIDR deve ser maior que o da máscara IPv6 do vSwitch, com limite de 80.

Sintaxe de Tags

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

Propriedades de Tags

Propriedade

Tipo

Obrigatório

Editável

Descrição

Restrição

Value

String

Não

Não

Valor da tag.

Especifique até 20 valores de tag. O valor pode ser uma string vazia.

O valor da tag pode ter até 128 caracteres e não pode conter http:// ou https://. Não pode começar com aliyun ou acs:.

Key

String

Não

Não

Chave da tag.

Especifique até 20 chaves de tag. A chave não pode ser uma string vazia.

A chave da tag pode ter até 128 caracteres e não pode conter http:// ou https://. Não pode começar com aliyun ou acs:.

Valores de retorno

Fn::GetAtt

VSwitchCidrReservationId: o ID do bloco CIDR reservado.

Exemplos

  • YAML formato

    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 formato

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