Closed cappetta closed 5 years ago
Hi @cappetta,
Can you confirm that count.index
is set on the resource that is causing the error? A complete sample config may help track down the the issue. It also appears that you may have missed running the 0.12upgrade
tool on this particular config, which should point out this type of error. Double check that you've gone through the upgrade guide when switching to 0.12.
Thanks for highlighting the upgrade tool. I'll perform that check/analysis and review the release notes a bit closer. Hoping to circleback over the weekend. RE: sample config - here is a link to the count.index reference
Hi @cappetta!
The resource indicated in the error doesn't seem to have count
set in your config, so the error you got here is correct. In Terraform 0.11 count.index
would've always been zero here, but we made it into an explicit error in 0.12 to help users see when they have made a (common, it turns out) error if forgetting to set count
and then inadvertently connecting all instances of a downstream resource to only the first instance of upstream.
The fix here would be to replace count.index
with 0
if that is the behavior you were expecting, or to set the count
meta-argument if not. I think in this case the upgrade tool may not be able to totally fix this, but I would still recommend running it first and using it as a baseline for subsequent updates.
Thanks Martin. Great eyes - I upgraded multiple installs, performed the 0.12upgrade chk, confirmed CircleCI was green, & all is looking good. Error was on my end, nice to see the alert of the issue & appreciate the quick assist.
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.
I'm seeing this error on terraform v0.12.0 in my circleci env. When I revert the terraform container image back to v0.11.4 it passes as expected. I suspect there is a regression issue. Also note curl had to be added into the container on line 40
Output on build failure 287