{"record":{"id":"f518fa46a19c858d","repo":"hashicorp/terraform","slug":"error-unsupported-data-source-s","errorCode":null,"errorMessage":"Error: unsupported data source %s","messagePattern":"Error: unsupported data source (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"internal/builtin/providers/terraform/provider.go","lineNumber":109,"sourceCode":"\t}\n}\n\n// ValidateProviderConfig is used to validate the configuration values.\nfunc (p *Provider) ValidateProviderConfig(req providers.ValidateProviderConfigRequest) providers.ValidateProviderConfigResponse {\n\t// At this moment there is nothing to configure for the terraform provider,\n\t// so we will happily return without taking any action\n\tvar res providers.ValidateProviderConfigResponse\n\tres.PreparedConfig = req.Config\n\treturn res\n}\n\n// ValidateDataResourceConfig is used to validate the data source configuration values.\nfunc (p *Provider) ValidateDataResourceConfig(req providers.ValidateDataResourceConfigRequest) providers.ValidateDataResourceConfigResponse {\n\tvar res providers.ValidateDataResourceConfigResponse\n\n\t// This should not happen\n\tif req.TypeName != \"terraform_remote_state\" {\n\t\tres.Diagnostics = res.Diagnostics.Append(fmt.Errorf(\"Error: unsupported data source %s\", req.TypeName))\n\t\treturn res\n\t}\n\n\tdiags := dataSourceRemoteStateValidate(req.Config)\n\tres.Diagnostics = diags\n\n\treturn res\n}\n\nfunc (p *Provider) ValidateListResourceConfig(req providers.ValidateListResourceConfigRequest) providers.ValidateListResourceConfigResponse {\n\tvar resp providers.ValidateListResourceConfigResponse\n\tresp.Diagnostics = resp.Diagnostics.Append(fmt.Errorf(\"unsupported list resource type %q\", req.TypeName))\n\treturn resp\n}\n\n// Configure configures and initializes the provider.\nfunc (p *Provider) ConfigureProvider(providers.ConfigureProviderRequest) providers.ConfigureProviderResponse {\n\t// At this moment there is nothing to configure for the terraform provider,","sourceCodeStart":91,"sourceCodeEnd":127,"githubUrl":"https://github.com/hashicorp/terraform/blob/d32a084675427f5ac3f7d2868578ef8b2c1dc525/internal/builtin/providers/terraform/provider.go#L91-L127","documentation":"The built-in terraform provider exposes exactly one data source, terraform_remote_state. ValidateDataResourceConfig rejects any other TypeName as a defensive invariant — Terraform Core should never route a different data source here because GetProviderSchema advertises only terraform_remote_state.","triggerScenarios":"A providers.ValidateDataResourceConfigRequest with TypeName other than \"terraform_remote_state\" reaching the built-in provider; a misrouted dispatch in Core that targets the built-in terraform address for an external data source.","commonSituations":"A bug in Terraform Core's provider routing or a stale schema cache; tests that wire the built-in provider to the wrong type name; provider address aliasing that collapses an external provider onto the built-in one.","solutions":["Verify the caller dispatches only terraform_remote_state to this provider","Check that GetProviderSchema.DataSources Core cached matches the single terraform_remote_state entry","Route the request to the correct external provider address instead"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before calling Provider.ValidateDataResourceConfig, confirm the type is advertised.\nschema := p.GetProviderProviderSchema() // cached elsewhere as needed\nif _, ok := schema.DataSources[req.TypeName]; !ok {\n    // do not dispatch to this provider; route elsewhere or fail fast\n}","typeGuard":"// Type guard for the built-in terraform provider's single data source.\nfunc isBuiltinTerraformDataSource(name string) bool {\n    return name == \"terraform_remote_state\"\n}","tryCatchPattern":null,"preventionTips":["Always consult GetProviderSchema.DataSources before dispatching ValidateDataResourceConfig","Keep Core's schema cache fresh to avoid routing external types to the built-in provider","In tests, assert the type name matches terraform_remote_state before calling the built-in provider"],"tags":["terraform","go","provider","data-source","invariant"],"backgroundTag":null,"analyzedSha":"d32a084675427f5ac3f7d2868578ef8b2c1dc525","analyzedAt":"2026-08-11T18:43:52.779Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}