Skip to content

Instantly share code, notes, and snippets.

@karl-cardenas-coding
Last active May 29, 2020 15:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save karl-cardenas-coding/49bf8dec6f6190937b0afd98ac389fa6 to your computer and use it in GitHub Desktop.
Save karl-cardenas-coding/49bf8dec6f6190937b0afd98ac389fa6 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