The Provider.InternalValidate() and Resource.InternalValidate() (which calls schemaMap.InternalValidate(), Importer.InternalValidate()) exported functions in terraform-plugin-sdk provide a way for callers to validate that, for example:
Optional and Required cannot both be set on the same attribute
- If a resource has no
Update, all Computed attributes must be ForceNew
- State upgraders must cover all appropriate schema versions
- Context-aware CRUD functions and their non-context-aware equivalents cannot both be set
While many of these do not apply to terraform-plugin-framework, we should consider whether an equivalent function is appropriate.
The InternalValidate equivalent(s) could validate that:
Alternatively, we can declare a user-run internal validation function an anti-pattern, in which case this issue should be closed and the above validation done through other means.
The
Provider.InternalValidate()andResource.InternalValidate()(which callsschemaMap.InternalValidate(),Importer.InternalValidate()) exported functions interraform-plugin-sdkprovide a way for callers to validate that, for example:OptionalandRequiredcannot both be set on the same attributeUpdate, allComputedattributes must beForceNewWhile many of these do not apply to
terraform-plugin-framework, we should consider whether an equivalent function is appropriate.The
InternalValidateequivalent(s) could validate that:PlanModifiersare not set on data sources (see Attribute plan modification #102)Alternatively, we can declare a user-run internal validation function an anti-pattern, in which case this issue should be closed and the above validation done through other means.