Skip to content

Commit c604a85

Browse files
authored
fix: remove acl and sg validation rule (#163)
1 parent 2c3fa6a commit c604a85

File tree

2 files changed

+4
-40
lines changed

2 files changed

+4
-40
lines changed

module-metadata.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@
202202
],
203203
"pos": {
204204
"filename": "variables.tf",
205-
"line": 398
205+
"line": 362
206206
}
207207
},
208208
"security_group_rules": {
@@ -221,7 +221,7 @@
221221
],
222222
"pos": {
223223
"filename": "variables.tf",
224-
"line": 314
224+
"line": 296
225225
}
226226
},
227227
"subnets": {
@@ -259,7 +259,7 @@
259259
],
260260
"pos": {
261261
"filename": "variables.tf",
262-
"line": 251
262+
"line": 233
263263
}
264264
},
265265
"tags": {
@@ -312,7 +312,7 @@
312312
],
313313
"pos": {
314314
"filename": "variables.tf",
315-
"line": 225
315+
"line": 207
316316
}
317317
}
318318
},

variables.tf

Lines changed: 0 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)