@@ -159,24 +159,6 @@ variable "network_acls" {
159159 }
160160 ]
161161
162- validation {
163- error_message = " ACL rules can only have one of `icmp`, `udp`, or `tcp`."
164- condition = length (distinct (
165- # Get flat list of results
166- flatten ([
167- # Check through rules
168- for rule in flatten ([var . network_acls [* ]. rules ]) :
169- # Return true if there is more than one of `icmp`, `udp`, or `tcp`
170- true if length (
171- [
172- for type in [" tcp" , " udp" , " icmp" ] :
173- true if rule [type ] != null
174- ]
175- ) > 1
176- ])
177- )) == 0 # Checks for length. If all fields all correct, array will be empty
178- }
179-
180162 validation {
181163 error_message = " ACL rule actions can only be `allow` or `deny`."
182164 condition = length (distinct (
@@ -344,24 +326,6 @@ variable "security_group_rules" {
344326 })
345327 )
346328
347- validation {
348- error_message = " Security group rules can only have one of `icmp`, `udp`, or `tcp`."
349- condition = (var. security_group_rules == null || length (var. security_group_rules ) == 0 ) ? true : length (distinct (
350- # Get flat list of results
351- flatten ([
352- # Check through rules
353- for rule in var . security_group_rules :
354- # Return true if there is more than one of `icmp`, `udp`, or `tcp`
355- true if length (
356- [
357- for type in [" tcp" , " udp" , " icmp" ] :
358- true if rule [type ] != null
359- ]
360- ) > 1
361- ])
362- )) == 0 # Checks for length. If all fields all correct, array will be empty
363- }
364-
365329 validation {
366330 error_message = " Security group rule direction can only be `inbound` or `outbound`."
367331 condition = (var. security_group_rules == null || length (var. security_group_rules ) == 0 ) ? true : length (distinct (
0 commit comments