Quick Start¶
Get up and running with TofuSoup in minutes.
Prerequisites¶
- TofuSoup installed (see Installation)
- Python 3.11+
- Go 1.21+ (for harness operations)
Your First TofuSoup Commands¶
1. Check Installation¶
Expected output:
2. Explore Available Commands¶
You'll see commands organized by functionality:
- cty - CTY operations
- hcl - HCL operations
- wire - Wire protocol operations
- rpc - RPC testing
- test - Conformance tests
- stir - Matrix testing
- registry - Registry operations
- harness - Test harness management
3. Work with CTY Values¶
Create a simple JSON file:
View it as a CTY structure:
4. Test Wire Protocol Encoding¶
Encode a value to Terraform's wire format:
Decode it back:
5. Run Conformance Tests¶
Run CTY conformance tests:
This validates that Python and Go implementations produce identical results.
6. Build a Test Harness¶
List available harnesses:
Build the Go harness:
7. Matrix Testing with Stir¶
If you have Terraform test cases:
# Create a test directory
mkdir -p my_tests/basic
cd my_tests/basic
# Create main.tf
cat > main.tf <<EOF
terraform {
required_version = ">= 1.0"
}
output "test" {
value = "hello world"
}
EOF
# Run tests
cd ..
soup stir basic/
Common Workflows¶
Testing a Provider Across Versions¶
# Configure matrix in soup.toml
cat > soup.toml <<EOF
[workenv.matrix.versions]
terraform = ["1.5.7", "1.6.0"]
tofu = ["1.8.0", "1.9.0"]
EOF
# Run matrix tests
soup stir my_provider_tests/ --matrix
Validating CTY Compatibility¶
# Test Python implementation against Go reference
soup test cty -v
# Check wire protocol compatibility
soup test wire -v
Working with HCL¶
Registry Operations¶
# Search for a provider
soup registry search provider aws
# Get provider details
soup registry info hashicorp/aws
# Launch interactive browser
soup sui
Configuration¶
Create soup.toml in your project:
[global_settings]
default_python_log_level = "INFO"
[harness_defaults.go]
build_flags = ["-v"]
[workenv.matrix.versions]
terraform = ["1.6.0"]
tofu = ["1.8.0"]
See Configuration Reference for all options.
Next Steps¶
Learn Core Concepts¶
Follow Detailed Guides¶
Reference Documentation¶
Getting Help¶
- CLI Help:
soup <command> --help - FAQ: Frequently asked questions
- Troubleshooting: Common issues and solutions
- GitHub Issues: Report bugs or request features