mirror of
https://github.com/opentofu/opentofu.git
synced 2024-12-30 10:47:14 -06:00
aa5d16be79
People with `uuid()` usage in their configurations would receive shadow errors every time on plan because the UUID would change. This is hacky fix but I also believe correct: if a shadow error contains uuid() then we ignore the shadow error completely. This feels wrong but I'll explain why it is likely right: The "right" feeling solution is to create deterministic random output across graph runs. This would require using math/rand and seeding it with the same value each run. However, this alone probably won't work due to Terraform's parallelism and potential to call uuid() in different orders. In addition to this, you can't seed crypto/rand and its unlikely that we'll NEVER use crypto/rand in the future even if we switched uuid() to use math/rand. Therefore, the solution is simple: if there is no shadow error, no problem. If there is a shadow error and it contains uuid(), then ignore it.
4 lines
59 B
HCL
4 lines
59 B
HCL
resource "aws_instance" "test" {
|
|
value = "${uuid()}"
|
|
}
|