Skip to content

Resource/Data-Source/Provider level Schema Configuration Validators #48

@detro

Description

@detro

Terraform CLI and Framework Versions

Any Terraform CLI version; terraform-plugin-framework v0.10.0

Use Cases or Problem Statement

Provider developers should be able to validate that given set of attributes in a Resource / Data-Source / Provider, respect a schema specification. The options to define this specification should be similar to what's possible to do with the schemavalidator set of AttributeValidators (see #32).

Proposal

Implement ConfigValidators, each fulfilling the interfaces of DataSourceConfigValidator, ProviderConfigValidator and ResourceConfigValidator.

Package: configvalidator

Proposed utilities to instantiate validators:

  • configvalidator.Conflicting(path.Expression...)
  • configvalidator.AtLeastOneOf(path.Expression...)
  • configvalidator.ExactlyOneOf(path.Expression...)
  • configvalidator.AllOrNone(path.Expression...)

This list is indicative and could be changed/refined during development.

Additional Information

Follow up for: #14, #15, #16, #17, #32
Further details: #32 (review)

Code of Conduct

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requesttype/multiMultiple attribute validatorstype/schemaSchema validators

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions