Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,15 @@ resource "alicloud_cen_instance_attachment" "vpc_attach_1" {
instance_id = local.cen_id
child_instance_id = var.vpc_id_1
child_instance_region_id = var.child_instance_region_id_1
child_instance_type = var.child_instance_type
}

resource "alicloud_cen_instance_attachment" "vpc_attach_2" {
count = var.create_cen_instance_attachment ? 1 : 0
instance_id = local.cen_id
child_instance_id = var.vpc_id_2
child_instance_region_id = var.child_instance_region_id_2
child_instance_type = var.child_instance_type
}

resource "alicloud_cen_bandwidth_limit" "this" {
Expand All @@ -55,4 +57,4 @@ resource "alicloud_cen_bandwidth_limit" "this" {
"alicloud_cen_bandwidth_package_attachment.this",
"alicloud_cen_instance_attachment.vpc_attach_1",
"alicloud_cen_instance_attachment.vpc_attach_2"]
}
}
8 changes: 7 additions & 1 deletion varibales.tf
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,12 @@ variable "child_instance_region_id_2" {
default = ""
}

variable "child_instance_type" {
description = "The type of the child instance to attach."
type = string
default = "VPC"
}

#bandwidth limit
variable "create_bandwidth_limit" {
description = "Wether to create bandwidth limit,Default to true."
Expand All @@ -143,4 +149,4 @@ variable "bandwidth_limit" {
description = " The bandwidth configured for the interconnected regions communication."
type = number
default = 4
}
}