4
4
"context"
5
5
6
6
"github.com/hashicorp/terraform-plugin-framework/diag"
7
+ "github.com/hashicorp/terraform-plugin-framework/provider"
7
8
"github.com/hashicorp/terraform-plugin-framework/tfsdk"
8
9
"github.com/hashicorp/terraform-plugin-framework/types"
9
10
"github.com/hashicorp/terraform-provider-aws/internal/service/meta"
@@ -12,18 +13,18 @@ import (
12
13
13
14
// New returns a new, initialized Terraform Plugin Framework-style provider instance.
14
15
// 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 {
17
18
Primary : primary ,
18
19
}
19
20
}
20
21
21
- type provider struct {
22
+ type fwprovider struct {
22
23
Primary interface { Meta () interface {} }
23
24
}
24
25
25
26
// 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 ) {
27
28
var diags diag.Diagnostics
28
29
29
30
// 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
291
292
// Configure is called at the beginning of the provider lifecycle, when
292
293
// Terraform sends to the provider the values the user specified in the
293
294
// 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 ) {
295
296
// Provider's parsed configuration (its instance state) is available through the primary provider's Meta() method.
296
297
}
297
298
298
299
// GetResources returns a mapping of resource names to type
299
300
// 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 ) {
301
302
var diags diag.Diagnostics
302
- resources := make (map [string ]tfsdk .ResourceType )
303
+ resources := make (map [string ]provider .ResourceType )
303
304
304
305
return resources , diags
305
306
}
306
307
307
308
// GetDataSources returns a mapping of data source name to types
308
309
// 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 ) {
310
311
var diags diag.Diagnostics
311
- dataSources := make (map [string ]tfsdk .DataSourceType )
312
+ dataSources := make (map [string ]provider .DataSourceType )
312
313
313
314
// TODO: This should be done via service-level self-registration and initializatin in the primary provider.
314
315
t , err := meta .NewDataSourceARNType (ctx )
0 commit comments