Documentation
¶
Overview ¶
Package schemavalidator provides validators to express relationships between multiple attributes within the schema of a resource, data source, or provider. For example, checking that an attribute is present when another is present, or vice-versa.
Index ¶
- func AlsoRequires(attributePaths ...path.Expression) tfsdk.AttributeValidator
- func AtLeastOneOf(attributePaths ...path.Expression) tfsdk.AttributeValidator
- func ConflictsWith(attributePaths ...path.Expression) tfsdk.AttributeValidator
- func ExactlyOneOf(attributePaths ...path.Expression) tfsdk.AttributeValidator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AlsoRequires ¶
func AlsoRequires(attributePaths ...path.Expression) tfsdk.AttributeValidator
AlsoRequires checks that a set of path.Expression has a non-null value, if the current attribute also has a non-null value.
This implements the validation logic declaratively within the tfsdk.Schema.
Relative path.Expression will be resolved against the validated attribute.
func AtLeastOneOf ¶
func AtLeastOneOf(attributePaths ...path.Expression) tfsdk.AttributeValidator
AtLeastOneOf checks that of a set of path.Expression, including the attribute it's applied to, at least one attribute out of all specified is has a non-null value.
This implements the validation logic declaratively within the tfsdk.Schema.
Any relative path.Expression will be resolved against the attribute with this validator.
func ConflictsWith ¶
func ConflictsWith(attributePaths ...path.Expression) tfsdk.AttributeValidator
ConflictsWith checks that a set of path.Expression, including the attribute it's applied to, do not have a value simultaneously.
This implements the validation logic declaratively within the tfsdk.Schema.
Relative path.Expression will be resolved against the validated attribute.
func ExactlyOneOf ¶
func ExactlyOneOf(attributePaths ...path.Expression) tfsdk.AttributeValidator
ExactlyOneOf checks that of a set of path.Expression, including the attribute it's applied to, one and only one attribute out of all specified has a value. It will also cause a validation error if none are specified.
This implements the validation logic declaratively within the tfsdk.Schema.
Relative path.Expression will be resolved against the validated attribute.
Types ¶
This section is empty.