1.6 KiB
1.6 KiB
Step 18 — Implementation Detail
Built on 2026-10-07.
providers/gcp.yamlpinsterraform.required_providers.googletohashicorp/google8.6.0.load_providerrequires asourceand an exactversion.TerraformRunner.schema(resource_type, block, find)writes a versions file for the pinned providers in a scratch directory, runsterraform init -backend=falseandterraform providers schema -jsononce per process, and keeps the resource schemas in memory. Measured here: 0.6 seconds and a 9.7 MB reply for the Google provider, from the plugin cache.- With
resource_typealone it lists the arguments code may set (read-only ones are left out) and outlines every block. Withblockit gives one block's arguments with descriptions. Withfindit says where a setting sits, or that the resource type has none. An unknown resource type gets close matches. - The tool is
terraform_schema, tier general, given to the target architect, the IaC author and the validator.
Checked against the real provider on 2026-10-07:
find="startup_cpu_boost"ongoogle_cloud_run_v2_job: "has no argument or block named like 'startup_cpu_boost'. It cannot be set on this resource type."- the same on
google_cloud_run_v2_service:template.containers.resources.startup_cpu_boost (bool, optional).
Not done: generated code is not forced onto the pinned version. An agent that writes its own required_providers with another version is validated against that version. The patterns Skill gives it the pinned versions.tf to use.
Tests: tests/tools/test_local.py, "schema lookup", on a stand-in schema; tests/test_providers.py for the pin.