Skip to content

Commit 7ca30d9

Browse files
terraform_deprecated_index: add example of fix (#96)
Co-authored-by: Ben Drucker <bvdrucker@gmail.com>
1 parent 599e680 commit 7ca30d9

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

docs/rules/terraform_deprecated_index.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,21 @@ Terraform v0.12 supports traditional square brackets for accessing list items by
5353
## How To Fix
5454

5555
Switch to the square bracket syntax when accessing items in list, including resources that use `count`.
56+
57+
Example:
58+
59+
```hcl
60+
locals {
61+
list = [{a = "b}, {a = "c"}]
62+
value = list.*.a
63+
}
64+
```
65+
66+
Change this to:
67+
68+
```hcl
69+
locals {
70+
list = [{a = "b}, {a = "c"}]
71+
value = list[*].a
72+
}
73+
```

0 commit comments

Comments
 (0)