-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
More powerful error message generation with custom variable validation #24160
Comments
Thanks for the feedback, @Nevon! It seems reasonable that Since this ability could be added later without a breaking change we may save implementing it until after the feature leaves experimental status, but we'll see how that plays out in relation to other work. Thanks again! |
Would you be open to accepting a PR implementing this, in case I find myself very bored at some point, or should the feature go through some sort of acceptance process before any implementation would be accepted? |
@apparentlymart it looks like this feature has been out of experimental mode for two major releases. In my experience, this issue is a substantial pain point and I am really interested in getting this fixed. I believe #28044 is ready for merging and I'm happy to do anything I can to help push it across the finish line. |
Being able to actually see the value that is causing the error is just simply required when debugging validation issues. |
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. |
Current Terraform Version
Use-cases
When validating lists, sets or maps using custom variable validation, it would be helpful to be able to reference which item in the collection is invalid from within the error message. Imagine adding a new validation to a list with 20 items and trying to figure out which one is invalid.
Attempted Solutions
I thought that I could essentially re-do the validation inside a string interpolation block, such as this:
But this yielded the error message:
Proposal
Allow function calls within the error message so that we can generate more helpful errors.
The text was updated successfully, but these errors were encountered: