One of the resources of my custom provider will represent a YAML file and I would like to present the content as a computed field of type
map(any). I think this will be nicer than requiring the end user to use
yamldecode many times to extract values. I see that internally Terraform uses the
zclconf/go-cty-yaml to implement
yamldecode and this looks like exactly what I need. However, I’m not sure what to pass as the second parameter to
Standard.Unmarshal. Should it be
cty.Map(cty.DynamicPseudoType) or something else?
I’ve looked around but I can’t find where in the Terraform codebase the invocation of the
YAMLDecodeFunc occurs. Clearly terraform is able to decode arbitrary YAML into Terraform data types using this same code.