terraform-plugin-go version
Use cases
Downstream implementations, whether SDKs or providers, may need to retrieve the tftypes.Type equivalent of tfprotov5/tfprotov6 schema types such as:
Schema
SchemaAttribute
SchemaBlock
SchemaNestedBlock
SchemaObject
For example, this is necessary for calling (DynamicValue).Unmarshal(), which is necessary for data handling of ApplyResourceChange and other RPCs.
Attempted solutions
Manually (re-)implementing this logic downstream.
Proposal
Implement methods such as the following:
// package tfprotov5
func (s *Schema) Type() tftypes.Type { /* ... */ }
func (s *SchemaAttribute) Type() tftypes.Type { /* ... */ }
func (s *SchemaBlock) Type() tftypes.Type { /* ... */ }
func (s *SchemaNestedBlock) Type() tftypes.Type { /* ... */ }
// package tfprotov6
func (s *Schema) Type() tftypes.Type { /* ... */ }
func (s *SchemaAttribute) Type() tftypes.Type { /* ... */ }
func (s *SchemaBlock) Type() tftypes.Type { /* ... */ }
func (s *SchemaNestedBlock) Type() tftypes.Type { /* ... */ }
func (s *SchemaObject) Type() tftypes.Type { /* ... */ }
With associated unit testing.
References
terraform-plugin-go version
Use cases
Downstream implementations, whether SDKs or providers, may need to retrieve the
tftypes.Typeequivalent oftfprotov5/tfprotov6schema types such as:SchemaSchemaAttributeSchemaBlockSchemaNestedBlockSchemaObjectFor example, this is necessary for calling
(DynamicValue).Unmarshal(), which is necessary for data handling ofApplyResourceChangeand other RPCs.Attempted solutions
Manually (re-)implementing this logic downstream.
Proposal
Implement methods such as the following:
With associated unit testing.
References