@@ -154,10 +154,10 @@ func WithDefaultResourceFn(f DefaultResourceFn) ProviderOption {
154
154
}
155
155
}
156
156
157
- // NewProviderWithSchema builds and returns a new Provider from provider
157
+ // NewProvider builds and returns a new Provider from provider
158
158
// tfjson schema, that is generated using Terraform CLI with:
159
159
// `terraform providers schema --json`
160
- func NewProviderWithSchema (schema []byte , prefix string , modulePath string , metadataPath string , opts ... ProviderOption ) * Provider {
160
+ func NewProvider (schema []byte , prefix string , modulePath string , metadataPath string , opts ... ProviderOption ) * Provider {
161
161
ps := tfjson.ProviderSchemas {}
162
162
if err := ps .UnmarshalJSON (schema ); err != nil {
163
163
panic (err )
@@ -170,13 +170,8 @@ func NewProviderWithSchema(schema []byte, prefix string, modulePath string, meta
170
170
rs = v .ResourceSchemas
171
171
break
172
172
}
173
- return NewProvider (conversiontfjson .GetV2ResourceMap (rs ), prefix , modulePath , metadataPath , opts ... )
174
- }
175
173
176
- // NewProvider builds and returns a new Provider.
177
- // Deprecated: This function will be removed soon, please use
178
- // NewProviderWithSchema instead.
179
- func NewProvider (resourceMap map [string ]* schema.Resource , prefix string , modulePath string , metadataPath string , opts ... ProviderOption ) * Provider {
174
+ resourceMap := conversiontfjson .GetV2ResourceMap (rs )
180
175
p := & Provider {
181
176
ModulePath : modulePath ,
182
177
TerraformResourcePrefix : fmt .Sprintf ("%s_" , prefix ),
@@ -213,7 +208,6 @@ func NewProvider(resourceMap map[string]*schema.Resource, prefix string, moduleP
213
208
214
209
p .Resources [name ] = p .DefaultResourceFn (name , terraformResource )
215
210
}
216
-
217
211
return p
218
212
}
219
213
0 commit comments