From a876f95beaabaa54d181667fa4c07095a7a9f796 Mon Sep 17 00:00:00 2001 From: Byungjin Park Date: Sun, 22 Oct 2023 23:52:54 +0900 Subject: [PATCH] Fix vpc module --- VERSION | 2 +- modules/vpc/variables.tf | 22 ++++++++++++++-------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/VERSION b/VERSION index 25939d3..20f0687 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.29.1 +0.29.2 diff --git a/modules/vpc/variables.tf b/modules/vpc/variables.tf index daa4a2b..edd39bf 100644 --- a/modules/vpc/variables.tf +++ b/modules/vpc/variables.tf @@ -176,17 +176,23 @@ variable "default_network_acl" { nullable = false validation { - condition = alltrue([ - for rule in try(var.default_network_acl.ingress_rules, []) : - contains(["ALLOW", "DENY"], rule.action) - ]) + condition = (var.default_network_acl.ingress_rules != null + ? alltrue([ + for rule in var.default_network_acl.ingress_rules : + contains(["ALLOW", "DENY"], rule.action) + ]) + : true + ) error_message = "Valid values for `action` of each rules are `ALLOW` and `DENY`." } validation { - condition = alltrue([ - for rule in try(var.default_network_acl.egress_rules, []) : - contains(["ALLOW", "DENY"], rule.action) - ]) + condition = (var.default_network_acl.egress_rules != null + ? alltrue([ + for rule in var.default_network_acl.egress_rules : + contains(["ALLOW", "DENY"], rule.action) + ]) + : true + ) error_message = "Valid values for `action` of each rules are `ALLOW` and `DENY`." } }