How to use loop or something else to make it efficient way not using regex.
variable "instance_auto_renew_period" {
description = "Instance auto-renewal period (in months). Set it to 0 if you want to disable auto renew of DB instance."
default = 0
type = string
validation {
condition = contains(["0", 1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"], var.instance_auto_renew_period)
error_message = "Must be an valid instance_auto_renew_period."
}
}