Hi,
I’m trying to validate some user input so that it allows lowercase characters. I updated the regex below to contain [a-zA-Z]
instead of [A-Z]
, also tried [[:alpha:]] but for some reason it still doesnt allow lower case chars, only uppercase. I checked with online regex validators and the regex looks correct so I’m not sure what the issue is… maybe I’m missing something elementary?
validation {
condition = length(flatten([for ns_name, ns in var.namespaces : [for u in coalesce(ns.users, []) : u if can(regex("^Type:subject:[a-zA-Z]{1}\\d+$", u))]])) == length(flatten([for ns_name, ns in var.namespaces : [for u in coalesce(ns.users, []) : u]]))
error_message = "Invalid value for user. "
}
this fails validation but I think it should pass. If I use R123456 then it works. I’m on tf 0.14.6.
namespaces = {
ns1 = {
users = ["Type:subject:r123456"]
}
}
Thanks!