@@ -180,23 +180,15 @@ func (p *Provider) GetSchema(req *terraform.ProviderSchemaRequest) (*terraform.P
180180}
181181
182182// Validate is called once at the beginning with the raw configuration
183- // (no interpolation done) and can return a list of warnings and/or
184- // errors.
183+ // (no interpolation done) and can return diagnostics
185184//
186185// This is called once with the provider configuration only. It may not
187186// be called at all if no provider configuration is given.
188187//
189188// This should not assume that any values of the configurations are valid.
190189// The primary use case of this call is to check that required keys are
191190// set.
192- func (p * Provider ) Validate (c * terraform.ResourceConfig ) ([]string , []error ) {
193-
194- diags := p .ValidateDiag (c )
195-
196- return diags .Warnings (), diags .Errors ()
197- }
198-
199- func (p * Provider ) ValidateDiag (c * terraform.ResourceConfig ) diag.Diagnostics {
191+ func (p * Provider ) Validate (c * terraform.ResourceConfig ) diag.Diagnostics {
200192 if err := p .InternalValidate (); err != nil {
201193 return []* diag.Diagnostic {
202194 {
@@ -209,12 +201,11 @@ func (p *Provider) ValidateDiag(c *terraform.ResourceConfig) diag.Diagnostics {
209201 }
210202 }
211203
212- return schemaMap (p .Schema ).ValidateDiag (c )
204+ return schemaMap (p .Schema ).Validate (c )
213205}
214206
215207// ValidateResource is called once at the beginning with the raw
216- // configuration (no interpolation done) and can return a list of warnings
217- // and/or errors.
208+ // configuration (no interpolation done) and can return diagnostics.
218209//
219210// This is called once per resource.
220211//
@@ -223,12 +214,6 @@ func (p *Provider) ValidateDiag(c *terraform.ResourceConfig) diag.Diagnostics {
223214// The primary use case of this call is to check that the required keys
224215// are set and that the general structure is correct.
225216func (p * Provider ) ValidateResource (
226- t string , c * terraform.ResourceConfig ) ([]string , []error ) {
227- diags := p .ValidateResourceDiag (t , c )
228- return diags .Warnings (), diags .Errors ()
229- }
230-
231- func (p * Provider ) ValidateResourceDiag (
232217 t string , c * terraform.ResourceConfig ) diag.Diagnostics {
233218 r , ok := p .ResourcesMap [t ]
234219 if ! ok {
@@ -240,7 +225,7 @@ func (p *Provider) ValidateResourceDiag(
240225 }
241226 }
242227
243- return r .ValidateDiag (c )
228+ return r .Validate (c )
244229}
245230
246231// Configure configures the provider itself with the configuration
@@ -384,8 +369,7 @@ func (p *Provider) ImportState(
384369}
385370
386371// ValidateDataSource is called once at the beginning with the raw
387- // configuration (no interpolation done) and can return a list of warnings
388- // and/or errors.
372+ // configuration (no interpolation done) and can return diagnostics.
389373//
390374// This is called once per data source instance.
391375//
@@ -394,12 +378,6 @@ func (p *Provider) ImportState(
394378// The primary use case of this call is to check that the required keys
395379// are set and that the general structure is correct.
396380func (p * Provider ) ValidateDataSource (
397- t string , c * terraform.ResourceConfig ) ([]string , []error ) {
398- diags := p .ValidateDataSourceDiag (t , c )
399- return diags .Warnings (), diags .Errors ()
400- }
401-
402- func (p * Provider ) ValidateDataSourceDiag (
403381 t string , c * terraform.ResourceConfig ) diag.Diagnostics {
404382 r , ok := p .DataSourcesMap [t ]
405383 if ! ok {
@@ -411,7 +389,7 @@ func (p *Provider) ValidateDataSourceDiag(
411389 }
412390 }
413391
414- return r .ValidateDiag (c )
392+ return r .Validate (c )
415393}
416394
417395// DataSources returns all of the available data sources that this
0 commit comments