All Products
Search
Document Center

Resource Orchestration Service:DATASOURCE::VPC::VSwitches

Last Updated:May 18, 2023

DATASOURCE::VPC::VSwitches is used to query created vSwitches.

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 resides.

Valid values:

  • true (default)

  • 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 vSwitch IDs.

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 vSwitch IDs.

  • VSwitches: details of the vSwitches.

Property

Type

Description

Constraint

VSwitchIds

List

The vSwitch IDs.

Example: ['vsw-bp1g7w2q0t1ybav6****','vsw-ag457w2q0t1yba35****'].

VSwitches

List

Details of the vSwitches.

None.

VpcId

String

The ID of the VPC to which the vSwitch belongs.

Example: vpc-257gcdcdq64****.

Status

String

The state of the vSwitch.

Valid values:

  • Pending: The vSwitch is being configured.

  • Available: The vSwitch is available.

IsDefault

Boolean

Indicates whether the vSwitch is the default vSwitch.

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 vSwitch ID.

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 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

Details of the route table.

Example:

{
    "RouteTableId": "vtb-bp1rne1a22e0dlwvd****",
    "RouteTableType": "System"
}

Examples

YAML format

ROSTemplateFormatVersion: '2015-09-01'
Parameters:
  VpcId:
    AssociationProperty: ALIYUN::ECS::VPC::VPCId
    Type: String
    Description: Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud
    Label: Existing VPC Instance ID
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

JSON format

{
  "ROSTemplateFormatVersion": "2015-09-01",
  "Parameters": {
    "VpcId": {
      "AssociationProperty": "ALIYUN::ECS::VPC::VPCId",
      "Type": "String",
      "Description": "Please search the ID starts with (vpc-xxx)from console-Virtual Private Cloud",
      "Label": "Existing VPC Instance ID"
    }
  },
  "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"
        ]
      }
    }
  }
}