I have a data block in my plugin that I want to be able to use an
any type for one of its attributes. The attribute could theoretically accept anything from strings, numbers, bools, lists, objects, etc.
Is this possible? I was looking at the TF framework customType: Plugin Development - Framework: Handling Data - Custom Types | Terraform | HashiCorp Developer but am unsure if this would be able to fit my requirements.
For future readers, this was answered on GitHub: Support for multi-type attributes in providers · Issue #611 · hashicorp/terraform-plugin-framework · GitHub
To summarize, Terraform’s schema type system is very static in nature, however there is the possibility to implement the lower level
DynamicPsuedoType handling as an abstraction in the framework. One particular challenge in that area is that much of the framework’s data handling is meant for 1:1 value:type while dynamic values are handled as more of a type constraint than a type (essentially the value gets wrapped in its own type). In any event, the enhancement can be tracked in Support Dynamic Type/Attributes · Issue #147 · hashicorp/terraform-plugin-framework · GitHub.