TofuSoup

Cross-language conformance testing and developer tools for the Terraform/OpenTofu ecosystem. Verify that your Python, Rust, or Go implementation matches the protocol — down to the wire.

🧪

TofuSoup CLI

A developer toolkit and conformance test runner. Inspect CTY values, encode/decode wire format, validate cross-language RPC behaviour, and run compatibility matrices across Terraform and OpenTofu versions.

soup test all
🔌

terraform-provider-tofusoup

A production Terraform provider with 9 data sources for querying provider/module registries and inspecting state files. Cross-stack references without remote state backends.

data "tofusoup_state_outputs" "app" {}
Polyglot Terraform is hard to get right.
⚠️

Protocol drift

CTY serialization, HCL parsing, and Plugin Protocol v6 wire format have subtle edge cases. A Python implementation that passes functional tests can still produce subtly different bytes than the Go reference — breaking Terraform silently.

🔀

Version fragmentation

Your provider works on Terraform 1.5. Does it work on OpenTofu 1.8? 1.9? Testing across the version matrix by hand doesn't scale.

🔭

No canonical reference

There's no standard tooling for inspecting CTY values, decoding wire-format payloads, or validating protocol behaviour during development. You're flying blind.

soup — developer tools for the Terraform stack.

Each subcommand targets a specific layer of the Terraform protocol. Use them standalone during development or wire them into CI.

soup cty
soup cty viewInspect CTY structures as rich tree views
soup cty convertConvert between JSON, MessagePack, and HCL
soup cty validate-valueValidate a value against a CTY type string
soup cty benchmarkBenchmark encoding/decoding performance
soup hcl
soup hcl viewParse HCL and display the CTY structure
soup hcl convertConvert HCL to JSON or MessagePack
soup wire
soup wire encodeEncode to Terraform's wire format (MessagePack + Base64)
soup wire decodeDecode wire format back to JSON for inspection
soup rpc
soup rpc kv server-startStart a Python or Go RPC server
soup rpc kv get/putClient operations for cross-language RPC testing
soup test
soup test allRun the full conformance suite
soup test cty|hcl|wire|rpcRun a targeted subset
soup stir — test across every version.

A single command runs your provider or tool against a matrix of Terraform and OpenTofu versions in parallel. Catch version-specific regressions before users do.

Terraform 1.5 Terraform 1.6 Terraform 1.7 OpenTofu 1.6 OpenTofu 1.7 OpenTofu 1.8 OpenTofu 1.9
# Run provider tests across all configured versions
soup stir

# Parallel execution — results per version
terraform-1.5  — 48/48 passed
terraform-1.6  — 48/48 passed
opentofu-1.8   — 48/48 passed
opentofu-1.9   — 48/48 passed
Binary-level equivalence. Not just functional.

Functional tests pass. That's not enough. TofuSoup validates that your implementation produces byte-for-byte identical output to the Go reference across CTY serialization, HCL parsing, and wire protocol encoding.

⚖️

Binary Equivalence

Python vs. Go output compared at the byte level. Catches encoding differences that functional tests miss.

🔗

Cross-Language RPC

Start a Go server, connect a Python client — or vice versa. Validate that mTLS, handshake, and message framing work across implementations.

🏗️

Reference Harnesses

Go reference implementations built into the test suite. soup harness build compiles them; the conformance tests use them as ground truth.

🐍

pyvider Integration

First-class testing for pyvider-based providers. The suite validates the full pyvider stack against Terraform's canonical Go behaviour.

Parallel Execution

pytest-based with async support throughout. Matrix runs execute concurrently — full suite in seconds, not minutes.

🔧

CI-Ready

Structured output, exit codes, and soup.toml config. Drop into any pipeline without wrapper scripts.

Query registries. Inspect state.

Nine data sources across two groups. No remote state backends required for cross-stack references.

Registry — 6 data sources
tofusoup_provider_infoProvider details, description, and ownership
tofusoup_provider_versionsAll versions with platform availability
tofusoup_module_infoModule metadata and source details
tofusoup_module_versionsModule version history and compatibility
tofusoup_module_searchSearch modules by query string
tofusoup_registry_searchUnified search across providers and modules
State — 3 data sources
tofusoup_state_infoState file metadata and aggregate statistics
tofusoup_state_resourcesList and filter resources in a state file
tofusoup_state_outputsExtract output values from any state file
Common uses
Cross-stack references without remote backends
Registry discovery before pinning provider versions
State auditing and resource inventory
Automated version tracking across environments
main.tf — cross-stack reference without remote state
data "tofusoup_state_outputs" "networking" {
  path = "../networking/terraform.tfstate"
}

resource "aws_instance" "app" {
  subnet_id = data.tofusoup_state_outputs.networking.values["subnet_id"]
}

data "tofusoup_provider_versions" "aws" {
  provider = "hashicorp/aws"
}
Get started.

TofuSoup is pre-release. The conformance suite and CLI tools are usable today.

TofuSoup on GitHub → Provider on GitHub