hashicorp/terraform · error
unsupported ephemeral resource type
Error message
unsupported ephemeral resource type %q
What it means
The built-in terraform provider declares no ephemeral resource types: EphemeralResourceTypes is an empty map in GetProviderSchema. ValidateEphemeralResourceConfig therefore rejects every call unconditionally. The provider cannot validate any ephemeral resource.
Solutions
- Ensure Core checks GetProviderSchema.EphemeralResourceTypes is non-empty for the type before dispatching
- Route ephemeral requests to a provider that declares the type
- If you intend the built-in provider to serve an ephemeral resource, register it in GetProviderSchema first
Defensive patterns
Strategy: validation
Validate before calling
// The built-in terraform provider serves no ephemeral resources.
schema := p.GetProviderSchema()
if _, ok := schema.EphemeralResourceTypes[req.TypeName]; !ok {
// do not call ValidateEphemeralResourceConfig on this provider
} Type guard
// The built-in terraform provider serves no ephemeral resource types.
func isBuiltinTerraformEphemeralResource(_ string) bool {
return false
} Prevention
- Gate ValidateEphemeralResourceConfig on GetProviderSchema.EphemeralResourceTypes
- Treat an empty EphemeralResourceTypes map as authoritative: no ephemeral resources here
- Keep the schema cache fresh after provider upgrades
When it happens
Trigger: Any providers.ValidateEphemeralResourceConfigRequest reaching the built-in terraform provider; Core dispatching ephemeral-resource validation to the built-in terraform address.
Common situations: A Core code path that skips the schema gate for ephemeral resources; a stale schema cache that lost the empty EphemeralResourceTypes map.
Related errors
- Error: unsupported data source
- Error: unsupported resource
- provider has no function named
- unsupported list resource type
- unsupported state store type
AI-assisted analysis of hashicorp/terraform@d32a084675 (2026-08-11).
Data as JSON: /api/errors/eb9a21faa0131463.
Report an issue: GitHub.
Appendix: source
Thrown at internal/builtin/providers/terraform/provider.go:226
case "terraform_data":
return moveDataStoreResourceState(req)
default:
var resp providers.MoveResourceStateResponse
resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("Error: unsupported resource %s", req.TargetTypeName))
return resp
}
}
// ValidateResourceConfig is used to to validate the resource configuration values.
func (p *Provider) ValidateResourceConfig(req providers.ValidateResourceConfigRequest) providers.ValidateResourceConfigResponse {
return validateDataStoreResourceConfig(req)
}
func (p *Provider) ValidateEphemeralResourceConfig(req providers.ValidateEphemeralResourceConfigRequest) providers.ValidateEphemeralResourceConfigResponse {
var resp providers.ValidateEphemeralResourceConfigResponse
resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported ephemeral resource type %q", req.TypeName))
return resp
}
// OpenEphemeralResource implements providers.Interface.
func (p *Provider) OpenEphemeralResource(req providers.OpenEphemeralResourceRequest) providers.OpenEphemeralResourceResponse {
var resp providers.OpenEphemeralResourceResponse
resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported ephemeral resource type %q", req.TypeName))
return resp
}
// RenewEphemeralResource implements providers.Interface.
func (p *Provider) RenewEphemeralResource(req providers.RenewEphemeralResourceRequest) providers.RenewEphemeralResourceResponse {
var resp providers.RenewEphemeralResourceResponse
resp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf("unsupported ephemeral resource type %q", req.TypeName))
return resp
}
// CloseEphemeralResource implements providers.Interface.View on GitHub (pinned to d32a084675)