I hadn’t planned on implementing the
ValueCreator interface, for perhaps non-intuitive reasons. When implementing the
ValueConverter interface, we know what the input values are going to be: they’re one of our internal representations for one of the Terraform types, which is a limited set. Because of that, the job of the package is straightforward: pick a canonical version of each of those types and set
GoPrimitive.Value to them.
ValueCreator has a more difficult proposition, because the range of input values we can handle is theoretically infinite–
GoPrimitive.Value can be set to any Go type, and the expectation is that we’ll turn it into a
tftypes.Value. This is, obviously, not something we’ll ever be able to satisfy fully.
But maybe there’s a middle ground here where we can create a
tftypes.Value from a certain subset of types, say the built-in Go types and some chosen standard library primitives, and throw an error on everything else. That may strike the right balance of pragmatism, though it seems like a shaky premise to build a provider on to me. I’d love an enhancement issue for this, and we can work through the nuance there in a way that will get tied to the code in context for future maintainers wondering why things are the way they are.