Queries existing vSwitches.
Syntax
{
"Type": "DATASOURCE::VPC::VSwitches",
"Properties": {
"IsDefault": Boolean,
"DhcpOptionsSetId": String,
"RouteTableId": String,
"VpcId": String,
"ResourceGroupId": String,
"VSwitchIds": List,
"VSwitchOwnerId": String,
"VSwitchName": String,
"RefreshOptions": String
}
}
Properties
|
Property |
Type |
Required |
Editable |
Description |
Constraint |
|
IsDefault |
Boolean |
No |
Yes |
Specifies whether to query the default vSwitch in the region of the stack. |
Valid values:
|
|
DhcpOptionsSetId |
String |
No |
Yes |
The ID of the DHCP options set. |
None. |
|
RouteTableId |
String |
No |
Yes |
The ID of the route table. |
None. |
|
VpcId |
String |
No |
Yes |
The ID of the VPC to which the vSwitch belongs. |
None. |
|
ResourceGroupId |
String |
No |
Yes |
The ID of the resource group to which the vSwitch belongs. |
None. |
|
|
List |
No |
Yes |
The vSwitch IDs. |
You can specify up to 20 vSwitch IDs. |
|
|
String |
No |
Yes |
The ID of the Alibaba Cloud account to which the vSwitch belongs. |
None. |
|
|
String |
No |
Yes |
The vSwitch name. |
None. |
|
RefreshOptions |
String |
No |
Yes |
The refresh policy for data source resources when the stack is updated. |
Valid values:
|
Return values (Fn::GetAtt)
-
VSwitchIds: the IDs of the vSwitches. -
VSwitches: details of the vSwitches.
|
Property |
Type |
Description |
Constraint |
|
|
List |
The vSwitch IDs. |
Example: |
|
|
List |
Details of the vSwitches. |
None. |
|
VpcId |
String |
The ID of the VPC to which the vSwitch belongs. |
Example: |
|
Status |
String |
The status of the vSwitch. |
Valid values:
|
|
IsDefault |
Boolean |
Indicates whether the vSwitch is the default vSwitch. |
Valid values:
|
|
AvailableIpAddressCount |
String |
The number of available IP addresses in the vSwitch. |
None. |
|
NetworkAclId |
String |
The ID of the network ACL. |
Example: |
|
|
String |
The vSwitch ID. |
Example: |
|
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: |
|
ZoneId |
String |
The zone to which the vSwitch belongs. |
None. |
|
Ipv6CidrBlock |
String |
The IPv6 CIDR block of the vSwitch. |
None. |
|
|
String |
The vSwitch name. |
None. |
|
Tags |
List |
The tags of the vSwitch. |
Example:
|
|
RouteTable |
List |
Details of the route table. |
Example:
|
Examples
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{
"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"
]
}
}
}
}