Skip to content

Instantly share code, notes, and snippets.

@guillermo-musumeci
Last active October 6, 2022 21:00
Show Gist options
  • Select an option

  • Save guillermo-musumeci/2e1b845610db0a7fa4e9feee5b8aad14 to your computer and use it in GitHub Desktop.

Select an option

Save guillermo-musumeci/2e1b845610db0a7fa4e9feee5b8aad14 to your computer and use it in GitHub Desktop.
Variable Validation in Terraform
variable "server_name" {
type = string
description = "Server name in letters and numbers only)"
validation {
condition = can(regex("^[0-9A-Za-z]+$", var.storage_account_name))
error_message = "The server name variable must have letters and numbers only"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment