Skip to content

Commit ac824e1

Browse files
authored
added conditional checks (#315)
1 parent 9b1f958 commit ac824e1

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

modules/okenetwork/datasources.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,5 @@ data "oci_core_subnets" "oke_subnets" {
2020
}
2121

2222
data "oci_waas_edge_subnets" "waf_cidr_blocks" {
23+
count = var.waf_enabled ? 1 : 0
2324
}

modules/okenetwork/security.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ resource "oci_core_security_list" "pub_lb_seclist" {
258258
# allow only from WAF
259259
dynamic "ingress_security_rules" {
260260
iterator = waf_iterator
261-
for_each = var.waf_enabled == true ? data.oci_waas_edge_subnets.waf_cidr_blocks.edge_subnets : []
261+
for_each = var.waf_enabled == true ? data.oci_waas_edge_subnets.waf_cidr_blocks[0].edge_subnets : []
262262

263263
content {
264264
description = "allow public ingress only from WAF CIDR blocks"

0 commit comments

Comments
 (0)