You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think this is covering the same use-case as #15469, and there's already some commentary there about some different ways to represent assertions about "internal" values, rather than input variables. It's likely that something will come for this in a future release, but I'm going to close this issue just to consolidate discussion in #15469.
Thanks again!
In the meantime, one (admittedly awkward) way you can use the variable validation feature to validate something within a module is to write a child module that consists only of a validation rule:
You can instantiate this module setting to_validate to whatever local value you want to validate:
module "validate_foo" {
to_validate = local.foo
}
...and then elsewhere in the module you can use module.validate_foo.validated instead of local.foo to get a result that is guaranteed to have passed your validation rules.
It's too cumbersome for everyday use, but if you have a module that is particularly in need of an internal assertion for some reason then this is a way to get that done with the features as they currently exist.
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.
ghost
locked and limited conversation to collaborators
Jul 30, 2020
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Current Terraform Version
Use-cases
Attempted Solutions
Proposal
References
The text was updated successfully, but these errors were encountered: