-
Notifications
You must be signed in to change notification settings - Fork 9.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PoC: Super simple Plugin Framework data source self-registration #26101
Conversation
…mputed-only nested block.
…mputed-only nested blocks.
% make testacc TESTARGS='-run=TestAccMetaARNDataSource_' PKG=meta ACCTEST_PARALLELISM=2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/meta/... -v -count 1 -parallel 2 -run=TestAccMetaARNDataSource_ -timeout 180m
=== RUN TestAccMetaARNDataSource_basic
=== PAUSE TestAccMetaARNDataSource_basic
=== RUN TestAccMetaARNDataSource_s3Bucket
=== PAUSE TestAccMetaARNDataSource_s3Bucket
=== CONT TestAccMetaARNDataSource_basic
=== CONT TestAccMetaARNDataSource_s3Bucket
--- PASS: TestAccMetaARNDataSource_basic (13.63s)
--- PASS: TestAccMetaARNDataSource_s3Bucket (13.84s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/meta 18.027s
% make testacc TESTARGS='-run=TestAccMediaLive_serial/MultiplexProgram' PKG=medialive
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/medialive/... -v -count 1 -parallel 20 -run=TestAccMediaLive_serial/MultiplexProgram -timeout 180m
=== RUN TestAccMediaLive_serial
=== RUN TestAccMediaLive_serial/MultiplexProgram
=== RUN TestAccMediaLive_serial/MultiplexProgram/basic
=== RUN TestAccMediaLive_serial/MultiplexProgram/disappears
--- PASS: TestAccMediaLive_serial (119.57s)
--- PASS: TestAccMediaLive_serial/MultiplexProgram (119.57s)
--- PASS: TestAccMediaLive_serial/MultiplexProgram/basic (62.74s)
--- PASS: TestAccMediaLive_serial/MultiplexProgram/disappears (56.83s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/medialive 123.758s
% make testacc TESTARGS='-run=TestAccVPC_basic' PKG=ec2
==> Checking that code complies with gofmt requirements...
TF_ACC=1 go test ./internal/service/ec2/... -v -count 1 -parallel 20 -run=TestAccVPC_basic -timeout 180m
=== RUN TestAccVPC_basic
=== PAUSE TestAccVPC_basic
=== CONT TestAccVPC_basic
--- PASS: TestAccVPC_basic (21.14s)
PASS
ok github.com/hashicorp/terraform-provider-aws/internal/service/ec2 25.347s |
This functionality has been released in v4.31.0 of the Terraform AWS Provider. Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading. For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you! |
I'm going to lock this pull request because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. |
Community Note
Relates #26027.
Relates #25715.
Relates #25606.
Introduces a naive self-registration mechanism for data sources implemented using Terraform Plugin Framework.
The ideas can be extended to resources implemented using Terraform Plugin Framework and resources and data sources implemented using Terraform Plugin SDK v2.
internal/intf
(package name up for discussion), two interfacesServiceData
andProviderData
are defined (type names up for discussion).ProviderData
is the interface implemented by the (primary) provider'sMeta
value (currentlyconns.AWSClient
).ServiceData
is implemented by a structure defined in each service package.internal/service/meta
package a structure implementingintf.ServiceData
is defined. It implements a very simple registry that can be added to ininit
methods. In future this can be generated for each service package.conns.AWSClient
structure is modified to implementintf.ProviderData
, including returning a map ofintf.ServiceData
s.ConfigureContextFunc
is called,conns.AWSClient
is available (via theintf.ProviderData
) for the Terraform Plugin Framework provider to use.intf.ProviderData
passed during initialization to build the data source (and in future resource) maps returned to Terraform core.