Closed dr-yd closed 2 years ago
Hi, we probably can't investigate this let alone fix it without a reproduction. If you believe the details you shared are relevant to the outcome it should be possible to reproduce. If not, those details aren't relevant to the behavior.
Hi, thanks for the quick response! That's unfortunate, I had hoped maybe the stacktrace would point you in the right direction. I'll see if I can narrow it down. Can you clarify on the meaning of "marked" - is this actually about "marked as sensitive" as the error message would indicate with Terraform itself?
This is coming from cty
, a dynamic type library that Terraform uses to manipulate its typed data in Go. IIRC, marking is a generic feature of cty, effectively an "annotation" on a type value. As far as I know marking is only used for sensitivity at the moment so I think it's very likely the root cause is related to a sensitive value.
As far as I know marking is only used for sensitivity at the moment so I think it's very likely the root cause is related to a sensitive value.
Correct. The following is a minimum reproduction code:
variable "foo" {
default = 1
sensitive = true
}
resource "aws_instance" "foo" {
count = var.foo
}
We probably need to unmark this as well: https://github.com/hashicorp/terraform/blob/v1.2.6/internal/terraform/eval_count.go#L61-L63
Introduction
This occurs in a complex project with multiple levels of nested modules etc. so the issue can't easily be isolated. What I can say is that the values that go into the specified expression are
Maybe that's already enough. I don't think they're marked sensitive, though, so I'm not sure what "marked" refers to. If this is not enough, I can share trace output and code snippets directly to the team.
Expected Behavior
Not crashing.
Actual behavior
Crashing.
Step to Reproduce
See above, likely complex to reproduce.
Additional Context
Samie issue on Linux amd64 so it's not a platform thing. We're unable to use newer versions of Terraform due to an issue that's still being debated in their project.
Output: