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%
Add a data source and import state support to the existing example resource in the HashiCorp scaffold.
git clone https://github.com/hashicorp/terraform-provider-scaffolding-framework.git .
git checkout 3f9b7d20f49724d61ffaa28f5812c347b6a3e4a1
go mod tidyCreate an example_data_source that reads an item by its id attribute. The scaffold already has a data source file - modify it to:
id as a Required String attributename as a Computed String attribute (looked up by ID)Modify the existing example_resource to support Terraform import:
ResourceWithImportState interfaceresource.ImportStatePassthroughID to import by the id attributeImportState: true and ImportStateVerify: trueEnsure the project builds with go build ./....