Skip to content

Commit 9f13bc3

Browse files
committed
1 parent 6bdaf93 commit 9f13bc3

File tree

3 files changed

+18
-15
lines changed

3 files changed

+18
-15
lines changed

internal/provider/fwprovider/provider.go

+10-9
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"context"
55

66
"github.com/hashicorp/terraform-plugin-framework/diag"
7+
"github.com/hashicorp/terraform-plugin-framework/provider"
78
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
89
"github.com/hashicorp/terraform-plugin-framework/types"
910
"github.com/hashicorp/terraform-provider-aws/internal/service/meta"
@@ -12,18 +13,18 @@ import (
1213

1314
// New returns a new, initialized Terraform Plugin Framework-style provider instance.
1415
// The provider instance is fully configured once the `Configure` method has been called.
15-
func New(primary interface{ Meta() interface{} }) tfsdk.Provider {
16-
return &provider{
16+
func New(primary interface{ Meta() interface{} }) provider.Provider {
17+
return &fwprovider{
1718
Primary: primary,
1819
}
1920
}
2021

21-
type provider struct {
22+
type fwprovider struct {
2223
Primary interface{ Meta() interface{} }
2324
}
2425

2526
// GetSchema returns the schema for this provider's configuration.
26-
func (p *provider) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
27+
func (p *fwprovider) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostics) {
2728
var diags diag.Diagnostics
2829

2930
// This schema must match exactly the Terraform Protocol v5 (Terraform Plugin SDK v2) provider's schema.
@@ -291,24 +292,24 @@ func (p *provider) GetSchema(ctx context.Context) (tfsdk.Schema, diag.Diagnostic
291292
// Configure is called at the beginning of the provider lifecycle, when
292293
// Terraform sends to the provider the values the user specified in the
293294
// provider configuration block.
294-
func (p *provider) Configure(ctx context.Context, request tfsdk.ConfigureProviderRequest, response *tfsdk.ConfigureProviderResponse) {
295+
func (p *fwprovider) Configure(ctx context.Context, request provider.ConfigureRequest, response *provider.ConfigureResponse) {
295296
// Provider's parsed configuration (its instance state) is available through the primary provider's Meta() method.
296297
}
297298

298299
// GetResources returns a mapping of resource names to type
299300
// implementations.
300-
func (p *provider) GetResources(ctx context.Context) (map[string]tfsdk.ResourceType, diag.Diagnostics) {
301+
func (p *fwprovider) GetResources(ctx context.Context) (map[string]provider.ResourceType, diag.Diagnostics) {
301302
var diags diag.Diagnostics
302-
resources := make(map[string]tfsdk.ResourceType)
303+
resources := make(map[string]provider.ResourceType)
303304

304305
return resources, diags
305306
}
306307

307308
// GetDataSources returns a mapping of data source name to types
308309
// implementations.
309-
func (p *provider) GetDataSources(ctx context.Context) (map[string]tfsdk.DataSourceType, diag.Diagnostics) {
310+
func (p *fwprovider) GetDataSources(ctx context.Context) (map[string]provider.DataSourceType, diag.Diagnostics) {
310311
var diags diag.Diagnostics
311-
dataSources := make(map[string]tfsdk.DataSourceType)
312+
dataSources := make(map[string]provider.DataSourceType)
312313

313314
// TODO: This should be done via service-level self-registration and initializatin in the primary provider.
314315
t, err := meta.NewDataSourceARNType(ctx)

internal/service/meta/arn_data_source_fw.go

+6-4
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

internal/service/meta/svcimpl.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ package meta
33
import (
44
"context"
55

6-
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
6+
"github.com/hashicorp/terraform-plugin-framework/provider"
77
)
88

9-
func registerDataSourceTypeFactory(name string, factory func(context.Context) (tfsdk.DataSourceType, error)) {
9+
func registerDataSourceTypeFactory(name string, factory func(context.Context) (provider.DataSourceType, error)) {
1010
}

0 commit comments

Comments
 (0)