-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Migrate module to terraform 0.13 #677
Comments
+1 I think we will be targeting this sometime late Q4 |
Also on a different note, the variable validation is scoped to the defined variable. I am wondering how we can use that to validate the situation you mentioned above, i.e prevent user from setting both |
The new syntax allows calling functions within condition of the validation block and even more cool those functions can accept variables as parameters as well. So we should be able to pretty flexible validate vars against other vars. |
I'm not sure we should "upgrade" to Terraform 0.13 for its own sake (we already support 0.13). Instead I'd like to see any upgrade be tied to direct code or feature enhancements. |
@morgante yes I believe we were trying to figure out a way to prevent some GKE misconfigs from occurring by using the new validation feature in 0.13. @ivankorn I meant that we wont be able to validate across two variables. Consider an example like this variable "test_var_1" {
type = number
description = "test var that checks if test_var_1 is greater than 1 and test_var_2 is greater than 2"
validation {
condition = var.test_var_2 > 2 && var.test_var_1 > 1
error_message = "Oops either test_var_1 is less than 1 or test_var_2 is less than 2."
}
}
variable "test_var_2" {
type = number
description = "a number greater than 2"
} this throws an error
In our case here we would need both the |
Wanted to leave a note here that it looks like this module does not support Terraform 0.13's count as it currently stands:
Documentation: https://www.terraform.io/docs/configuration/modules.html#legacy-shared-modules-with-provider-configurations As far as I am able to interpret, we need to replace/remove the |
I'm seeing the same issue with |
0.13 is here, with
for_each
,depends_on
for whole modules and custom variables validation.While
for_each
is more about code cleanup, the vars constraints should really speed-up re-using of the module as we can make API design reflected on vars constraints as well (combinations of variables, possible values etc).F.e. new precise variables validation would help with avoiding such situations
The text was updated successfully, but these errors were encountered: