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 ExpandMode to GetModuleContentOption #208

Merged
merged 1 commit into from
Oct 15, 2022
Merged

Add ExpandMode to GetModuleContentOption #208

merged 1 commit into from
Oct 15, 2022

Conversation

wata727
Copy link
Member

@wata727 wata727 commented Oct 15, 2022

See terraform-linters/tflint#1537

terraform-linters/tflint#1537 added support for expanding blocks with the count/for_each meta-arguments. This changes the behavior of the IncludeNotCreated option of GetModuleContent.

If the IncludeNotCreated option is set, resources with count = 0 or for_each = {} will be ignored and blocks will not be expanded. For example, a resource with count = 2 will only return one block, and each.* and count.index will not be evaluated.

This behavior is not intuitive from the option name, so rename it to ExpandMode. ExpandMode corresponds to the IncludeNotCreated option as follows:

  • tflint.ExpandModeExpand
    • IncludeNotCreated = false
  • tflint.ExpandModeNone
    • IncludeNotCreated = true

The IncludeNotCreated option is still available, but deprecated. It will be removed in a future version.

@wata727 wata727 force-pushed the expand_mode branch 2 times, most recently from 7d7a8ea to 6adacdb Compare October 15, 2022 17:46
@wata727 wata727 changed the title Rename IncludeNotCreated option to ExpandMode Add ExpandMode to GetModuleContentOption Oct 15, 2022
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.

1 participant