I’m using the terraform plugin framework.
Here is a simplified schema:
func (t *T) Schema(_ context.Context, _ resource.SchemaRequest, resp *resource.SchemaResponse) {
resp.Schema = return schema.Schema{
"name": schema.StringAttribute{
Optional: true,
Default: stringdefault.StaticString("john_doe"),
},
}
}
When I do terraform apply
I get this error:
│ Error: Failed to load plugin schemas
│
│ Error while loading schemas for plugin components: Failed to obtain provider schema: Could not load the schema for provider my_provider: failed to retrieve schema from provider
│ "my_provider": Schema Using Attribute Default For Non-Computed Attribute: Attribute "name" must be computed when using default. This is an issue with the provider and should be
│ reported to the provider developers...
Why do attributes with a default value have to be computed
?