Provider schema discovery workflow
What a provider schema tells you
A schema describes the interface of a particular installed provider. It identifies configuration fields and the types available for managed resources, data sources and other supported features. Required attributes need a value; optional attributes can be omitted; computed values are supplied by the provider. Optional and computed can occur together. Nested block schemas define their structure and constraints. A sensitive attribute is not a storage guarantee. A schema is an interface inventory, not evidence that a particular account or remote API allows an operation.
Capture an auditable snapshot
Create a fresh disposable root containing only reviewed requirements. Record CLI version, OS/architecture, provider source, exact package release, trusted lockfile, package provenance, source URLs and date. Use an approved mirror with direct downloads disabled by reviewed CLI configuration. Avoid real credentials, remote backends, modules or provisioners. Review the dependency tree first. Even schema inspection can execute a plugin; backend=false is not a sandbox and does not prevent provider or module downloads by itself. The following commands are illustrative, not executed here. The first assumes a complete lockfile and approved mirror.
# Only in an approved, isolated root with reviewed exact pins,# preapproved local mirror and lockfile, no credentials or remote backend.terraform init -backend=false -lockfile=readonlyterraform providers schema -json > provider-schema.jsonCapture exit status, output bytes and checksum and keep the original snapshot immutable. A failed command or empty file is not a valid schema. Do not confuse a schema version with a provider release. Do not include real plans or state as schema evidence.
Interpret a synthetic schema
Here is an invented, abbreviated schema for a catalog provider. No such plugin is required. The name is configured and the ID is computed; version 2 is the fictional resource schema revision, not the package release. The provider has no data source entries in this fixture.
{ "format_version": "1.0", "provider_schemas": { "registry.example.test/learning/catalog": { "provider": { "version": 0, "block": {} }, "resource_schemas": { "catalog_item": { "version": 2, "block": { "attributes": { "name": { "type": "string", "required": true }, "id": { "type": "string", "computed": true } } } } }, "data_source_schemas": {}, "functions": {} } }}Actual schema output uses the documented format_version and provider_schemas structure. Provider keys should be preserved exactly as emitted. In the documented 1.x format, ignore new unrecognized keys when appropriate and reject unsupported major formats. Record optional collections only when present; missing information is not proof of API absence.
Separate capability kinds and evidence
Managed resources represent lifecycle-managed objects, while data sources read information. Provider-defined functions compute values according to their own signatures. Ephemeral resources produce temporary values and have specific permitted contexts. Actions request an operation rather than representing ordinary managed object state. List resources support discovery in compatible query workflows. These feature families require separate CLI, provider and grammar checks. The current schema command documentation describes resource, data source, ephemeral and function maps; do not invent schema keys for actions or list resources if the selected CLI does not expose them. Supplement the inventory with exact release docs, changelog and approved tests. Never infer absence or availability merely from a Registry menu.
Extract and review an inventory
The Python script below reads only the supplied synthetic JSON file. Run from the fixture directory; it is not a Terraform test. Expected output is registry.example.test/learning/catalog followed by a list containing catalog_item.
import jsonfrom pathlib import Path
schema = json.loads(Path("synthetic-schema.json").read_text())if schema["format_version"].split(".")[0] != "1": raise ValueError("Unsupported schema format")for address, provider in sorted(schema["provider_schemas"].items()): print(address, sorted(provider.get("resource_schemas", {})))For a real snapshot, record source, version, platform, hash, feature kind, item name and evidence status. Diff versions to identify added/removed types or attribute changes, then review migration notes, behavior and account policy. A schema diff does not detect every change to defaults or remote semantics. Keep a denominator per version and feature family; do not publish one tutorial per field. The worksheet asks you to document missing evidence and reject an unsupported format.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Provider schema discovery workflow — knowledge check
Review provider selection and schema evidence.
What does terraform providers schema -json describe?
A resource schema has version 2. What does this mean?
Why isolate schema collection?
An inventory parser supports format major 1 and receives 2.0. What should it do?
A schema lists a resource type. What remains unproven?