alicloud_vpc_vbr_ha

更新时间:

Provides a VPC Vbr Ha resource.

For information about VPC Vbr Ha and how to use it, see What is Vbr Ha.

-> NOTE: Available since v1.151.0.

Example Usage

Basic Usage


provider "alicloud" {
  region = "cn-hangzhou"
}

variable "name" {
  default = "tf-example"
}
data "alicloud_regions" "default" {
  current = true
}
data "alicloud_express_connect_physical_connections" "example" {
  name_regex = "^preserved-NODELETING"
}
resource "random_integer" "vlan_id" {
  max = 2999
  min = 1
}
resource "alicloud_express_connect_virtual_border_router" "example" {
  count                      = 2
  local_gateway_ip           = "10.0.0.1"
  peer_gateway_ip            = "10.0.0.2"
  peering_subnet_mask        = "255.255.255.252"
  physical_connection_id     = data.alicloud_express_connect_physical_connections.example.connections[count.index].id
  virtual_border_router_name = format("${var.name}-%d", count.index + 1)
  vlan_id                    = random_integer.vlan_id.id + count.index
  min_rx_interval            = 1000
  min_tx_interval            = 1000
  detect_multiplier          = 10
}

resource "alicloud_cen_instance" "example" {
  cen_instance_name = var.name
  description       = var.name
  protection_level  = "REDUCED"
}

resource "alicloud_cen_instance_attachment" "example" {
  count                    = 2
  instance_id              = alicloud_cen_instance.example.id
  child_instance_id        = alicloud_express_connect_virtual_border_router.example[count.index].id
  child_instance_type      = "VBR"
  child_instance_region_id = data.alicloud_regions.default.regions.0.id
}

resource "alicloud_vpc_vbr_ha" "example" {
  vbr_id      = alicloud_cen_instance_attachment.example[0].child_instance_id
  peer_vbr_id = alicloud_cen_instance_attachment.example[1].child_instance_id
  vbr_ha_name = var.name
  description = var.name
}

Argument Reference

The following arguments are supported:

  • description - (Optional, ForceNew) The description of the VBR switching group. It must be 2 to 256 characters in length and must start with a letter or Chinese, but cannot start with https:// or https://.
  • dry_run - (Optional) The dry run.
  • peer_vbr_id - (Required, ForceNew) The ID of the other VBR in the VBR failover group.
  • vbr_ha_name - (Optional, ForceNew) The name of the VBR failover group.
  • vbr_id - (Required, ForceNew) The ID of the VBR instance.

Attributes Reference

The following attributes are exported:

  • id - The resource ID in terraform of Vbr Ha.
  • status - The state of the VBR failover group.

Timeouts

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

  • create - (Defaults to 10 mins) Used when create the Vbr Ha.
  • delete - (Defaults to 10 mins) Used when delete the Vbr Ha.

Import

VPC Vbr Ha can be imported using the id, e.g.

$ terraform import alicloud_vpc_vbr_ha.example <id>