terraform-plugin-sdk
terraform-plugin-sdk copied to clipboard
"ValidateFunc is not yet supported on lists or sets"
Hi, when I am trying to add some validation for TypeList attribute in my resource schema, terraform validate
complain this message. I wonder why Terraform impose such restriction, is it necessary?
thanks
Is there a good reason this isn't supported or does the work just need to be done to implement it?
Is there a workaround for this?
Hi guys!
Any updates on this?
I see a https://github.com/hashicorp/terraform-plugin-sdk/blob/v1.11.0/helper/validation/list.go but it seems that it's unusable because of https://github.com/hashicorp/terraform-plugin-sdk/blob/v1.11.0/helper/schema/schema.go#L852.
it's nearly 3 years now, if there are no plans on implementing this, at least close this issue with acknowledgment.
I needed this today. It would be useful to have ValidateFuncs supported on schema.TypeList
for my use case
is there any workaround for this?
The newer Terraform Plugin Framework, which was released last year, was developed from the ground up to not impose type-based restrictions on configuration validation logic amongst many other benefits. In particular, the HashiCorp Developer website includes framework documentation pages dedicated to validation for resource, data source, and provider configurations. It also provides a SDK migration guide for existing providers, including the ability to iteratively introduce framework resources alongside SDK resources using Terraform Plugin Mux, if desired.
Given the likelihood that this particular feature will not be implemented in this SDK and that it is already implemented in the newer framework, I'm going to close this issue as suggested by https://github.com/hashicorp/terraform-plugin-sdk/issues/156#issuecomment-1105348253.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.