Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add terraform_deprecated_index (disallows foo.0) #784

Merged
merged 3 commits into from
Jun 5, 2020

Conversation

bendrucker
Copy link
Member

@bendrucker bendrucker commented Jun 4, 2020

This adds a rule that disallows the legacy dot/attribute syntax for accessing indexes in a list. This syntax was officially recommended in v0.11:

https://www.terraform.io/docs/configuration-0-11/interpolation.html

And because most official providers still use 0.11 syntax in their docs, I still see this used quite a bit:

https://www.terraform.io/docs/providers/kubernetes/r/service_account.html
https://www.terraform.io/docs/providers/aws/r/acm_certificate_validation.html

It is no longer present in the 0.12 documentation and didn't even make the HCL spec:

hashicorp/hcl#305

@bendrucker bendrucker requested a review from wata727 June 4, 2020 04:05
@wata727
Copy link
Member

wata727 commented Jun 4, 2020

Good job!

I like this rule, but I'm a bit concerned about how much this syntax is used. If it's already widely used, it may be nonsense to encourage all to be fixed. What do you think?

Copy link
Member

@wata727 wata727 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@bendrucker bendrucker merged commit 84666ca into master Jun 5, 2020
@bendrucker bendrucker deleted the terraform-deprecated-index branch June 17, 2020 03:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants