From 9483ac49f53b1a0aee62bf315c5c71dfd380f210 Mon Sep 17 00:00:00 2001 From: Oskar Gorczowski Date: Fri, 7 Nov 2025 14:06:35 +0100 Subject: [PATCH 1/2] fixed macOs null value handling in contains() function --- modules/terraform-aci-ip-sla-policy/variables.tf | 4 ++-- modules/terraform-aci-vrf/variables.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/terraform-aci-ip-sla-policy/variables.tf b/modules/terraform-aci-ip-sla-policy/variables.tf index b2bcffd0..17036c60 100644 --- a/modules/terraform-aci-ip-sla-policy/variables.tf +++ b/modules/terraform-aci-ip-sla-policy/variables.tf @@ -79,7 +79,7 @@ variable "http_method" { default = null validation { - condition = var.http_method == null || contains(["get"], var.http_method) + condition = var.http_method == null || can(contains(["get"], var.http_method)) error_message = "Valid values are `get`." } } @@ -90,7 +90,7 @@ variable "http_version" { default = null validation { - condition = var.http_version == null || contains(["HTTP10", "HTTP11"], var.http_version) + condition = var.http_version == null || can(contains(["HTTP10", "HTTP11"], var.http_version)) error_message = "Valid values are `HTTP10` or `HTTP11`." } } diff --git a/modules/terraform-aci-vrf/variables.tf b/modules/terraform-aci-vrf/variables.tf index f20bf7bd..e7c4a052 100644 --- a/modules/terraform-aci-vrf/variables.tf +++ b/modules/terraform-aci-vrf/variables.tf @@ -57,7 +57,7 @@ variable "enforcement_direction" { default = null validation { - condition = var.enforcement_direction == null || contains(["ingress", "egress"], var.enforcement_direction) + condition = var.enforcement_direction == null || can(contains(["ingress", "egress"], var.enforcement_direction)) error_message = "Valid values are `ingress` or `egress`." } } From df867bb04f4bf50d36ff5a9728f79a2d1fb8a814 Mon Sep 17 00:00:00 2001 From: Oskar Gorczowski Date: Fri, 7 Nov 2025 14:41:33 +0100 Subject: [PATCH 2/2] change validation for null value --- modules/terraform-aci-ip-sla-policy/variables.tf | 4 ++-- modules/terraform-aci-vrf/variables.tf | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/terraform-aci-ip-sla-policy/variables.tf b/modules/terraform-aci-ip-sla-policy/variables.tf index 17036c60..17b67992 100644 --- a/modules/terraform-aci-ip-sla-policy/variables.tf +++ b/modules/terraform-aci-ip-sla-policy/variables.tf @@ -79,7 +79,7 @@ variable "http_method" { default = null validation { - condition = var.http_method == null || can(contains(["get"], var.http_method)) + condition = var.http_method == null ? true : contains(["get"], var.http_method) error_message = "Valid values are `get`." } } @@ -90,7 +90,7 @@ variable "http_version" { default = null validation { - condition = var.http_version == null || can(contains(["HTTP10", "HTTP11"], var.http_version)) + condition = var.http_version == null ? true : contains(["HTTP10", "HTTP11"], var.http_version) error_message = "Valid values are `HTTP10` or `HTTP11`." } } diff --git a/modules/terraform-aci-vrf/variables.tf b/modules/terraform-aci-vrf/variables.tf index e7c4a052..d2ab9f48 100644 --- a/modules/terraform-aci-vrf/variables.tf +++ b/modules/terraform-aci-vrf/variables.tf @@ -57,7 +57,7 @@ variable "enforcement_direction" { default = null validation { - condition = var.enforcement_direction == null || can(contains(["ingress", "egress"], var.enforcement_direction)) + condition = var.enforcement_direction == null ? true : contains(["ingress", "egress"], var.enforcement_direction) error_message = "Valid values are `ingress` or `egress`." } }