Comprehensive documentation and best practices for building Terraform providers with terraform-plugin-framework (v1.17.0). Covers providers, resources, schemas, types, validators, testing, and common pitfalls.
Overall
score
97%
A comprehensive Tessl tile for building Terraform providers with the terraform-plugin-framework.
Published versions: Tessl Registry Source: GitHub Repository
This tile provides comprehensive documentation and best practices for building Terraform providers using github.com/hashicorp/terraform-plugin-framework (v1.17.0). It helps coding agents:
Using Tessl CLI:
tessl install nicholasjackson/terraform-plugin-frameworkUsing npx:
npx @tessl/cli install nicholasjackson/terraform-plugin-frameworkInclude "use terraform-plugin-framework" in your prompts when developing Terraform providers:
Create a new Terraform provider for managing XYZ resources. Use terraform-plugin-framework.The tile provides context about:
docs/)| File | Description |
|---|---|
index.md | Overview and navigation table of contents |
quick-start.md | Getting started guide and when to use the framework |
provider.md | Provider interface, configuration, server setup |
resources.md | Resource CRUD operations, state management, import |
data-sources.md | Data source implementation patterns |
schema.md | Schema system, attributes, blocks, nesting |
types.md | Type system, conversions, null/unknown handling |
validators.md | Built-in and custom validators |
plan-modifiers.md | Plan modifiers, UseStateForUnknown patterns |
functions.md | Provider functions and parameters |
advanced.md | Actions and ephemeral resources |
testing.md | Unit and acceptance testing patterns |
rules/)Best practices and steering guidance automatically loaded by agents:
| File | Description |
|---|---|
diagnostics.md | Always check diagnostics before proceeding |
state-management.md | State consistency patterns and UseStateForUnknown |
schema-design.md | Schema design patterns and attribute modifiers |
testing-standards.md | testify/require requirements and test organization |
common-pitfalls.md | Consolidated gotchas from all framework areas |
Building Terraform providers with terraform-plugin-framework requires understanding:
This tile consolidates this knowledge in an agent-friendly format, reducing trial-and-error and helping agents build correct, well-tested providers following best practices.
This is a documentation tile with steering rules:
Documentation (docs/): Technical reference for framework capabilities, organized by topic (provider, resources, schemas, etc.). Each file explains concepts, shows code examples, and highlights common pitfalls.
Rules (rules/): Best practices and subjective guidance that Tessl consolidates into .tessl/RULES.md. These steer agent behavior automatically (e.g., "always check diagnostics", "use UseStateForUnknown for computed attributes").
When you install this tile, agents (Claude Code, Cursor, etc.) gain context about terraform-plugin-framework without requiring you to explain basic concepts.
The test/ directory contains a two-phase validation script that uses Claude to build a provider from scratch, then validates the output compiles, passes vet, and passes acceptance tests.
claude)tessl)bash test/validate.shThis will:
go build, go vet, TF_ACC=1 go testgo build, go vet, go testOutput is written to test-output/ (gitignored).
| File | Purpose |
|---|---|
test/validate.sh | Main validation runner |
test/prompt.md | Phase 1 prompt (CRUD provider from Petstore API) |
test/prompt-ephemeral.md | Phase 2 prompt (add ephemeral resource) |
test/stream_output.py | Streams Claude's JSON output to terminal |
The evals/ directory contains evaluation scenarios that run on Tessl's cloud infrastructure. Each scenario tests a specific terraform-plugin-framework capability.
| Scenario | Capability | What It Tests |
|---|---|---|
| 1 | schema-validators-plan-modifiers | OneOf/Between validators, UseStateForUnknown/RequiresReplace plan modifiers |
| 2 | resource-crud | New resource with full CRUD, API client, acceptance tests |
| 3 | data-source-import-state | Data source Read method, ImportStatePassthroughID |
| 4 | provider-configuration | Provider schema with env var fallback, ProviderData wiring |
| 5 | provider-function | Provider-defined function with Definition/Run, error handling, unit tests |
All scenarios start from the official HashiCorp scaffold pinned at commit 3f9b7d20.
# Run all scenarios (baseline + with-tile)
tessl eval run
# View results
tessl eval view --last
# Force re-run (ignore cached results)
tessl eval run --force
# Retry a failed run
tessl eval retry <run-id>Each scenario runs twice: a baseline (without the tile) and with-context (with the tile). Scores are compared to measure the tile's impact.
Each scenario directory contains:
evals/scenario-N/
task.md # The prompt given to the agent
criteria.json # Weighted checklist (scores sum to 100)
capability.text # Capability tag for groupingevals/scenario-N/ with task.md, criteria.json, and capability.textcriteria.json scores sum to 100evals/capabilities.jsonevals/summary.json scenario counttessl tile lint to verifytessl eval run to testUse the Tessl publish action for automated publishing:
Create .github/workflows/publish.yml:
name: Publish Tile
on:
push:
tags:
- 'v*'
jobs:
publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: tesslio/publish@v1
with:
tessl_token: ${{ secrets.TESSL_TOKEN }}Tag and push:
git tag v0.1.0
git push origin v0.1.0Submit via Tessl registry:
Verify publication:
Follow semantic versioning in tile.json:
MIT License - See LICENSE file for details.
Install with Tessl CLI
npx tessl i nicholasjackson/terraform-plugin-framework