-
Notifications
You must be signed in to change notification settings - Fork 9.6k
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
Count parameter throws error with split interpolation function and map variable #3884
Comments
Hi @Deserved! Similarly to #3888, I can no longer reproduce this on
Which version of Terraform are you using. |
Hi @jen20 I am using 0.6.6 I've just checked, it is more than 300 commits since 0.6.6 released to master. So probably it was fixed. Could you please try with 0.6.6 and see if you can replicate, if not it means problem in somewhere else. |
@phinze @jen20 This is still occurring for me in 0.6.11 as well. As was alluded to in previous comments and in some of the related issues, it appears that this is related to the interpolation of a count parameter that is using a module's output. I took the "hashicorp/best-practices" and extended it to provide a reproducible issue. Essentailly we were added an additional "peering" module which leverages outputs of the "public_subnets" and "private_subnets" modules. During the interpolation of the "count" parameter for the "aws_route" resource, we recieve the following If I were to comment out the resource itself and take a look at the "interpolation_debug" output in the state, it is the appropriate value (and the plan proceeds as expected) Diff: hashicorp/best-practices@master...jrnt30:GH-3884-Module-interpolation-issues Erroring Line: hashicorp/best-practices@master...jrnt30:GH-3884-Module-interpolation-issues#diff-a40ed86341ef14520b793a2a198f68f6R31 Full debug log: https://gist.github.com/jrnt30/a55960ce3108639723bf |
As a note, I made an attempt at "pre-computing" the length value in the "parent" module and passing in a set of "count" variables. In doing so, ran across #2301 I can provide another branch for that derivation of this issue if it's helpful |
Running into this issue also in |
And also on |
The same in Terraform v0.6.16 |
This works on master now with 0.7:
I think this is good to close. |
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further. |
The snippet of code below will cause an error:
Errors:
If I use not mapping it will work as expected, snippet of code below will work:
For instance this code will work as-well, despite it uses mapping:
Is it a bug?
The text was updated successfully, but these errors were encountered: