mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
This disables the computed value check for `count` during the validation pass. This enables partial support for #3888 or #1497: as long as the value is non-computed during the plan, complex values will work in counts. **Notably, this allows data source values to be present in counts!** The "count" value can be disabled during validation safely because we can treat it as if any field that uses `count.index` is computed for validation. We then validate a single instance (as if `count = 1`) just to make sure all required fields are set.
8 lines
138 B
HCL
8 lines
138 B
HCL
data "aws_data_source" "foo" {
|
|
compute = "value"
|
|
}
|
|
|
|
resource "aws_instance" "bar" {
|
|
count = "${data.aws_data_source.foo.value}"
|
|
}
|