provider-resources: replace AWS-internal patterns with generic Plugin Framework guidance - #79
Open
AdamTylerLynch wants to merge 2 commits into
Open
Conversation
… Framework guidance
Contributor
Author
|
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 ( |
Collaborator
|
Thanks for the heads up @AdamTylerLynch. Will update this thread when resolution is decided. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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).