Skip to content

Instantly share code, notes, and snippets.

@nicerobot
Forked from karl-cardenas-coding/variable-input.tf
Created May 29, 2020 15:29
Show Gist options
  • Save nicerobot/a29b0c723039305af23c2807e48fe326 to your computer and use it in GitHub Desktop.
Save nicerobot/a29b0c723039305af23c2807e48fe326 to your computer and use it in GitHub Desktop.
Can function
variable "os" {
default = "linux"
validation {
# The condition here identifies if the variable contains the string "linxu" OR "windows".
condition = can(regex("linux|windows", var.os))
error_message = "ERROR: Operating System must be Windows OR Linux."
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment