DATASOURCE::VPC::VSwitches is used to query the vSwitches that you create.

Syntax

{
  "Type": "DATASOURCE::VPC::VSwitches",
  "Properties": {
    "IsDefault": Boolean,
    "DhcpOptionsSetId": String,
    "RouteTableId": String,
    "VpcId": String,
    "ResourceGroupId": String,
    "VSwitchIds": List,
    "VSwitchOwnerId": String,
    "VSwitchName": String
  }
}

Properties

Property Type Required Editable Description Constraint
IsDefault Boolean No Yes Specifies whether to query the default vSwitch in the region where the stack is deployed. Default value: true. Valid values:
  • true
  • false
DhcpOptionsSetId String No Yes The ID of the Dynamic Host Configuration Protocol (DHCP) options set. None.
RouteTableId String No Yes The ID of the route table. None.
VpcId String No Yes The ID of the virtual private cloud (VPC) to which the vSwitch belongs. None.
ResourceGroupId String No Yes The ID of the resource group to which the vSwitch belongs. None.
VSwitchIds List No Yes The IDs of vSwitches. You can specify up to 20 vSwitch IDs.
VSwitchOwnerId String No Yes The ID of the Alibaba Cloud account to which the vSwitch belongs. None.
VSwitchName String No Yes The name of the vSwitch. None.

Return values (Fn::GetAtt)

  • VSwitchIds: the ID of the vSwitches.
  • VSwitches: the details of the vSwitches.
Property Type Description Constraint
VSwitchIds List The IDs of vSwitches. Example: ['vsw-bp1g7w2q0t1ybav6****','vsw-ag457w2q0t1yba35****'].
VSwitches List The details of the vSwitches. None.
VpcId String The ID of the VPC to which the vSwitch belongs. Example: vpc-257gcdcdq64****.
Status String The status of the vSwitch. Valid values:
  • Pending: The vSwitch is being configured.
  • Available: The vSwitch is available.
IsDefault Boolean Indicates whether the default vSwitch in the region where the stack is deployed is queried. Valid values:
  • true
  • false
AvailableIpAddressCount String The number of available IP addresses in the vSwitch. None.
NetworkAclId String The ID of the network access control list (ACL). Example: nacl-a2do9e413e0spzasx****.
VSwitchId String The ID of the vSwitch. Example: vsw-25bcdxs7pv1****.
CidrBlock String The IPv4 CIDR block of the vSwitch. None.
Description String The description of the vSwitch. None.
ResourceGroupId String The ID of the resource group to which the vSwitch belongs. Example: rg-acfmxazb4ph6aiy****.
ZoneId String The ID of the zone to which the vSwitch belongs. None.
Ipv6CidrBlock String The IPv6 CIDR block of the vSwitch. None.
VSwitchName String The name of the vSwitch. None.
Tags List The tags of the vSwitch. Example:
[{
    "Value": "",
    "Key": "do-not-delete"
}]
RouteTable List The details of the route table. Example:
{
    "RouteTableId": "vtb-bp1rne1a22e0dlwvd****",
    "RouteTableType": "System"
}

Examples

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "VpcId": {
      "Type": "String",
      "Description": "The ID of the VPC to which the vSwitch belongs.",
      "Default": "vpc-257gcdcdq64****"
    }
  },
  "Resources": {
    "ExtensionDataSource": {
      "Type": "DATASOURCE::VPC::VSwitches",
      "Properties": {
        "VpcId": {
          "Ref": "VpcId"
        }
      }
    }
  },
  "Outputs": {
    "VSwitchIds": {
      "Description": "The list of The vSwitch Ids.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "VSwitchIds"
        ]
      }
    },
    "VSwitches": {
      "Description": "The detailed information about the vSwitches.",
      "Value": {
        "Fn::GetAtt": [
          "ExtensionDataSource",
          "VSwitches"
        ]
      }
    }
  }
}