Skip to content

Commit a8b79cd

Browse files
akocbekakocbekIBM
andauthored
fix: switch to the square bracket syntax when accessing items in list (see [terraform_deprecated_index](https://github.com/terraform-linters/tflint-ruleset-terraform/blob/v0.2.0/docs/rules/terraform_deprecated_index.md)) (#143)
Co-authored-by: Andrej <[email protected]>
1 parent 5daf183 commit a8b79cd

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

variables.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ variable "network_acls" {
165165
# Get flat list of results
166166
flatten([
167167
# Check through rules
168-
for rule in flatten([var.network_acls.*.rules]) :
168+
for rule in flatten([var.network_acls[*].rules]) :
169169
# Return true if there is more than one of `icmp`, `udp`, or `tcp`
170170
true if length(
171171
[
@@ -182,7 +182,7 @@ variable "network_acls" {
182182
condition = length(distinct(
183183
flatten([
184184
# Check through rules
185-
for rule in flatten([var.network_acls.*.rules]) :
185+
for rule in flatten([var.network_acls[*].rules]) :
186186
# Return false action is not valid
187187
false if !contains(["allow", "deny"], rule.action)
188188
])
@@ -194,7 +194,7 @@ variable "network_acls" {
194194
condition = length(distinct(
195195
flatten([
196196
# Check through rules
197-
for rule in flatten([var.network_acls.*.rules]) :
197+
for rule in flatten([var.network_acls[*].rules]) :
198198
# Return false if direction is not valid
199199
false if !contains(["inbound", "outbound"], rule.direction)
200200
])
@@ -206,7 +206,7 @@ variable "network_acls" {
206206
condition = length(distinct(
207207
flatten([
208208
# Check through rules
209-
for rule in flatten([var.network_acls.*.rules]) :
209+
for rule in flatten([var.network_acls[*].rules]) :
210210
# Return false if direction is not valid
211211
false if !can(regex("^([a-z]|[a-z][-a-z0-9]*[a-z0-9])$", rule.name))
212212
])

0 commit comments

Comments
 (0)