alicloud_vpc_vswitch_cidr_reservation

Provides a Vpc Vswitch Cidr Reservation resource. The reserved network segment of the vswitch. This resource type can be used only in ap-southeast region.

For information about Vpc Vswitch Cidr Reservation and how to use it, see What is Vswitch Cidr Reservation.

Example Usage

Basic Usage

variable "name" {
  default = "tf-example"
}
provider "alicloud" {
  region = "ap-southeast-1"
}
data "alicloud_zones" "default" {
  available_resource_creation = "VSwitch"
}

resource "alicloud_vpc" "defaultVpc" {
  vpc_name   = var.name
  cidr_block = "10.0.0.0/8"
}

resource "alicloud_vswitch" "defaultVSwitch" {
  vpc_id       = alicloud_vpc.defaultVpc.id
  cidr_block   = "10.0.0.0/20"
  vswitch_name = "${var.name}1"
  zone_id      = data.alicloud_zones.default.zones.0.id
}


resource "alicloud_vpc_vswitch_cidr_reservation" "default" {
  ip_version                    = "IPv4"
  vswitch_id                    = alicloud_vswitch.defaultVSwitch.id
  cidr_reservation_description  = var.name
  cidr_reservation_cidr         = "10.0.10.0/24"
  vswitch_cidr_reservation_name = var.name
  cidr_reservation_type         = "Prefix"
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Timeouts

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

Import

Vpc Vswitch Cidr Reservation can be imported using the id, e.g.

$ terraform import alicloud_vpc_vswitch_cidr_reservation.example <vswitch_id>:<vswitch_cidr_reservation_id>