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

Walk on dynamic blocks partially #293

Merged
merged 1 commit into from
May 29, 2019
Merged

Walk on dynamic blocks partially #293

merged 1 commit into from
May 29, 2019

Conversation

wata727
Copy link
Member

@wata727 wata727 commented May 27, 2019

Terraform 0.12 adds support for dynamic nested blocks. At present, the WalkResourceBlocks API only extracts the structure on HCL and walks on it, so it cannot support such dynamic blocks.

For complete support, we need to evaluate and expand the blocks like Terraform way. ExpandBlock and EvalBlock are likely to be helpful. However, when evaluating a block, we must consider the possibility that the block contains unevaluable values such as unknown or unsupported references. Unfortunately, in that case, we must ignore all that block.

In this PR, in order to avoid this problem, we walk the dynamic block partially as the HCL structure without evaluating the block. So we can't still evaluate expressions that contain iterators, but fortunately, the aws_instance_default_standard_volume rule doesn't require value evaluation.

@wata727 wata727 merged commit c76e049 into master May 29, 2019
@wata727 wata727 deleted the dynamic_blocks branch May 29, 2019 16:03
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

1 participant