Hi,
I am developping a custom provider for the first time using the framework plugin with the help from code gen and provider spec gen tools (looks like great tools and I hope Terraform team keep maintaining it and expand on the examples and tutorials).
I am attempting to create a resource for an open api server and using the automatically generated model and schema that includes primitive and a custom type. The custom type is only associated with the response data, and so the field values are unknown until the response is received and so is the case for other primitives in the response.
All stages of the request and response data handling are successful, all primitive attribute types are correctly reflected in the state file but the custom type object is always showing “null” despite verifying the individual field elements are present in the data.
The generated data model includes primitive types attribute and a custom type ResultValue for Result attribute.
The create function for the resource include a final step as :
Resp.state.Set(ctx, &data)
when checking data.Result I can see in the log trace the field elements as received from the API. However when I look at the state file result object shows “null” while all other primitive attributes from the request and response are set correctly.
I have looked at the online documentation and tutorials and could not find a match to help me resolve this final step.
I appreciate any suggestion, insight or useful information to point to the right direction or else if this use case requires code update.
Thank you,
MB.