Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

all: Add support for unknown value refinement data to all validators #250

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from

Conversation

austinvalle
Copy link
Member

@austinvalle austinvalle commented Dec 4, 2024

Ref: hashicorp/terraform-plugin-go#448
Ref: hashicorp/terraform-plugin-framework#1062
Ref: hashicorp/terraform#30937


This PR introduces value refinement support for all relevant validators, based on upcoming changes to terraform-plugin-framework to allow reading unknown value refinement data (first available in Terraform 1.6).

Value refinements are additional constraints that can be applied to unknown values in Terraform that can be used to produce known results from unknown values. The data from these value refinements can be used to raise earlier diagnostics in validators, the available data being:

  • An unknown value will be "not null" after apply
  • An unknown string value will start with a specified prefix after apply
  • An unknown number value will be greater than or less than specified bounds after apply
  • An unknown collection value will have a final length greater than or less than specified bounds after apply

Existing behavior of validators when encountering fully unknown values remain unchanged (either because no refinement data exists, or an older version of Terraform is being used).

TODOs left on this PR

@austinvalle austinvalle added the enhancement New feature or request label Dec 4, 2024
Comment on lines +9 to +10
github.com/hashicorp/terraform-plugin-framework v1.13.1-0.20241203155412-a2d406602012
github.com/hashicorp/terraform-plugin-go v0.25.1-0.20241126200214-bd716fcfe407
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TODO: update with released versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant