provider-resources: replace AWS-internal patterns with generic Plugin Framework guidance - #79
Conversation
… Framework guidance
|
Duplicate/overlap flag: #41 (@bbasata) also rewrites this same file,
Both are answers to the "should this be split into Framework/SDKv2 skills?" discussion in #14 (@ffalor / @bbasata). Flagging so maintainers can reconcile the two rather than merge one and silently clobber the other. My related #86 ( |
|
Thanks for the heads up @AdamTylerLynch. Will update this thread when resolution is decided. |
|
Thank you for this contribution, @AdamTylerLynch. The Plugin Framework-first provider resource guidance was incorporated into #90 through commit |
The
provider-resourcesskill was written againstterraform-provider-awsinternalswithout saying so:
r.Meta().ExampleClient(ctx),conns.Client,tftags.TagsSchema(),verify.SetTagsDiff,tfresource.NotFound,acctest.ProtoV5ProviderFactories. Noneof these exist outside that repository, so the skill actively misled anyone building
any other provider. It also conflicted with its sibling skills (legacy
ComposeTestCheckFuncvsprovider-test-patterns'ConfigStateChecks; ProtoV5 vsProtoV6; legacy
website/docs/layout vsprovider-docs' tfplugindocs layout).Changes
sources; SDKv2 only for maintaining existing resources; migrate via
terraform-plugin-mux(per the AWS provider's contributor guidance). Removed theSDKv2 example code accordingly
examplecloudclient stored on the resource via astandard
Configure()+ interface assertions — the shape any provider can copytflog.Warn+RemoveResource); Deletetolerates already-deleted; consistent error grammar (
"creating Widget (%s): %s")idguidance: omit a redundantidwhen the API has anatural identifier;
ImportStatePassthroughIDprovider-test-patterns: ProtoV6 factories, modernConfigStateChecks, required coverage (_basic+ import step,_disappears,per-attribute), config style rules (indexed
%[1]q, self-contained configs,randomized names, no hard-coded values)
tfplugindocs/docs/, deferring to theprovider-docsskill — resolving the three-way docs-layout conflictreferences/design-principles.md— resource = smallest building block, oneresource ↔ one API, singular vs plural data source semantics,
relationship/async-task/version modeling
references/retries-and-waiters.md— three eventual-consistency failure classes,status/wait function pairs, post-create not-found retries, typed-error-only retries
Verification:
scripts/validate-structure.shpasses; SKILL.md shrinks 599 → 514lines; zero references to AWS-internal packages remain.
Addresses the acceptance-test coverage, docs-generation, singular+plural data source, changelog, and Framework-first guidance requested in #14 (the follow-up commit adds the
terraform-plugin-muxdetection heuristic suggested there, the recommendation to ship both data source forms, and a changelog checklist item).