Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Document "value of 'count' cannot be computed" #17421

Closed
eschwartz opened this issue Feb 23, 2018 · 7 comments
Closed

Document "value of 'count' cannot be computed" #17421

eschwartz opened this issue Feb 23, 2018 · 7 comments

Comments

@eschwartz
Copy link

Based on the number of issues related to this terraform bug, I'd say this is a fairly common problem people are running into.

I know the current line is "this will be addressed in HCL 2.0" (which I fully understand, and I'm greatly looking forward to). But can we at least document this bug in Configuring Resources > Using Variables with Count.

We have a decent workaround in place, but it is not at all obvious. Would it be possible to point users to this workaround in the docs?

@pixelicous
Copy link

encounter this as well, azurerm provider verified compute module, cannot pass an image id from a datasource, it just fails on the same error as everyone else

@endzyme
Copy link

endzyme commented May 5, 2018

Anyone actually have an issue or any docs that assures HCL 2.0 will resolve this particular issue? I am also noticing HCL 2.0 hasn't seen much commit action since March 8th. Anyone at Hashicorp that could chime in would be awesome.

@colindean
Copy link

I just got bit by this hard, losing several hours because I was sure that I, a Terraform newb, was misconfiguring something. Documenting this is important; I've tried to document my own thrashing on it in Eiara/terraform_container_definitions#3. The proposed workarounds aren't working for me even when making local changes to that module.

@colindean
Copy link

I ended up working around the problem in my particular case by templating environment variables and applying the template with the real environment variables: Eiara/terraform_container_definitions#3 (comment)

@alex-gottschalk-roostify
Copy link

alex-gottschalk-roostify commented Nov 9, 2018

I'm getting hit by this issue also. My use case is provisioning security group rules. I would like something like this:

resource "aws_security_group_rule" "sg" {
    count = "${length(var.source_security_groups})"
    source_security_group_id = "${var.source_security_group_ids[count.index]}"
    [... other params ...]
}

This hurts, since aws security groups cannot have multiple sources

@mildwonkey
Copy link
Contributor

Hi all! Sorry for the long silence here.

We have updated the resource count documentation to explain this limitation in detail, and terraform v0.12 also outputs a much clearer error message in this case.

I am going to close this specific issue, since the documentation has been updated. If you are interested in the count limitation, I suggest you follow (and 👍) #12570. Thank you!

@ghost
Copy link

ghost commented Jul 26, 2019

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.

@ghost ghost locked and limited conversation to collaborators Jul 26, 2019
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

7 participants