alicloud_ens_vswitch

更新时间:

Provides a ENS Vswitch resource.

For information about ENS Vswitch and how to use it, see What is Vswitch.

-> NOTE: Available since v1.213.0.

Example Usage

Basic Usage


variable "name" {
  default = "terraform-example"
}

resource "alicloud_ens_network" "default" {
  network_name = var.name

  description   = var.name
  cidr_block    = "192.168.2.0/24"
  ens_region_id = "cn-chenzhou-telecom_unicom_cmcc"
}


resource "alicloud_ens_vswitch" "default" {
  description  = var.name
  cidr_block   = "192.168.2.0/24"
  vswitch_name = var.name

  ens_region_id = "cn-chenzhou-telecom_unicom_cmcc"
  network_id    = alicloud_ens_network.default.id
}

Argument Reference

The following arguments are supported:

  • cidr_block - (Required, ForceNew) The CIDR block of the vSwitch.
  • description - (Optional) The description of the vSwitch.
  • ens_region_id - (Required, ForceNew) ENS Region ID.
  • network_id - (Optional, ForceNew) The ID of the network to which the vSwitch that you want to create belongs.
  • vswitch_name - (Optional) The name of the vSwitch.

Attributes Reference

The following attributes are exported:

  • id - The resource ID in terraform of Vswitch.
  • create_time - The time when the VPC was created.
  • status - The status of the vSwitch.

Timeouts

The timeouts block allows you to specify timeouts for certain actions:

  • create - (Defaults to 5 mins) Used when create the Vswitch.
  • delete - (Defaults to 5 mins) Used when delete the Vswitch.
  • update - (Defaults to 5 mins) Used when update the Vswitch.

Import

ENS Vswitch can be imported using the id, e.g.

$ terraform import alicloud_ens_vswitch.example <id>