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

Do not walk resource attributes if the resource is not created #785

Merged
merged 1 commit into from Jun 14, 2020

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Jun 4, 2020

Fixes #778

If count is zero or for_each is empty, Terraform will not evaluate the attributes of that resource. On the other hand, TFLint tries to evaluate the expression of any attribute regardless of the meta-arguments. As a result, TFLint sometimes reports errors that are not reported by Terraform.

To avoid this problem, try to ignore resources that may not be evaluated when walking resource attributes and blocks. You may want to walk all the resources, whether they are evaluated or not, but I think we need to provide each API in that case.

@wata727 wata727 force-pushed the skip_walking_when_not_created branch from 7d18947 to e38121d Compare June 5, 2020 14:03
@wata727 wata727 marked this pull request as ready for review June 5, 2020 14:10
@wata727 wata727 merged commit 558964a into master Jun 14, 2020
@wata727 wata727 deleted the skip_walking_when_not_created branch June 14, 2020 08:19
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.

Expression evaluation errors cannot be suppressed by annotations
1 participant