Terraform CLI and Framework Versions
Any Terraform or terraform-plugin-framework version.
Use Cases or Problem Statement
There are cases with nested attributes where setting the parent attribute as Computed: true and any underlying attributes to Required: true is invalid. The framework should likely be raising a sort of implementation error in this situation, which might occur in the future. In these cases, the developer should mark those Required: true underlying attributes as Optional: true and Computed: true, but then they need introduce validation similar to Required: true which is not provided out of the by the framework or this Go module. That attribute flag just checks that the configuration value is not null if the attribute's containing object is present.
Proposal
Introduce NotNull/Required validators into the following packages of this Go module:
boolvalidator
float64validator
int64validator
listvalidator
mapvalidator
numbervalidator
objectvalidator
setvalidator
stringvalidator
After this is potentially merged and released, the framework implementation error can be introduced and the framework documentation needs to be updated to highlight the necessary schema changes and these validators for that situation.
Additional Information
Reference: hashicorp/terraform-plugin-framework#898
Code of Conduct
Terraform CLI and Framework Versions
Any Terraform or terraform-plugin-framework version.
Use Cases or Problem Statement
There are cases with nested attributes where setting the parent attribute as
Computed: trueand any underlying attributes toRequired: trueis invalid. The framework should likely be raising a sort of implementation error in this situation, which might occur in the future. In these cases, the developer should mark thoseRequired: trueunderlying attributes asOptional: trueandComputed: true, but then they need introduce validation similar toRequired: truewhich is not provided out of the by the framework or this Go module. That attribute flag just checks that the configuration value is not null if the attribute's containing object is present.Proposal
Introduce
NotNull/Requiredvalidators into the following packages of this Go module:boolvalidatorfloat64validatorint64validatorlistvalidatormapvalidatornumbervalidatorobjectvalidatorsetvalidatorstringvalidatorAfter this is potentially merged and released, the framework implementation error can be introduced and the framework documentation needs to be updated to highlight the necessary schema changes and these validators for that situation.
Additional Information
Reference: hashicorp/terraform-plugin-framework#898
Code of Conduct