The approach here is a little hacky, since this edge case applies only to
validate and all of the other evaluateResourceCountExpression callers
don't care about it: we overload the "count" return value as a flag to
allow NodeValidatableResource to allow it to detect this situation and
silently ignore errors in this case.
Detail:`The "count" value depends on resource attributes that cannot be determined until apply, so Terraform cannot predict how many instances will be created. To work around this, use the -target argument to first apply only the resources that the count depends on.`,
Subject:expr.Range().Ptr(),
})
return-1,diags
// We return zero+errors in this one case to allow callers to handle
// an unknown count as special. This is rarely necessary, but is used
// by the validate walk in particular so that it can just skip
// validation in this case, assuming a later walk will take care of it.