i am trying to create a Terraform provider using the Terraform Plugin Framework (v1.1.1).
In my implementation, when I test out the provider, I get the following error:
╷
│ Error: Value Conversion Error
│
│ with data.circleci_webhooks.project_webhooks,
│ on main.tf line 14, in data "circleci_webhooks" "project_webhooks":
│ 14: data "circleci_webhooks" "project_webhooks" {
│
│ An unexpected error was encountered trying to convert from struct value. This is always an error in the provider. Please report the following to the provider
│ developer:
│
│ couldn't find type information for attribute in supplied attr.Type basetypes.ObjectType
╵
I observed the error above occurred on this line of my (public) code:
I understand that this issue is bubbled up from this specific code:
However, as I am totally new to Go, I’m unsure where the issue is.
I suspect it’s to do with my schema definition, but I have no idea where exactly is basetypes.ObjectType type declared.
Since my source code is public, you can see the entire data source implementation here:
Apologies for dumping a huge chunk of test, but I’m unsure what that cryptic error message means (to me at least).
I believe the error that you’re seeing is because the webhooks section of your schema does not contain an entry for updated_at. So I think you need to add something like the following:
"updated_at": schema.StringAttribute{
MarkdownDescription: "The date and time the webhook was updated",
Computed: true,
},
As an aside, if Scope within a WebhookPayload is nil then the code will panic. If Type within WebhookPayloadScope is nil then that will also cause a panic.
Thank you so much for your tips here.
I wanted to share that I was able to resolve the issue thanks to your guidance;
I was indeed missing the updated_at schema declaration!