Skip to content

Add "not null" validator for listvalidator, setvalidator, and objectvalidator #105

Closed
@austinvalle

Description

@austinvalle

Terraform CLI and Framework Versions

Terraform v1.3.7
on darwin_arm64

github.com/hashicorp/terraform-plugin-framework v1.1.1

Use Cases or Problem Statement

In relation to blocks, in the SDKv2 you could apply the Required field like so:
https://github.com/hashicorp/terraform-provider-cloudinit/blob/b91da5224dbf17a3302633a3643ebf44c686c148/internal/provider/datasource_cloudinit_config.go#L25

This functionality is currently only present for Attributes as that is preferable over using blocks for newer schema development.

Proposal

  • Add a "not null" validator for usage with listvalidator, setvalidator, and objectvalidator
  • Document in comments + migration guide that this validator is typically only for usage with blocks, otherwise you should use the Required field.

Additional Information

N/A

Code of Conduct

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

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions