alicloud_vswitches

This data source provides a list of VSwitches owned by an Alibaba Cloud account.

Example Usage

variable "name" {
  default = "vswitchDatasourceName"
}
data "alicloud_zones" "default" {}

resource "alicloud_vpc" "vpc" {
  cidr_block = "172.16.0.0/16"
  vpc_name   = "${var.name}"
}

resource "alicloud_vswitch" "vswitch" {
  vswitch_name      = "${var.name}"
  cidr_block        = "172.16.0.0/24"
  vpc_id            = "${alicloud_vpc.vpc.id}"
  availability_zone = "${data.alicloud_zones.default.zones.0.id}"
}

data "alicloud_vswitches" "default" {
  name_regex = "${alicloud_vswitch.vswitch.vswitch_name}"
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported in addition to the arguments listed above: