Skip to content

Commit 8cca1ee

Browse files
committed
Route Tables attachment is done only for non-existing subnets
Fixes #1
1 parent 3867981 commit 8cca1ee

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

network.tf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ resource "oci_core_subnet" "cn_sftp_lb_subnet" {
105105

106106
resource "oci_core_route_table_attachment" "cn_sftp_lb_subnet_rt_attachment" {
107107

108+
count = (var.lb_subnet_id != "" ? 0 : 1)
109+
108110
route_table_id = oci_core_route_table.cn_sftp_lb_subnet_rt[0].id
109111
subnet_id = data.oci_core_subnet.cn_sftp_lb_subnet.id
110112
}
@@ -127,6 +129,8 @@ resource "oci_core_subnet" "cn_sftp_servers_subnet" {
127129

128130
resource "oci_core_route_table_attachment" "cn_sftp_servers_subnet_rt_attachment" {
129131

132+
count = (var.servers_subnet_id != "" ? 0 : 1)
133+
130134
route_table_id = oci_core_route_table.cn_sftp_servers_subnet_rt[0].id
131135
subnet_id = data.oci_core_subnet.cn_sftp_servers_subnet.id
132136
}

0 commit comments

Comments
 (0)